forum

Faster Cursor Pagination for Descending Beatmap Search?

posted
Total Posts
1
Topic Starter
Ryclic
I'm currently using the API through the "ossapi" Python wrapper to search for the most played beatmapsets. As of now, I'm going through the results by setting the cursor returned by the API of the previous call to the cursor of my next call, but this is quite slow. Is there any other way I could directly jump to a page when searching?

I'm aware that some of the endpoints allow the cursor to be directly set to a page, as documented here: docs/index.html#cursor and in the pagination section here: https://pypi.org/project/ossapi/2.4.0/.

However, if I search for most played maps with this line of code:
maps = api.search_beatmapsets(sort="plays_desc", category="any", mode=-1)
The result is a cursor that has these fields, where the ID is the last item on the page and play count is the playcount of that beatmapset.
{"play_count":16597310,"id":451316}

This makes it hard to directly jump to a page. The main issue is that repeatedly calling the API to get subsequent pages is slow, but I'm not sure that there's any better way to do it.

Any help is appreciated, thanks!
Please sign in to reply.

New reply