Topic: How do you use the API to get the file for a post with a specific ID?

Posted under e621 Tools and Applications

If I have the ID of a specific post, what URL do I use in order to get the response for the file and all of the associated data? I've been looking on the "Help: Posts" page, but I cannot find a way of doing it

You'd be better off checking the API help than any other help page, though even this is incomplete and out of date.

The endpoint you're looking for is https://e621.net/posts/<id>.json, e.g. https://e621.net/posts/6268.json

For the majority of endpoints you can just add .json to the end of the regular URL.

https://docs.e621.ws/ is another good resource. The endpoint faucet mentions will get you the json of the post info, and there is a field inside of that for the image file.

alphamule

Privileged

And if you want to go full-bore, you can also just use the database export. I archive it occasionally to Wayback Machine, if you want to compare changes over time. I wonder how much smaller a differential/incremental backup would be. By definition, 99% of that database doesn't change day-to-day.

AFAIK, this is the preferred way if doing something like indexing untagged local collections. There's probably some guide out there from people who've already done it. i.e. Hydrus Network.

  • 1