Topic: Need help with the E621 API

Posted under e621 Tools and Applications

hexen said:
Have you tried using user's numeric ID?

I haven't. Is there a way to get that via the api or does the user have to find and input it themselves?

echoes said:
I haven't. Is there a way to get that via the api or does the user have to find and input it themselves?

Sorry, I don't know much about all that programming stuff but https://e621.net/users.json?name=Echoes does seem to redirect to user page, albeit it doesn't give json response. Hopefully someone more qualified can answer soon.

favorites.json is not the correct way to obtain this. You should do a post search for fav:username and use before/after id pagination.

kiranoot said:
favorites.json is not the correct way to obtain this. You should do a post search for fav:username and use before/after id pagination.

I'm sorry, but what's the difference between the two? Additionally, if a post search for fav:username is the correct method, why does the GET favorites.json method exist?

bitWolfy

Former Staff

echoes said:
I'm sorry, but what's the difference between the two? Additionally, if a post search for fav:username is the correct method, why does the GET favorites.json method exist?

Both methods work.
The favorites.json endpoint provides posts in the order in which they were added to the favorites, but it only works with a numeric user ID, and does not provide additional options to narrow down the search.
Using fav:username method shows posts in the order they were uploaded to the site (by default), but you can use other tags and metatags in the search.

Basically, you would only be using the favorites.json endpoint if you really need to get the posts in order in which they were favorited.

hexen said:
Sorry, I don't know much about all that programming stuff but https://e621.net/users.json?name=Echoes does seem to redirect to user page, albeit it doesn't give json response. Hopefully someone more qualified can answer soon.

You can just use this: https://e621.net/users/Echoes.json

bitwolfy said:
Both methods work.
The favorites.json endpoint provides posts in the order in which they were added to the favorites, but it only works with a numeric user ID, and does not provide additional options to narrow down the search.
Using fav:username method shows posts in the order they were uploaded to the site (by default), but you can use other tags and metatags in the search.

Basically, you would only be using the favorites.json endpoint if you really need to get the posts in order in which they were favorited.

You can just use this: https://e621.net/users/Echoes.json

Good to know. Thanks for the help!

  • 1