I'm trying to figure out the best way of fetching the number of favourites a user has for a project I'm working on. Unfortunately https://e621.net/users/299528.json does not show fav count.
Will I just have to scrape the user page directly?
Posted under General
I'm trying to figure out the best way of fetching the number of favourites a user has for a project I'm working on. Unfortunately https://e621.net/users/299528.json does not show fav count.
Will I just have to scrape the user page directly?
cdxxblazeit said:
I'm trying to figure out the best way of fetching the number of favourites a user has for a project I'm working on. Unfortunately https://e621.net/users/299528.json does not show fav count.Will I just have to scrape the user page directly?
Open https://e621.net/users/299528.json in the browser and look through it.
At the bottom of the output, you should see this: https://i.imgur.com/zgZX2It.png
The request simply needs to be authorized in order for you to see the number of favorites you have.
If you are making an external app that interfaces with e621's API (as opposed to a userscript or an extension), the only way to do so would be to log in with the API key.
Take a look at the help page, under "Logging In".
bitwolfy said:
Open https://e621.net/users/299528.json in the browser and look through it.
At the bottom of the output, you should see this: https://i.imgur.com/zgZX2It.pngThe request simply needs to be authorized in order for you to see the number of favorites you have.
If you are making an external app that interfaces with e621's API (as opposed to a userscript or an extension), the only way to do so would be to log in with the API key.Take a look at the help page, under "Logging In".
Ah I see it now.
Is there a way to see *other* user's favourite count when using an API key or can I only see my own?
cdxxblazeit said:
Ah I see it now.Is there a way to see *other* user's favourite count when using an API key or can I only see my own?
For some reason, that information is not available through the API.
My theory is that it has something to do with "privacy mode" - being able to hide your favorites from other users. Instead of hiding the favorites count for users with that mode on, the API just omits it altogether.
Try https://e621.net/favorites.json?user_id=%userID% and user id can be found in https://e621.net/users/%username%.json
graiden said:
Try https://e621.net/favorites.json?user_id=%userID% and user id can be found in https://e621.net/users/%username%.json
That is a terrible way to get the number of favorites.
You would have to iterate over every page of the results until you run out of posts. Since you are limited to sending 2 API requests per second, fetching your favorites count this way, for example, would take almost a minute.
graiden said:
Try https://e621.net/favorites.json?user_id=%userID% and user id can be found in https://e621.net/users/%username%.json
That's way more effort that it's worth, I can just scrape the HTML from a user's profile page directly.
Good to know about privacy mode though.