developers / Getting started
hematite REST API overview
The hematite REST API at a glance: the base address, the code, message and data every answer has, sending data, ids, dates, enums, paging and limits.
This page as Markdownhematite's REST API is what the website and ShareX use: upload, list and edit images, folders, shares, comments and domains. Every endpoint is in the API reference, made from the API's own schemas. From JavaScript or TypeScript, the SDK makes the same calls for you.
The address
Every endpoint is under one base address:
https://api.hematite.gg/v1An endpoint's path follows it: GET /images/:imageId is https://api.hematite.gg/v1/images/1. A part written :imageId stands for a value, here the image's id.
A first request
Badges need no token, so this works as it is:
curl https://api.hematite.gg/v1/badgesMost endpoints need you signed in: send your token in the Authorization header. Authentication says where a token comes from, and Sign in with hematite how an app gets one. Every endpoint in the reference has a Try it tab that sends it as you, once you've signed in to the docs.
curl https://api.hematite.gg/v1/images/1 \
-H "Authorization: $HEMATITE_TOKEN"Every answer has the same shape
The body is JSON with three fields: code, message and data. What the endpoint returns is in data; the reference lists its fields for each endpoint.
{
"code": "SUCCESS",
"message": "OK",
"data": {
"id": 1,
"title": "Clutch on Ascent",
"visibility": "Unlisted"
}
}message is the status in words (OK, Created). An error keeps the shape, with its own code and message: see errors and limits.
Sending data
- JSON bodies go with
Content-Type: application/json. - Uploads are
multipart/form-data, the image in the fieldfile: seePOST /images. - Query parameters are written as text and read as their type:
?limit=20&partial=true.
Values
- Ids are numbers.
- Dates are ISO 8601 strings in UTC:
2026-11-10T18:24:00.000Z. - Sizes are bytes: a
sizeof2457600is 2.4 MB. - Enums are strings, the value's name: an image's
visibilityisUnlisted,PublicorPrivate. The reference lists every enum's values where it's used. - Colours are
#and six hex digits, lowercase: a folder'scoloris#c4d4e0. Send them so; six digits without the#are still taken for now.
Paging
Lists that can grow long take limit and offset: limit is how many to return (100 unless you say), offset how many to skip from the start (0). Images come newest first.
curl "https://api.hematite.gg/v1/users/1/images?limit=20&offset=40" \
-H "Authorization: $HEMATITE_TOKEN"That's the third page of 20. A page shorter than limit is the last one. The image and user searches take the same two fields in their body.
Limits
Every endpoint has a rate limit, per address: 120 a minute unless its reference entry says otherwise. How much you can store depends on your plan: see pricing. Errors and limits has the details.