api:artists
The following includes the details of how to interface with the artist records through the API.
Record field format
- id: integer, > 0
- name: string, tag format
- group_name: string
- other_names: array of strings
- is_banned: boolean
- is_deleted: boolean
- created_at: timestamp
- updated_at: timestamp
Associated attributes
- members - List of artists with same group name.
- urls - List of URLs belonging to artist.
- wiki_page - Wiki page if it exists.
- tag_alias - Tag alias if it exists.
- tag - Tag if it exists.
Endpoints
Endpoint refers to the path after the name of the hostname "danbooru.me".
Listing
The base URL is GET /artists.json.
Search parameter format
All search parameters use URL hash format where "search" is the base object.
Example: search[PARAMETER]
Search attributes
All of the following are standard attributes with all of their available formats and qualifiers.
- Number syntax
id
created_at
updated_at
- Text syntax
name
group_name
- Boolean syntax
is_deleted
is_banned
- Array syntax
other_names
Special search parameters
-
any_other_name_like
- Search for artists that have an other name matching this value. Supports wildcards. -
any_name_matches
- Search for artists that have a matching name, group name, or other name. Supports wildcards and regexes. -
url_matches
- Search for artists with a matching URL. - Does a regex match when the query starts and ends with a forward slash "/".
- Regexes must follow the Ruby's format.
- Does a wildcard match when their are asterisks "*" present.
- Uses the artist URL finder when the value is prefaced by
http://
orhttps://
- This does a recursive search on URLs stripping the pathname one level at a time to search for matches.
- It will keep searching until it finds an exact match or 10 similar entries.
- Otherwise it does a wildcard search with wildcard placed at the start and end.
-
any_name_or_url_matches
- Searches for the artist by name or URL. - Does a URL search if the value is prefaced by
http://
orhttps://
- Does a name search otherwise.
-
has_tag
- Search for artists with or without a tag (boolean syntax). -
order
- Sets the order of the results. name
updated_at
post_count
- The default order is ID descending.
Show
The base URL is GET /artists/$id.json where $id is the artist ID.
Create
The base URL is POST /artists.json.
Create parameter format
All create parameters use URL hash format where "artist" is the base object.
Example: post[PARAMETER]
Create parameters
- Required:
-
name
- The artist tag name. - Must be tag format.
- Optional
-
group_name
- The name of the group this artist belongs to. -
other_names
- List of alternative names for this artist. - Space delimited. Replace spaces within names with underscores.
-
url_string
- List of URLs associated with this artist - Whitespace or newline delimited.
-
is_deleted
- Set the artist entry as deleted or not. -
wiki_page_attributes[body]
- DText that will be used to create a wiki entry at the same time. - Is a hash value, so the final parameter format is
artist[wiki_page_attributes][body]
Update
The base URL is PUT /artists/$id.json where $id is the artist ID.
Update parameters
Accepts the same parameters as the create artist action. All parameters are optional.
Delete
The base URL is DELETE /artists/$id.json where $id is the artist ID.
Note: The action can be accomplished using the update artist action by setting is_deleted
to true.
Undelete
The base URL is POST /artists/$id/undelete.json where $id is the artist ID.
Note: The action can be accomplished using the update artist action by setting is_deleted
to false.
Banned
The base URL is GET /artists/banned.json. This is a shortcut for an artist listing search with search[is_banned]=true
.
Revert
The base URL is PUT /artists/$id/revert.json where $id is the artist ID.
- Required:
- version_id - The artist version ID to revert to.