# Struggling with pagination within search/query.json

**URL:** <https://meta.discourse.org/t/struggling-with-pagination-within-search-query-json/59558>\
**Category:** Product Support\
**Created:** [2017 年3 月 20 日 17:01 UTC](https://meta.discourse.org/t/struggling-with-pagination-within-search-query-json/59558 "2017-03-20T17:01:03Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

作者： ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
发布日期： [2020 年8 月 3 日 17:03 UTC](https://meta.discourse.org/t/struggling-with-pagination-within-search-query-json/59558/10 "2020-08-03T17:03:53Z")

</div>

没有单个 API 调用可以获取类别中的所有主题。您需要发起多次 API 调用。这是因为一个类别可能包含超过 100 万个主题，这样的查询量巨大，可能会影响您站点的性能。通过逆向工程滚动机制，您可以观察 Discourse UI 如何发起 API 调用来加载更多主题，并在您的 API 中复现该行为。

根据您的具体目标，您还可以使用数据探索查询来获取某个类别中的主题数量，并针对该已保存的查询发起 API 调用。

---

_[View the full topic](https://meta.discourse.org/t/struggling-with-pagination-within-search-query-json/59558)._
