Detection API walkthrough

Need subtitles in another language?How to turn them on
- Play the video, then select the CC (subtitles) button in the bottom right of the player.
- Select Settings (the gear icon), then Subtitles/CC.
- Choose the language you want from the list.
On a phone, tap the video once to show the controls, then tap CC or the gear icon.
In this guide
Connect TruthScan's detectors to your own systems. Every detector follows the same pattern: get an upload URL, upload the file, submit it for detection, then check for the result.
- Generate an API key
- Upload and submit an image for detection
- Poll for the result and read the response
- Run bulk image scans with a ZIP
- Apply the same pattern to video, audio, and PDF
Good to know
- A scan usually finishes in a few seconds. On Enterprise plans, we can work with you to lower processing time for your volume.
- Setup is quick: four requests take you from upload to result.
- API access isn't included on every plan. If you can't create an API key, contact us and we'll enable API access for your account.
- Need separate keys for development, testing, and production? Create as many API keys as you need in your dashboard, give each one a name, and revoke any key on its own.
- Most teams send images above a chosen score to a person for review. See Choosing a review threshold.
Chapters
TranscriptRead along or copy
In this walkthrough, we'll connect to the TruthScan Detection API, from uploading a file to reading the result. We'll use the image detector, then show how the others follow the same pattern.
First, you'll need an API key. In your TruthScan account, open API Keys and click Generate New Key. Store it somewhere safe, like your secrets manager.
We'll use Postman. A scan takes four requests: get an upload URL, upload the file, submit it for detection, and check for the result. Scans run in the background, so you'll check back with the scan ID until it's done.
Step one: request an upload URL. Send a GET request with your file name and your API key in the header. You'll get back an upload URL and a file path.
Step two: upload the image to that URL with a PUT request. Set the content type to match your file. An empty success response means it worked.
Step three: submit the file for detection. Send a POST request with your key and the file's URL. You can also ask for a heatmap and detailed analysis. You'll get back a scan ID with a status of pending.
Step four: send the scan ID to the query endpoint, and repeat until the status is done. The response includes the score, the final verdict, how confident TruthScan is in that verdict, any quality warnings, and a heatmap link if you asked for one.
To scan many images at once, upload a ZIP the same way, then send it to the bulk upload endpoint. You'll get one ID to check for the whole batch.
Video, audio, and PDF work the same way. Each has its own address and detect endpoint, and returns an ID you check with query. Video also lets you choose standard or face swap detection, and PDF tells you whether a document is genuine or tampered.
You can check your remaining credits anytime with the check credits endpoint. For rate limits, errors, and every field, see the API docs for each detector. Thanks for watching.
Endpoints
| What | Endpoint |
|---|---|
| Image host | https://detect-image.truthscan.com |
| Get upload URL | GET /get-presigned-url?file_name=... |
| Upload | PUT {presigned_url} |
| Submit image | POST /detect |
| Bulk ZIP | POST /bulk-upload |
| Get result | POST /query |
| Credits | GET /check-user-credits |
| Video host | https://detect-video.truthscan.com (POST /detect-file or /detect) |
| Audio host | https://detect-audio.truthscan.com (POST /detect) |
| PDF host | https://detect-text.truthscan.com (POST /detect-pdf) |