# API - Get count of latest

**URL:** https://meta.discourse.org/t/api-get-count-of-latest/91580
**Category:** Support
**Created:** [4 juli 2018 om 17:28 UTC](https://meta.discourse.org/t/api-get-count-of-latest/91580 "2018-07-04T17:28:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rbrlortie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rbrlortie/32/166740_2.png) [@rbrlortie](https://meta.discourse.org/u/rbrlortie)
#### Post date: [4 juli 2018 om 17:28 UTC](https://meta.discourse.org/t/api-get-count-of-latest/91580/1 "2018-07-04T17:28:16Z")

</div>

Hi,

We need to display statistics about our Discourse instance on our main website.

We managed to display the total number of posts (call site.json, loop categories and addition all topic\_count together).

However, we can’t seem to find a way to get the latest post amount.

Is there a way that we missed? Some helpful API call that would return only the latest (24h but we can settle for 48h) content?

Thanks,

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [4 juli 2018 om 17:51 UTC](https://meta.discourse.org/t/api-get-count-of-latest/91580/2 "2018-07-04T17:51:07Z")

</div>

Some of the data you are looking for is available at `/about.json`. It will give you the total number of posts and topics, and also data for the last 7 days and the last 30 days.

To get the post count for a specific time period, you can make an API call to any of the admin reports that are displayed on your site’s dashboard. For the `posts` report, you can make a query to `/admin/reports/posts.json`. The `start_date` and `end_date` can be set as query parameters.

---

<div class="post-metadata">

### Author: ![rbrlortie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rbrlortie/32/166740_2.png) [@rbrlortie](https://meta.discourse.org/u/rbrlortie)
#### Post date: [4 juli 2018 om 19:33 UTC](https://meta.discourse.org/t/api-get-count-of-latest/91580/3 "2018-07-04T19:33:47Z")

</div>

I would have never imagined that the admin reports also had .json endpoints. That’s awesome.

Thank you!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [3 augustus 2018 om 19:33 UTC](https://meta.discourse.org/t/api-get-count-of-latest/91580/4 "2018-08-03T19:33:54Z")

</div>

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