Danbooru apps
Moekura answers Danbooru’s API too, so apps and tools made for Danbooru can use a Moekura site: point them at the site as if it were a Danbooru instance. Logged out, they see what visitors see. To log in, make an API key under Settings → API keys and feeds and give the app your name and the key (not your password).
gallery-dl
Put Danbooru: in front of a site URL:
gallery-dl "Danbooru:https://booru.example.com/posts?tags=cat"
gallery-dl -u yourname -p mka_… "Danbooru:https://booru.example.com/posts?tags=cat"
Or add the site once in gallery-dl’s configuration, and use its URLs as they are:
{
"extractor": {
"Danbooru": {
"mybooru": { "root": "https://booru.example.com" }
},
"mybooru": { "username": "yourname", "password": "mka_…" }
}
}
CI checks gallery-dl against every change.
The apps below aren’t tested automatically; if one trips over something, please open an issue.
Grabber
Add a source with the site’s address and choose Danbooru (2.0) as its type. In the source’s settings, enter your name and your API key under login.
Boorusama
Add a booru with the site’s address and choose Danbooru as its engine, then log in with your name and your API key.
What works
| Endpoint | Notes |
|---|---|
/posts.json, /posts/{id}.json, /posts/random.json, /counts/posts.json | search with the site’s syntax; page takes numbers, b<id> and a<id>; up to 200 per page; only= picks fields |
PUT /posts/{id}.json | post[tag_string] (with post[old_tag_string]), post[rating], post[source], post[parent_id] |
/post_versions.json | by search[post_id] |
/tags.json, /autocomplete.json, /related_tag.json | related tags are estimated from a search’s newest 200 posts; for a single tag, wiki_page_tags are the tags its wiki page links to |
/tag_aliases.json, /tag_implications.json | |
/tag_versions.json | by search[tag_id], search[name], search[updater_id] or search[updater_name] |
/wiki_pages.json, /wiki_pages/{title or id}.json | by search[title], search[other_names_match] (* wildcards; without one, the whole name) or search[other_names_include_any] |
/profile.json, /users.json, /users/{id}.json | levels follow roles: Member 20, Contributor 35, Janitor 37, Moderator 40, Admin 50; last_logged_in_at and is_banned only for yourself and staff who see moderation records (otherwise null and false) |
/favorites.json, /favorites/{post_id}.json, /posts/{id}/favorites.json | favorites of posts you can see, newest first, by search[user_id] (otherwise yours) or search[post_id] (up to 100 posts); logged out without search[user_id], numbered pages go as far as the newest 20,000 |
/posts/{id}/votes.json, /post_votes.json | only your own votes are listed |
/artists.json, /artists/{id}.json, /artist_urls.json, /artist_versions.json | read-only; artists by search[name], search[any_name_matches], search[url_matches] (any page of the artist’s), search[is_banned], search[is_deleted] or search[id], each with its urls; URLs by search[artist_id] or search[url_matches]; versions by search[artist_id], search[updater_id] or search[updater_name]; deleted artists and their versions only with Edit the wiki and artists or See deleted posts, as on the site |
/artist_commentaries.json, /artist_commentaries/{post_id}.json, /posts/{id}/artist_commentary.json, /artist_commentary_versions.json | a commentary’s id is its post’s; by search[post_id], search[text_matches], search[original_present] or search[translated_present]; PUT /artist_commentaries/create_or_update.json sets artist_commentary[post_id]’s texts (those left out stay) |
/media_assets.json, /media_assets/{id}.json, /media_metadata.json | a post’s file has the post’s id; files by search[id] or search[md5]; metadata by search[media_asset_id], as Group:Tag pairs like EXIF:Make |
/post_replacements.json | read-only, by search[post_id] or search[creator_id] |
/iqdb_queries.json | searching by image: GET with search[url] or search[post_id], or POST a file too; [{post_id, score, post}], score in percent |
/wiki_page_versions.json, /pool_versions.json | wiki versions by search[wiki_page_id], search[title], search[updater_id] or search[updater_name]; pool versions by search[pool_id] or the updater, with added_post_ids and removed_post_ids, up to 100 per page |
/dmails.json, /dmails/{id}.json | your messages, by search[folder] (received, sent or all) and search[is_read]; send with dmail[to_name] (or dmail[to_id]), dmail[title] and dmail[body] |
/forum_topics.json, /forum_topics/{id}.json, /forum_posts.json, /forum_posts/{id}.json, /forum_post_votes.json | topics by search[title_matches] (* wildcards), search[category_id] or search[id]; posts newest first by search[topic_id], search[creator_id], search[creator_name] or search[body_matches]; your own votes; post with forum_post[topic_id] and forum_post[body], or start a topic with forum_topic[title], forum_topic[category_id] (by default the first you may start topics in; Site news is for staff) and forum_topic[original_post_attributes][body] |
/explore/posts/popular.json, /explore/posts/viewed.json | the best-scored and most viewed posts of a date’s day, or with scale, week or month |
/explore/posts/searches.json, /explore/posts/missed_searches.json | [query, count] pairs: the searches that most often found posts, and those that most often found nothing, by date and scale like the posts |
/comments.json, /comments/{id}.json | listed newest first, by search[post_id], search[creator_id] or search[creator_name]; page takes b<id>, and numbers as far as the newest 20,000 comments; post with comment[post_id] and comment[body] (and captcha, a solved captcha’s token, from accounts new enough to be asked for one), and change or delete your own |
/comments/{id}/votes.json, /comment_votes.json | only your own votes are listed |
/pools.json, /pools/{id}.json | by search[name_matches], search[name_contains], search[id] (each pool once) or search[category]; post_ids lists the posts you can see; up to 100 per page |
/favorite_groups.json, /favorite_groups/{id}.json | by search[creator_id] or search[creator_name], otherwise yours; up to 100 per page |
/notes.json, /notes/{id}.json, /note_versions.json | notes by search[post_id] (one or more posts); versions by search[post_id] or search[note_id]; read-only |
POST /uploads.json, /uploads.json, /uploads/{id}.json | the first step of an upload: a file as upload[files][0], or a link as upload[source] (its first file); an upload media asset and its media asset share one id, the upload has its own. Your uploads are listed newest first |
POST /posts.json | the second step: upload_media_asset_id (or upload_id for the upload’s first file not posted) with post[tag_string], post[rating], post[source] and optionally post[parent_id]; upload limits apply. Files not made into posts within a day are removed |
/ai_tags.json | the tagger’s suggestions on posts you can see, newest posts first, by search[post_id] (or search[media_asset_id], the same number), search[tag_name], search[tag_id], search[is_posted] and search[score] (>=50, 50..90); score is 0 to 100; numbered pages go as far as the first 20,000 |
/user_feedbacks.json, /user_feedbacks/{id}.json | feedback on users, newest first, by search[user_id], search[user_name], search[creator_id], search[creator_name] and search[category] (positive, neutral or negative); read-only |
/user_name_change_requests.json, /user_name_change_requests/{id}.json | users’ name changes, newest first, by search[user_id], search[original_name] and search[desired_name]; they take effect at once, so there’s nothing to approve; inactive users’ changes only for staff who manage users |
/news_updates.json, /news_updates/{id}.json | site news, newest first; read-only |
/saved_searches.json | yours; add with saved_search[query] and saved_search[label_string], and delete |
What doesn’t
- Favorites and your votes on posts and comments have no ids of their
own: their
idis the post’s or comment’s. - Pools, favorite groups and notes are read-only here; change them on the site or with Moekura’s API.
- A page of pools, favorite groups or pool versions lists at most
100,000 post ids between them; a page that would list more is refused
with 400, so ask for a smaller
limit. - Responses are JSON only, not XML.