Danbooru

Fetching default and extended metadata with API

Posted under Bugs & Features

When paginating over tag search results via https://danbooru.donmai.us/posts.json?tags=TAGS,
which only returns the default set of metadata fields for each post,
what would be the optimal / recommended way of fetching extended metadata that can be gotten with https://danbooru.donmai.us/posts.json?only=... ?

Repeat the initial API request a second time including the only query parameter, i.e. https://danbooru.donmai.us/posts.json?tags=TAGS&only=... ?
And if so, how can I guarantee that both results can be easily merged, i.e. first post in list 1 corresponds to first post in list 2 etc?

Is there a way of getting default and extended metadata in only one API request, e.g something like https://danbooru.donmai.us/posts.json?tags=TAGS&only=default,... ?

If you want it in one request you'll have to send every post field in the only parameter. e.g. ?only=id,md5,tag_string,...,media_asset. I believe there's an open issue on GitHub to simply it but it has yet to be implemented.

1