Mistfile API
Send a file. Get back what it gives away about its owner, and a clean copy.
Two requests: one checks the file, one returns the cleaned copy. You pay for the check; cleaning is included.
1. Get a key
Write to @mistfile_bot. A key looks like mf_… and carries a balance of checks. Send it with every request:
Authorization: Bearer mf_your_key
2. Check a file
curl -X POST "https://HOST/v1/check?lang=en" \
-H "Authorization: Bearer mf_your_key" \
-F "file=@photo.jpg"
The answer:
{
"id": "3f9c1a2b7d4e",
"media": "photo",
"risk": 3,
"summary": "🔴 High risk",
"findings": [
{"id": "m1", "where": "file", "kind": "gps", "risk": 3,
"text": "GPS coordinates of the shooting place", "action": "will remove",
"fix": "strip", "selectable": false, "selected": false},
{"id": "f1", "where": "picture", "kind": "address", "risk": 3,
"text": "Street name and house number are readable.", "action": "will cover",
"fix": "fill", "selectable": true, "selected": true,
"boxes": [[60, 96, 720, 84]]}
],
"cost": 1,
"balance": 29,
"expires_in": 3600
}
Values found in the file (coordinates, names, phone numbers) are never returned, only the fact that they are there.
3. Get the clean copy
curl -X POST "https://HOST/v1/jobs/3f9c1a2b7d4e/clean" \
-H "Authorization: Bearer mf_your_key" \
-o clean.jpg
Hidden data is always removed. Findings marked "selected": true are covered in the picture or muted in the sound. To choose yourself, send their ids:
curl -X POST "https://HOST/v1/jobs/3f9c1a2b7d4e/clean" \
-H "Authorization: Bearer mf_your_key" \
-H "Content-Type: application/json" \
-d '{"fix": ["f1"], "change_voice": false, "keep_rights": false}' \
-o clean.jpg
change_voice alters the voice in a video or a recording. keep_rights leaves the author and copyright in a photo.
Python
import requests
API = "https://HOST/v1"
AUTH = {"Authorization": "Bearer mf_your_key"}
with open("photo.jpg", "rb") as f:
report = requests.post(f"{API}/check", headers=AUTH, files={"file": f}).json()
for finding in report["findings"]:
print(finding["risk"], finding["text"])
clean = requests.post(f"{API}/jobs/{report['id']}/clean", headers=AUTH)
open("clean.jpg", "wb").write(clean.content)
requests.delete(f"{API}/jobs/{report['id']}", headers=AUTH)
Price
| File | Checks | Formats |
|---|---|---|
| Photo | 1 | JPEG, PNG, HEIC, AVIF, WebP, GIF |
| Recording | 1 | MP3, M4A, OGG, WAV, FLAC, AAC |
| Document | 1 | PDF, DOCX, XLSX, PPTX, ODT, ODS, ODP, RTF, DOC, XLS, PPT |
| Document with its text read | +1 | Add ?text=1: the report also says what the text gives away (home addresses, document numbers, health, passwords). Not charged when the file has no text. |
| Video | from 3 | MP4, MOV. One check for every 2 frames looked at; longer clips cost more. |
| Clean copy | 0 | Included in the check. |
The price of a video is known only after upload. Add ?max_cost=5 and a dearer video is refused without charge; the refusal names its price.
A file that could not be checked costs nothing.
All requests
| Request | What it does |
|---|---|
POST /v1/check | Upload a file (field file, up to 50 MB), pay, get the report. ?lang=en|ru sets the language of the texts, ?text=1 reads the text of a document. |
GET /v1/jobs/{id} | The report again. |
POST /v1/jobs/{id}/clean | The cleaned file. Can be asked again with another choice. |
DELETE /v1/jobs/{id} | Delete the file and its copy now. |
GET /v1/balance | Checks left on the key. |
GET /v1/usage | What was taken from the key and added to it, by day and line by line. ?limit=100 |
GET /v1/prices | Current prices. No key needed. |
Errors
Every error is JSON: {"error": {"code": "no_balance", "message": "…", "cost": 3, "balance": 1}}
| Status | Code | Meaning |
|---|---|---|
| 400 | no_file, bad_request | The request is malformed. |
| 401 | unauthorized | No key, a wrong key, or a key that was switched off. |
| 402 | no_balance, over_max_cost | Not enough checks, or the video costs more than max_cost. |
| 404 | not_found | The job expired or was deleted. |
| 413 | too_large | The file is over 50 MB. |
| 415 | unsupported | Not a supported format, or the file is damaged. |
| 429 | rate_limited | Too many requests in a minute. Wait the seconds given in Retry-After. |
| 503 | unavailable | The check could not run. Nothing was charged; try again. |
Your files
A file and its clean copy are deleted 1 h after upload, or at once when you call DELETE. Nothing else about a file is kept.
A check lowers the risk; it does not promise that nothing is left. Look at the result before publishing.