# Rest API for elastic apm

**URL:** https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115
**Category:** APM
**Created:** [November 15, 2019, 5:53pm UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115 "2019-11-15T17:53:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gopikrishnan](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gopikrishnan](https://discuss.elastic.co/u/gopikrishnan)
#### Post date: [November 15, 2019, 5:53pm UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/1 "2019-11-15T17:53:49Z")

</div>

Hi Team,

Am new to elastic and trying to explore elastic apm and its capabilities..So is there a way to export data from elastic apm via rest api or something?

Regards,  
Gopikrishnan

---

<div class="post-metadata">

### Author: ![mikker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikker/32/22118_2.png) [@mikker](https://discuss.elastic.co/u/mikker)
#### Post date: [November 16, 2019, 8:29am UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/2 "2019-11-16T08:29:17Z")

</div>

Hi Gopikrishnan!

If you have APM set up with an agent in your app, APM Server and Elasticsearch, you can access the data just like would with any data in Elasticsearch. The APM data is, in the end, just documents in Elasticsearch.

Elasticsearch provides a REST api, see [https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html)

Hope it helps!

---

<div class="post-metadata">

### Author: ![gopikrishnan](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gopikrishnan](https://discuss.elastic.co/u/gopikrishnan)
#### Post date: [November 16, 2019, 9:32am UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/3 "2019-11-16T09:32:37Z")

</div>

Hi @mikker

how can I get total request count and response time from of a request for a last hour directly via rest api since in document in elastic search i will have to check multiple documents for last hour and aggregate.

---

<div class="post-metadata">

### Author: ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)
#### Post date: [November 18, 2019, 12:54am UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/4 "2019-11-18T00:54:17Z")

</div>

@gopikrishnan there is no REST API to query those metrics directly; you'll need to query the underlying data, using Elasticsearch queries, as a combination of search & aggregation.

You may find the dashboards useful, as a source of inspiration for forming those queries: [https://github.com/elastic/apm-contrib/tree/master/kibana/7.x](https://github.com/elastic/apm-contrib/tree/master/kibana/7.x)

---

<div class="post-metadata">

### Author: ![vpishere](https://avatars.discourse-cdn.com/v4/letter/v/a88e57/32.png) [@vpishere](https://discuss.elastic.co/u/vpishere)
#### Post date: [November 19, 2019, 6:40am UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/5 "2019-11-19T06:40:26Z")

</div>

Dear Andrew,

Thanks for the update. We will check on this and update

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 10, 2019, 2:53am UTC](https://discuss.elastic.co/t/rest-api-for-elastic-apm/208115/6 "2019-12-10T02:53:02Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
