Paginated collections: an example

We’ve had a few questions about how to navigate responses from our API that contain paginated collections.  You can find information about this in our documentation, but here’s an example that we hope will make things a bit clearer.

If you make an initial request to:

https://api.mendeley.com/search/catalog?query=mapreduce

then the response includes the following HTTP headers:

Link: < https://api.mendeley.com/search/catalog?limit=10&reverse=false&order=asc&marker=00000000-0000-000a-0000-000000000000&query=mapreduce‌ ‌>; rel="next"
Mendeley-Count: 1627

You can see the total number of results (1627) here. If you want to see the next page, then follow the “next” link, to:

https://api.mendeley.com/search/catalog?limit=10&reverse=false&order=asc&marker=00000000-0000-000a-0000-000000000000&query=mapreduce

The response to this request includes the following HTTP headers:

Link: < https://api.mendeley.com/search/catalog?limit=10&reverse=false&order=asc&marker=00000000-0000-0014-0000-000000000000&query=mapreduce >; rel="next"
Link: < https://api.mendeley.com/search/catalog?limit=10&reverse=false&order=asc&query=mapreduce >; rel="first"

Again, you can follow the “next” link to get the next page, and so on. If there is no “next” link, then you’re on the last page.

Note that there’s a bug in our interactive console, meaning that Link headers are not displayed correctly.  We’re looking into what we can do to improve this.

As ever, we’re here to answer your questions, so let us know if there’s anything else you need help with.

This entry was posted in Uncategorized on by .

About Matt Thomson

Matt Thomson is one of the developers of the Mendeley API. After graduating with an MMath from the University of Cambridge, he moved to London to join a telecommunications software provider, before joining the platform team at Mendeley. Matt's a big fan of live comedy, and performed improvised comedy for a number of years, most notably at the Edinburgh Fringe with London's Fat Kitten Improv. He also enjoys exploring London's green spaces and pubs, and is a long-suffering follower of Scunthorpe United.