Username bugfix About 250 accounts had to have their username automatically changed. Read more

API Documentation

Last updated

Revision history

This page describes the JSON API of art.mobius.social. This page is in the public domain and may be reproduced freely.

1. Rules for use

Read these rules before you use the API. They apply to people, scripts and AI agents.

1.1 Rate limits

1.2 Errors and back-off

1.3 User-Agent

1.4 Heavy use

1.5 Maintenance window

1.6 Automated actions

When using scripts, AI, or other automation:

2. General information

2.1 Base URL

All JSON endpoints are under https://art.mobius.social/api/v1/json/.
All endpoints return JSON. Times are in UTC, in ISO 8601 format.

2.2 Authentication

Most read endpoints do not need an account.
To act as a user, add the user’s API key to the request: ?key=YOUR_KEY. The user can find the key in their account settings.
With a valid key:

2.3 Filters

Image results are filtered.
Filters apply to image search, the featured image and comment search. Comment search only uses the hidden tags of the filter. It does not use the complex filter.

2.4 Paging

List endpoints accept these parameters:
Parameter Meaning
page Page number. Starts at 1. Default 1.
per_page Results per page. Minimum 1. Maximum 50.
Default page size:
Forum topic post lists always have 25 posts per page. They ignore per_page.
Each list response has a total field. This is the total number of results on all pages.

2.5 Search syntax

The q parameter takes a search query. The syntax is on the search syntax page.

2.6 Status codes

Code Meaning
200 Success.
400 Bad request. For searches, the query is not valid. The body is {"error": "message"}. For uploads, see section 4.2.
401 A key is necessary, and it is missing or not valid.
403 You are not allowed to see this item, or you are banned.
404 The item does not exist or is hidden. The body is usually empty.
429 Too many requests. Slow down. See section 1.2.
5xx Server error. Wait and retry slowly. See section 1.2.

3. Read endpoints

3.1 Search images

GET /api/v1/json/search/images
GET /api/v1/json/search
The two URLs are the same endpoint.
Parameter Meaning
q Search query. Required.
sf Sort field. See below. Default: first_seen_at.
sd Sort direction: asc or desc. Default: desc.
filter_id Filter to use. See section 2.3.
hidden 1 to include images that you hid. Needs a key.
page, per_page See section 2.4.
Sort fields for sf:
Response:
{
  "images": [ image, ... ],
  "interactions": [ interaction, ... ],
  "total": number
}
Images that are not yet approved are never shown.

3.2 Get one image

GET /api/v1/json/images/ID
Response:
{
  "image": image,
  "interactions": [ interaction, ... ]
}
This endpoint also returns deleted images. A deleted image has only a few fields. See section 5.1.

3.3 Get the featured image

GET /api/v1/json/images/featured
Returns the image that was featured most recently. The response is the same as section 3.2. Returns 404 if there is no featured image.

3.4 Search tags

GET /api/v1/json/search/tags
Parameters: q, page, per_page. Results are sorted by image count, highest first.
{ "tags": [ tag, ... ], "total": number }

3.5 Get one tag

GET /api/v1/json/tags/SLUG
Use the tag slug, not the tag name. The slug is in the slug field of a tag, and in the URL of the tag page.
{ "tag": tag }

3.6 Search comments

GET /api/v1/json/search/comments
Parameters: q, filter_id, page, per_page. Results are sorted by date, newest first. Comments on images that your filter hides are not shown.
{ "comments": [ comment, ... ], "total": number }

3.7 Get one comment

GET /api/v1/json/comments/ID
{ "comment": comment }
Returns 403 if the image of the comment is deleted.

3.8 Search forum posts

GET /api/v1/json/search/posts
Parameters: q, page, per_page. Results are sorted by date, newest first. Only posts in public forums are shown.
{ "posts": [ post, ... ], "total": number }

3.9 Get one forum post

GET /api/v1/json/posts/ID
{ "post": post }

3.10 Search galleries

GET /api/v1/json/search/galleries
Parameters: q, page, per_page. Results are sorted by creation date, newest first.
{ "galleries": [ gallery, ... ], "total": number }
To get the images in a gallery, use image search: q=gallery_id:ID&sf=gallery_id:ID&sd=desc

3.11 Search filters

GET /api/v1/json/search/filters
Parameters: q, page, per_page. Results are sorted by name. The results include public filters and system filters. With a key, they also include the user’s own filters.
{ "filters": [ filter, ... ], "total": number }

3.12 Get one filter

GET /api/v1/json/filters/ID
{ "filter": filter }
Returns 404 if the filter does not exist, or if you cannot see it.

3.13 List system filters

GET /api/v1/json/filters/system
Parameters: page, per_page. The response is the same as section 3.11.

3.14 List your own filters

GET /api/v1/json/filters/user
Needs a key. Without a key, returns 403. Parameters: page, per_page. The response is the same as section 3.11.

3.15 Get a user profile

GET /api/v1/json/profiles/USER_ID
Use the numeric user ID.
{ "user": profile }

3.16 Forums

List forums:
GET /api/v1/json/forums

{ "forums": [ forum, ... ], "total": number }
Get one forum:
GET /api/v1/json/forums/SHORT_NAME

{ "forum": forum }
Only public forums are shown.

3.17 Forum topics

List the topics in a forum:
GET /api/v1/json/forums/SHORT_NAME/topics

{ "topics": [ topic, ... ], "total": number }
Sticky topics come first. Then topics are sorted by last reply, newest first.
Get one topic:
GET /api/v1/json/forums/SHORT_NAME/topics/TOPIC_SLUG

{ "topic": topic }

3.18 Posts in a topic

List the posts in a topic:
GET /api/v1/json/forums/SHORT_NAME/topics/TOPIC_SLUG/posts

{ "posts": [ post, ... ], "total": number }
Parameter: page. Each page has 25 posts, oldest first. per_page is ignored. total is the number of posts in the topic.
Get one post in a topic:
GET /api/v1/json/forums/SHORT_NAME/topics/TOPIC_SLUG/posts/ID

{ "post": post }

3.19 oEmbed

GET /api/v1/json/oembed?url=URL
The URL can be an image page URL or an image file URL. Returns oEmbed data. See section 5.10.
If the image is not found, returns 404 with:
{ "error": "Couldn't find an image" }

3.20 RSS feed of watched tags

GET /api/v1/rss/watched?key=YOUR_KEY
Needs a key. Returns an RSS 2.0 feed, not JSON. The feed contains the newest images that have the user’s watched tags.

4. Write endpoints

4.1 Reverse image search

POST /api/v1/json/search/reverse
Finds images that look like the image you send.
Send the image in one of two ways:
Parameter Meaning
distance How similar the images must be. 0 to 1. Smaller is more similar. Default 0.25.
limit Maximum number of results. 1 to 50. Default 10.
Allowed file types: GIF, JPEG, PNG, SVG, WebM.
The response is the same as image search (section 3.1). If the file or a parameter is not valid, the response has no images and "total": 0.
A key is not necessary. This endpoint does not change site data. The rate limits in section 1.1 still apply.

4.2 Upload an image

POST /api/v1/json/images?key=YOUR_KEY
Automated tools, including AI agents, must not use this endpoint. A person must review and submit each upload. See section 1.6.
Needs a key. Without a key, returns 401. If the user is banned, returns 403.
Send the image in one of two ways:
Field Meaning
image[tag_input] Tags, separated by commas. Required.
image[sources][0][source] Source URL. Use [1], [2] and so on for more sources. Maximum 15.
image[description] Description. Maximum 50000 bytes.
image[anonymous] true to upload anonymously.
Tag rules:
File rules:
Success response:
{ "image": image, "interactions": [] }
Error response (HTTP 400):
{ "errors": { "field": [ "message", ... ] } }
New images are processed after upload. Thumbnails can take some time. Some images need approval by staff before they appear in searches.

5. Objects

A field can be null if the value is not known or not set.

5.1 Image

Field Meaning
id Number. Image ID.
created_at Time. When the image was uploaded.
updated_at Time. When the image was last changed.
first_seen_at Time. When the image was first seen.
width, height Numbers. Size in pixels.
mime_type Text. For example image/png.
format Text. File extension, for example png.
size Number. File size in bytes, after processing.
orig_size Number. File size in bytes, as uploaded.
sha512_hash Text. Hash of the processed file.
orig_sha512_hash Text. Hash of the file as uploaded.
duration Number. Length in seconds, for animations.
animated True or false.
aspect_ratio Number. Width divided by height.
name Text. File name as uploaded.
tags List of tag names.
tag_ids List of tag IDs.
tag_count Number of tags.
uploader Text. Uploader name. Null if anonymous.
uploader_id Number. Uploader ID. Null if anonymous.
description Text. Markdown.
source_url Text. The first source URL, or an empty string.
source_urls List of source URLs.
score Number. Upvotes minus downvotes.
upvotes, downvotes Numbers.
faves Number.
wilson_score Number. A ranking score from the votes.
comment_count Number.
intensities Object with nw, ne, sw, se. Used for reverse search. Can be null.
view_url Text. URL of the full-size file.
representations Object. URLs of the file in different sizes. See section 5.2.
thumbnails_generated True or false.
processed True or false.
spoilered True if your filter spoilers this image.
hidden_from_users False.
deletion_reason Null.
duplicate_of Null.
A deleted image has only these fields:
Field Meaning
id, created_at, updated_at, first_seen_at As above.
hidden_from_users True.
deletion_reason The reason. Null if the image is a duplicate.
duplicate_of The ID of the image that it duplicates, or null.

5.2 Representations

Key Maximum size (width x height)
thumb_tiny 50 x 50
thumb_small 150 x 150
thumb 250 x 250
small 320 x 240
medium 800 x 600
large 1280 x 1024
tall 1024 x 4096
full The full-size file.
If the image is smaller than a size, that key gives the full-size URL. GIF images also have webm and mp4 keys.
The full URL and view_url count as full-size downloads. See section 1.1. The other sizes are thumbnails.

5.3 Interaction

Only returned with a valid key. Shows what the user did with an image.
Field Meaning
image_id Number.
user_id Number.
interaction_type voted, faved or hidden.
value up or down for votes. An empty string for others.

5.4 Tag

Field Meaning
id Number.
name Text. For example artist:example.
slug Text. Use this in URLs.
namespace Text. For example artist. Can be null.
name_in_namespace Text. The name without the namespace.
category Text. Can be null.
description Text. Markdown.
short_description Text.
images Number of images with this tag.
spoiler_image_uri Text. URL of the spoiler image. Can be null.
aliased_tag Slug of the tag that this tag is an alias of. Null if it is not an alias.
aliases List of slugs of tags that are aliases of this tag.
implied_tags List of slugs. Adding this tag adds them.
implied_by_tags List of slugs. Those tags add this tag.
dnp_entries List of Do-Not-Post entries. See section 5.5.

5.5 DNP entry

Note we use the DNP tag for marking DNP images on AMS. The DNP endpoint is for compatibility for other Philomena-based image boards, but is not used. To determine if an artist is on the DNP list, check the implied tags for that artist for dnp.
Field Meaning
id Number.
dnp_type Text. The type of restriction.
conditions Text. Conditions set by the artist.
reason Text. Null if the artist hid the reason.
created_at Time.

5.6 Comment

Field Meaning
id Number.
image_id Number.
user_id Number. Null if anonymous.
author Text. Display name.
avatar Text. Avatar URL.
body Text. Markdown.
created_at Time.
updated_at Time.
edited_at Time. Null if not edited.
edit_reason Text.
If staff hid a comment, body, edited_at and edit_reason are null.

5.7 Forum post

The same fields as a comment (section 5.6), but with no image_id.

5.8 Forum

Field Meaning
name Text.
short_name Text. Use this in URLs.
description Text.
topic_count Number.
post_count Number.

5.9 Topic

Field Meaning
slug Text. Use this in URLs.
title Text.
post_count Number.
view_count Number.
sticky True or false.
locked True or false.
last_replied_to_at Time.
user_id Number. Null if anonymous.
author Text.

5.10 oEmbed

Field Meaning
type, version photo, 1.0.
title Text. Image ID and tags.
author_name Text. The artist tags.
author_url Text. The first source URL.
provider_name art.mobius.social.
provider_url Text.
cache_age 7200 (seconds).
url Text. Full-size file URL.
width, height Numbers.
thumbnail_url Text. Large thumbnail URL.
thumbnail_width, thumbnail_height Numbers.
derpibooru_id Number. Image ID.
derpibooru_score Number.
derpibooru_comments Number. Comment count.
derpibooru_tags List of tag names.
The derpibooru_ names are kept for compatibility with other software.

5.11 Gallery

Field Meaning
id Number.
title Text.
description Text.
spoiler_warning Text.
thumbnail_id Number. ID of the cover image.
user Text. Name of the creator.
user_id Number. ID of the creator.

5.12 Filter

Field Meaning
id Number.
name Text.
description Text.
public True or false.
system True or false. True for site filters.
user_count Number of users of this filter.
user_id Number. Owner. Null for system filters.
hidden_tag_ids List of tag IDs that are hidden.
spoilered_tag_ids List of tag IDs that are spoilered.
hidden_complex Text. Search query. Matching images are hidden.
spoilered_complex Text. Search query. Matching images are spoilered.

5.13 Profile

Field Meaning
id Number.
name Text.
slug Text.
role Text. For example user.
description Text.
avatar_url Text. Can be null.
created_at Time.
comments_count Number.
uploads_count Number.
posts_count Number. Forum posts.
topics_count Number. Forum topics.
links List of artist links: user_id, tag_id, state, created_at.
awards List of badges: id, title, label, image_url, awarded_on.
Do not use profiles to track users or collect data about them. See section 1.6.

6. Examples

Search for safe images, 50 per page, highest score first:
GET /api/v1/json/search/images?q=safe&per_page=50&sf=score&sd=desc
Get image 123:
GET /api/v1/json/images/123
Find tags that start with “artist:”:
GET /api/v1/json/search/tags?q=artist:*
Reverse search by URL:
POST /api/v1/json/search/reverse?url=https://example.com/a.png
Example with curl:
curl -A "mytool/1.0 (operator: exampleuser)" \
  "https://art.mobius.social/api/v1/json/search/images?q=safe"