Topic: [Feature] Allow viewing own private sets from api, add apis for votes and favorites post ids

Posted under Site Bug Reports & Feature Requests

Hi,
For doing some querying against database export (e.g. to produce some personal stats) it would be useful to get this from the API:

Post ids in my own private sets
This would require changing /post_sets/{id}.json API to allow viewing the private set if creator_id matches the user that is making the request, instead of only checking for Moderator+

Vote ids API
New api, similar to post_sets, only supplies ids from post_votes table for user_id that is making the request, does not look up post information.

Favorite ids API
New api, similar to post_sets, only supplies ids from favorites table, does not look up post information. This can either work similarly to the vote ids api or be public (since favorites are public)

Currently, for both set and vote information I would need to perform a posts search and fetch each page, including post information (which is then dropped, because I have a db export and only care about id).
For favorites there is a standalone favorites api, but it has the same problem, where it looks up paginated post information.

With these, it would be possible to make a single request for each.

Thanks!

Updated

Donovan DMC

Former Staff

tldr126 said:
Post ids in my own private sets
This would require changing /post_sets/{id}.json API to allow viewing the private set if creator_id matches the user that is making the request, instead of only checking for Moderator+

This is already possible? Set owners can view their own private sets just fine

The other two feel unlikely to go anywhere due to how niche their uses would be

Updated

For the first one, I've been playing around in the openapi docs, using the api key with authorize option there, getting a 403. I'll try it from code and see if it works.

For the other 2, I'll keep using the existing api then.

Donovan DMC

Former Staff

tldr126 said:
For the first one, I've been playing around in the openapi docs, using the api key with authorize option there, getting a 403.

The try it out thing there is unreliable due to CORS, I'm going to just disable it entirely at this point
To make them work reliably I'd need to proxy requests, which is risky on my end
The easiest solution, Cloudflare Workers, is completely blocked by e621 so I can't use that
I'd have to go through my own server, and I really don't want to do that

I was able to get a response when calling the sets api from a local script. Thanks again for replying.

alphamule

Privileged

I wonder about exports for a specific user's account. Like say, if I wanted to download my favorites list without using JSON queries.
TBF, I only have to do one request to get my list, since I only have 174 favorites.
You can just add ?page=*number* to the end, to get more pages.

  • 1