# How to use Kibana API in plugin development

**URL:** https://discuss.elastic.co/t/how-to-use-kibana-api-in-plugin-development/291131
**Category:** Kibana
**Created:** [December 7, 2021, 2:37pm UTC](https://discuss.elastic.co/t/how-to-use-kibana-api-in-plugin-development/291131 "2021-12-07T14:37:37Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)
#### Post date: [December 7, 2021, 4:21pm UTC](https://discuss.elastic.co/t/how-to-use-kibana-api-in-plugin-development/291131/2 "2021-12-07T16:21:18Z")

</div>

Hi @Fabio-sama, inside Kibana plugin you shouldn't use REST API for this, but should use other plugins instead.

In this case you need to depend on `data` plugin which provides services for working with index patterns (they are called `data views` now in main branch).

Not sure if you've seen, but we have a bunch of examples plugins. We don't have many with server-side code though, but this one might be useful:

> **[kibana/examples/search\_examples/server at main · elastic/kibana](https://github.com/elastic/kibana/tree/main/examples/search_examples/server)**
>
> main/examples/search\_examples/server

To run kibana with these plugins start development with: `yarn start --run-examples` and you will have `Developer Examples` app in a side menu

Similar how that examples plugins uses data.search server side, you'll need to use data.indexPatterns

> <https://github.com/elastic/kibana/blob/44c19bd2ca94810ef8fdc88aa07e3e73aff9e666/src/plugins/data/server/plugin.ts#L115>

---

_[View the full topic](https://discuss.elastic.co/t/how-to-use-kibana-api-in-plugin-development/291131)._
