Danbooru

Post API and Notes

Posted under General

Hello,

I currently use the API to notify me about new posts for certain tags once every hour, and to create PNGs which have notes overlayed over the original image when I request my program to do so.

Would it be possible to have /post/index.xml include whether a given post has notes associated to it or not? Maybe even the same for comments, if at all possible?

Workarounds are ugly: I'd either have to poll notes (or comments) for each post to check whether there are any, or (what I am doing now), check if they have a tag. Currently I'm deciding whether there are notes to fetch or not by checking if the tags include "translated" and not "hard_translated" but that excludes quite a few posts with notes and also messes up when hard-translated posts aren't tagged as such. :/

I don't like polling since it wastes bandwidth, causes CPU load (at Danbooru -- DB lookups aren't cheap), and slows the entire procedure down.

Or maybe I'm not thinking far enough and could do something else? If so, any pointers in the right direction? :)

Updated by albert

If I'm not mistaken the API calls are cached. Be it SQL caching or some other static file cache, I do not know. If you call the API once an hour, you are likely producing minimal load for the servers.

1