api:artists
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Index
- 04. Show
- 05. Create
- 06. Update
- 07. Delete
- 08. Revert
- 09. Ban
- 10. Unban
- 11. See also
- 12. External links
This page has details for how to interact with artist records through the API.
Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
name | string | tag format |
group_name | string | |
other_names | array | strings |
is_banned | boolean | |
is_deleted | boolean | |
created_at | timestamp | |
updated_at | timestamp |
Associated attributes
The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):
| Name | Type | Number | Availability | Details |
|---|---|---|---|---|
members | artist | multiple | optional | |
urls | artist url | multiple | optional | |
wiki_page | wiki page | single | optional | |
tag_alias | tag alias | single | optional | |
tag | tag | single | optional |
Index
Returns multiple artist records.
| HTTP Method | GET |
| Base URL | /artists.json |
| Type | read request |
| Description | The default order is ID descending. |
Search attributes
Search parameters take the following format (see Help:Common URL parameters for more info):
search[FIELD]=VALUE
The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.
- Number syntax
idcreated_atupdated_at- Text syntax
namegroup_name- Boolean syntax
is_deletedis_banned- Array syntax
other_names- Chaining syntax
urlswiki_pagetag_aliastag
Special search parameters
The following are additional search fields.
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 there 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.
Search order
Using the search parameter order with one of the following values changes the order of the results.
name- Name descending.updated_at- Updated at descending.post_count- Post count descending.custom- Help:Common URL parameters- In order to use this order,
search[id]must also be set with a list of comma-separated IDs.
Show
Returns a single artist record.
| HTTP Method | GET |
| Base URL | /artists/$id.json |
| Type | read request |
| Description | $id is the artist ID. |
Create
Creates a single artist record.
| HTTP Method | POST |
| Base URL | /artists.json |
| Type | write request |
Create parameters
Artist parameters take the following format (see Help:API Write Requests for more info):
artist[FIELD]=VALUE
- Required:
name- The artist tag name.- Must be tag format (API:tags).
- 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.
Update
Updates a single artist record.
| HTTP Method | PUT/PATCH |
| Base URL | /artists/$id.json |
| Type | write request |
| Description | $id is the artist ID. |
Update parameters
Accepts the same parameters as the Create action. All parameters are optional.
Delete
Deletes a single artist record.
| HTTP Method | DELETE |
| Base URL | /artists/$id.json |
| Type | write request |
| Description | $id is the artist ID. |
Note: The action can be accomplished using the Update action by setting is_deleted to true.
Revert
Reverts a single artist record to a prior version.
| HTTP Method | PUT |
| Base URL | /artists/$id/revert.json |
| Type | write request |
| Description | $id is the artist ID. |
Revert parameters
- Required:
- version_id - The artist version ID to revert to.
Note: The version ID may be passed along as a URL parameter instead of in the body.
Ban
Bans a single artist record.
| HTTP Method | PUT |
| Base URL | /artists/$id/ban.json |
| Type | write request |
| Description | $id is the artist ID.Restricted to Admins only (Help:Users) |
Unban
Unbans a single artist record.
| HTTP Method | PUT |
| Base URL | /artists/$id/unban.json |
| Type | write request |
| Description | $id is the artist ID.Restricted to Admins only (Help:Users) |
