api:tags
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Index
- 04. Show
- 05. Update
- 06. See also
- 07. External links
This page has details for how to interact with tag records through the API.
01 Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
name | string | |
category | integer | includes [0,1,3,4,5] |
post_count | integer | >=0 |
is_deprecated | boolean | |
created_at | timestamp | |
updated_at | timestamp |
Category
| Value | Description |
|---|---|
| 0 | General |
| 1 | Artist |
| 3 | Copyright |
| 4 | Character |
| 5 | Meta |
02 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 |
|---|---|---|---|---|
wiki_page | wiki page | single | optional | Wiki page whose title matches the tag name. |
artist | artist | single | optional | Artist whose name matches the tag name. |
antecedent_alias | tag alias | single | optional | Alias where the tag is the antecedent. |
consequent_aliases | tag alias | multiple | optional | Aliases where the tag is the consequent. |
antecedent_implications | tag implication | multiple | optional | Implications where the tag is the antecedent. |
consequent_implications | tag implication | multiple | optional | Implications where the tag is the consequent. |
dtext_links | dtext link | multiple | optional | Dtext links to the page whose title matches the tag name. |
03 Index
Returns multiple tag records.
| HTTP Method | GET |
| Base URL | /tags.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
idcategorypost_countcreated_atupdated_at- Text syntax
name- Boolean syntax
is_deprecated- Chaining syntax
wiki_pageartistantecedent_aliasconsequent_aliasesantecedent_implicationsconsequent_implicationsconsequent_implicationsdtext_links
Special search parameters
The following are additional search fields.
fuzzy_name_matches- Shows tags with names that are within a certain percentage of similarity.name_matches- Normalized wildcard search on the name field.name_normalize- Normalized wildcard search on the name field that supports multiple tags split by a comma ",".name_or_alias_matches- Normalized wildcard search on the name field that also checks for aliases where the search term is the antecedent.hide_empty- Shows tags with a post count of 0 (true) or all tags (false) (Help:Boolean syntax).is_empty- Shows tags with a post count of 0 (true) or a post count greater than 0 (false) (Help:Boolean syntax).
Search order
Using the search parameter order with one of the following values changes the order of the results.
name- Name ascending.date- ID descending.count- Post count descending.similarity- Orders by similarity to the search term, then by post count descending, then tag name ascending.- Only when the
fuzzy_name_matchesparameter is used. custom- Help:Common URL parameters- In order to use this order,
search[id]must also be set with a list of comma-separated IDs.
04 Show
Returns a single tag record.
| HTTP Method | GET |
| Base URL | /tags/$id.json |
| Type | read request |
| Description | $id is the tag ID. |
05 Update
Updates a single tag record.
| HTTP Method | PUT/PATCH |
| Base URL | /tags/$id.json |
| Type | write request |
| Description | $id is the tag ID. |
Update parameters
Tag parameters take the following format (see Help:API Write Requests for more info):
tag[FIELD]=VALUE
- Optional:
is_deprecated- can only be set to
falseby admins - can only be set to
trueif the tag has a wiki page, and either its post count is zero or the user is an admin categoryRestricted by user level- Member+: < 50 posts
- Builder+: < 1000 posts
- Admin+: No limit
