# Api get all topics

**URL:** <https://meta.discourse.org/t/api-get-all-topics/206543>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [October 20, 2021, 12:10pm UTC](https://meta.discourse.org/t/api-get-all-topics/206543 "2021-10-20T12:10:26Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

In the Development category under the topic "Api get all topics," user [Mohamed_Kbiri_Alaoui](/t/-/206543/1) inquires about retrieving all topics via the REST API, noting that the standard `/latest.json` endpoint only returns the most recent 30. [pfaffman](/t/-/206543/2) suggests utilizing pagination parameters, such as `?page=20`, to access older topics. However, [Mohamed_Kbiri_Alaoui](/t/-/206543/3) clarifies that they need to filter topics containing a specific custom field added by a plugin, asking if a more efficient method exists than standard pagination. In response, [merefield](/t/-/206543/4) recommends creating a custom method within the plugin itself. This approach would involve implementing a new Rails controller and serializer to directly serve the filtered selection of topics, rather than relying on the general API endpoints.

<div class="post-metadata">

**Author:** ![Mohamed\_Kbiri\_Alaoui](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohamed_kbiri_alaoui/32/226130_2.png) [@Mohamed\_Kbiri\_Alaoui](https://meta.discourse.org/u/Mohamed_Kbiri_Alaoui)\
**Post date:** [October 20, 2021, 12:10pm UTC](https://meta.discourse.org/t/api-get-all-topics/206543/1 "2021-10-20T12:10:26Z")

</div>

hi how can i get all topics from Api , i used [forum.com/latest.json](http://forum.com/latest.json) but still get just latest 30 topics

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [October 20, 2021, 4:05pm UTC](https://meta.discourse.org/t/api-get-all-topics/206543/2 "2021-10-20T16:05:20Z")

</div>

Try something like [https://meta.discourse.org/latest.json?page=20](https://meta.discourse.org/latest.json?page=20)

---

<div class="post-metadata">

**Author:** ![Mohamed\_Kbiri\_Alaoui](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohamed_kbiri_alaoui/32/226130_2.png) [@Mohamed\_Kbiri\_Alaoui](https://meta.discourse.org/u/Mohamed_Kbiri_Alaoui)\
**Post date:** [October 21, 2021, 9:17am UTC](https://meta.discourse.org/t/api-get-all-topics/206543/3 "2021-10-21T09:17:26Z")

</div>

thanks for your reply .  
i have a plugin who add custom field to a topic . i want to get all topics with that custom field , is there a methode better than [[https://meta.discourse.org/latest.json](https://meta.discourse.org/latest.json)]([https://meta.discourse.org/latest.json](https://meta.discourse.org/latest.json) ?page=20)?

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [October 21, 2021, 9:32am UTC](https://meta.discourse.org/t/api-get-all-topics/206543/4 "2021-10-21T09:32:11Z")

</div>

Write a new method in your plugin (you’ll need a Rails controller and serializer) to serialize the filtered selection of topics.
