# 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:** 1

<div class="post-metadata">

作者： ![danielt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielt/32/121163_2.png) [@danielt](https://meta.discourse.org/u/danielt)\
发布日期： [2017 年3 月 20 日 17:01 UTC](https://meta.discourse.org/t/struggling-with-pagination-within-search-query-json/59558/1 "2017-03-20T17:01:03Z")

</div>

I’m trying to grab the posts within a date interval from our discourse server using the API. I’m struggling quite a lot with pagination.

Firstly I tried using search.json but that limits us to 50 results:  
[https://meta.discourse.org/search.json?q=after:2016-01-01%20before:2017-01-01](https://meta.discourse.org/search.json?q=after:2016-01-01%20before:2017-01-01)

I tried to use the paginated query instead (but page 2 and page 3 end up the same for some queries):  
[https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01](https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01)  
[https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01?page=2](https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01?page=2)  
[https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01?page=3](https://meta.discourse.org/search/query.json?term=after:2016-01-01%20before:2017-01-01?page=3)

That’s odd because simpler queries appear to paginate correctly:  
[https://meta.discourse.org/search/query.json?term=API](https://meta.discourse.org/search/query.json?term=API)  
[https://meta.discourse.org/search/query.json?term=API?page=2](https://meta.discourse.org/search/query.json?term=API?page=2)  
[https://meta.discourse.org/search/query.json?term=API?page=3](https://meta.discourse.org/search/query.json?term=API?page=3)  
[https://meta.discourse.org/search/query.json?term=API?page=51](https://meta.discourse.org/search/query.json?term=API?page=51) (more\_pages becomes null here, although we can fetch higher pages)

Is is possible to combine advanced search and pagination?

---

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