Topic: [Feature] Add before_id parameter to api (/posts.json)

Posted under Site Bug Reports & Feature Requests

Requested feature overview description.
The /posts.json API endpoint only allows tags, limit and page.
The proposed before_id parameter would allow having only the posts returned before the specified id.

Why would it be useful?
This has one huge advantage in comparison to using the id meta tag like id:<X for querying big lists, because it allows custom orders.

What part(s) of the site page(s) are affected?
https://e621.net/help/api#posts_list
https://e621.net/posts.json
https://e621.net/posts

Additional info:
There seams to be some sort of implementation of this already in the prev/next buttons on post pages.
Example: on https://e621.net/posts/2173421?q=fav%3Atilcreator the next button links to: https://e621.net/posts/2173421/show_seq?q=fav%3Atilcreator&seq=next

Updated

before_id forces a sorting order onto pages, this hasn't changed. The new site offers before_id differently, the page parameter is set to b<post_id> such as ?page=b1234 gives you all posts before post 1234. It also offers after_id support using a<post_id>

https://e621.net/posts?page=b1234

show_seq is unrelated but uses a similar method, and is meant for fetching single posts instead of lists of posts, it's primarily meant to be an internal endpoint, and isn't officially supported for API use.

Just found that feature myself, too.
It is just missing documentation. I will add it to the wiki page now.

  • 1