How to get all topics from a specific category using offset/page param in the API query?

I have found an API which can list all the topics from a specific subject (whose slug is “mlt-kb”) from between a certain date range. Here is the endpoint:

https://{default_host}/search.json?q=%23courses%3Amlt-kb%20after%3A2024-09-24%20before%3A2024-12-29

But this URL doesn’t list all topics. It only lists the first 50 topics. There must be some other parameter like offset or page…but I cannot understand how to add them to this URL. Can someone figure this out?

Thanks in advance!

As always: If this is possible using UI, try Reverse engineer the Discourse API

2 Likes

You can use this - https://docs.discourse.org/#tag/Search/operation/search (scroll down!)

You’ll see that besides ?q, we also have ?page, so…

https://{default_host}/search.json?q=%23courses%3Amlt-kb%20after%3A2024-09-24%20before%3A2024-12-29&page=1

2 Likes

If you want them all at once you could Run Data Explorer queries with the Discourse API

1 Like

There’s a script example that loops page results here:

But as Jay said, depending on your goal, using data explorer might be a way better solution if you’re admin.