Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some APIs expose the key offset mechanism. For example, in most OpenStack APIs, instead of ?page=2, you say ?marker=12345, where 12345 is the ID of the last object on the previous page. The end of the pagination is signalled by an empty response.


HN uses this technique for each user's comment list ("threads" link in the header). The "next" link at the bottom of each page is

    /threads?id=${USER_NAME}&next=${NEXT_COMMENT_ID}




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: