Skip to guide
Documentation/Getting started with the API

Getting started with the API

Request access, make a check, and show the result.

01

Access is by request.

The API is by request only for now, so there is no plan to pick and no price list. Every check you send draws credits, and the depth you ask for sets how many: 5 at JUST_THE_FACTS, 250 at DEEP_DIVE.

Ask for access in the next step.

02

Request access.

Tell us what you are building. Keys are issued by hand for now.

Request access

03

Your key.

Send it as Authorization: Bearer on every request. Keep it on your server. Never put it in a browser or a mobile app.

04

Your first request.

Send the same request in curl, Python, JavaScript or TypeScript. Python uses requests. JavaScript uses Node 18 or later.

curl
job=$(curl -X POST https://api.backgrounder.com/api/analyze-content \
  -H "Authorization: Bearer $CARMEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":{"text":"Your parcel is held. Pay the release fee at parcel-redelivery.info"},"options":{"createCase":true}}')
05

Read the response.

A bare link, a person or a deepfake check returns 200 with mode "sync" and the result inline.

A message or an email returns 202 with mode "async", status "pending", links.status and links.result. Poll links.result until status is "completed".

The examples below show the two response shapes. Use the URLs returned in links.

200 · Sync

{
  "job_id": "example-sync",
  "status": "completed",
  "mode": "sync",
  "result": {
    "verdict": "clean",
    "headline": "Low risk. The link goes to the expected website.",
    "recommended_action": "Nothing to do."
  }
}

202 · Async

{
  "job_id": "example-async",
  "status": "pending",
  "mode": "async",
  "links": {
    "status": "<status URL returned by the API>",
    "result": "<result URL returned by the API>"
  }
}

Continue from your first request. The curl polling example uses jq.

curl
result_url=$(printf '%s' "$job" | jq -r '.links.result'); status=$(printf '%s' "$job" | jq -r '.status')
while [ "$status" != "completed" ]; do
  sleep 2; job=$(curl --fail --silent --show-error -H "Authorization: Bearer $CARMEN_API_KEY" "$result_url"); status=$(printf '%s' "$job" | jq -r '.status')
done
06

Show it to your user.

Map the verdict: clean is Low risk, unknown_fresh and suspicious are Medium risk, malicious is High risk. Show the headline and the recommended_action as they are, because they are written for a person. evidence_trail has up to six reasons with a source and a weight if you want to show why.

07

Limits and errors.

401: the key is wrong or missing. 429: out of credits or over your rate. 400: the body did not validate, and the error message says why. The same content sent again within an hour returns the same verdict.

Preview