developers / API reference
Downloads API
The Downloads API: get a ShareX config with a new upload token, with every endpoint's fields, who may call it, its rate limit and a curl example.
This page as MarkdownGet a new upload token for a phone's uploader, set up by hand: the answer is the only time it's shown
get/downloads/keys/:uploader
It works for 90 days and counts toward the upload token limit; `url` is where it uploads.
- Needs
- Session token
- The token from signing in, in the Authorization header.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- Not open to apps
- An uploader's config, script or key carries a new upload token. Nor to API keys.
Path parameters
uploaderenumrequiredOne of
shortcuthttp-shortcuts
Response
Returns an object with these fields:
tokenstringThe upload token, hmu_…, shown only now.
notestringThe name it's listed under in Settings → Security.
expiresAtstring | nullWhen it stops working.
urlstringWhere it uploads: POST /images on this api.
curl 'https://api.hematite.gg/v1/downloads/keys/shortcut' \
-H "Authorization: $HEMATITE_TOKEN"{
"token": "hms_live_m0plGGtn67kMZy6D_…",
"note": "ShareX",
"expiresAt": "string",
"url": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
}Get hematite's upload script for a screenshot tool: the file itself, saved rather than shown
get/downloads/scripts/:uploader
It uploads the image it's given and prints its link. Each one holds a new upload token, working for 90 days, that counts toward the upload token limit.
- Needs
- Session token
- The token from signing in, in the Authorization header.
- Rate limit
- 120 a minute
- Per address, for this endpoint.
- App scope
- Not open to apps
- An uploader's config, script or key carries a new upload token. Nor to API keys.
Path parameters
uploaderenumrequiredOne of
flameshotksnipgreenshot
Query
shellenumsh for macOS and Linux (hematite-upload.sh), powershell for Windows (hematite-upload.ps1; ksnip's is hematite-upload.cmd, which it can start). Left out, the one the tool runs: sh, or PowerShell for Greenshot.
One of
shpowershell
Response
data is empty: the status says it worked.
curl 'https://api.hematite.gg/v1/downloads/scripts/flameshot' \
-H "Authorization: $HEMATITE_TOKEN"