# Get total list of topics and their view counts from Discourse API

**URL:** https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596
**Category:** Development
**Created:** [July 29, 2021, 6:23pm UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596 "2021-07-29T18:23:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![paigen11](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paigen11/32/229055_2.png) [@paigen11](https://meta.discourse.org/u/paigen11)
#### Post date: [July 29, 2021, 6:23pm UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596/1 "2021-07-29T18:23:19Z")

</div>

Hello there,

I’m trying to see if there’s a way to reverse-engineer getting a complete list of topics and views for each of those topics via the Discourse API.

Ideally, something as simple as the landing page of a Discourse server with topic names and views in JSON format would be perfect, but from what I can tell from the API documentation there doesn’t seem to be an endpoint that can provide this high level overview.

Is there such a way to get this data in a nice format that I could pipe through to an analytics dashboard API?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [July 30, 2021, 4:22am UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596/2 "2021-07-30T04:22:31Z")

</div>

Would [Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) work? It’s possible to make SQL queries with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) and then [get the results with the API](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063).

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 30, 2021, 10:02am UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596/3 "2021-07-30T10:02:27Z")

</div>

> [@paigen11](#):
>
> Ideally, something as simple as the landing page of a Discourse server with topic names and views in JSON format would be perfect

Would [https://meta.discourse.org/latest.json](https://meta.discourse.org/latest.json) be good enough? That includes topic titles, and view count. Docs can be found [here](https://docs.discourse.org/#tag/Topics/paths/~1latest.json/get).

If you need more advanced filtering, then [data explorer](https://meta.discourse.org/t/32566?silent=true) is also a good choice as @j127 mentioned 👍

---

<div class="post-metadata">

### Author: ![paigen11](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paigen11/32/229055_2.png) [@paigen11](https://meta.discourse.org/u/paigen11)
#### Post date: [July 30, 2021, 1:14pm UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596/4 "2021-07-30T13:14:56Z")

</div>

Thank you both for the suggestions - I’ll start checking out both of them this morning to see what might work. I appreciate it!

---

<div class="post-metadata">

### Author: ![pHneutre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phneutre/32/326831_2.png) [@pHneutre](https://meta.discourse.org/u/pHneutre)
#### Post date: [December 4, 2024, 11:51am UTC](https://meta.discourse.org/t/get-total-list-of-topics-and-their-view-counts-from-discourse-api/198596/5 "2024-12-04T11:51:09Z")

</div>

Hello, it seems like the best solution (if not using [Data Explorer](https://meta.discourse.org/t/32566?silent=true)) is [https://meta.discourse.org/latest.json](https://meta.discourse.org/latest.json). However one must loop through all the [https://agora.les-cae.coop/latest.json?no\_definitions=true&page={id}](https://agora.les-cae.coop/latest.json?no_definitions=true&page=%7Bid%7D) until no further data is found.

By any chance, is there a way to get all the topics in a single request?
