Skip to content

Use code FUN10 for 10% bonus credits

DocsThreatMetrix

ThreatMetrix API Reference

Bind a ThreatMetrix device profile to your session ID.

Read Markdown (English)

The Captcha.fun ThreatMetrix API accepts kind, url, threatMetrixOrgId, threatMetrixSessionId and returns Your session ID, bound to a profile. Send the API_KEY header, create a solve with POST /v1/request, then poll GET /v2/response/{id} until ready is true.

What you’ll need

  • Your API key
  • The URL of the page where the challenge appears
  • threatMetrixOrgId — Your ThreatMetrix org ID: the account the profile binds to
  • threatMetrixSessionId — Session ID to bind the profile to. Send the same ID with the protected call
  • A proxy, if the result must come from your own IP (threatmetrix_proxy)
Use kind

Good to Know

Runs ThreatMetrix device profiling and binds the profile to the session ID you supply. No domain input is needed.

There’s no token to replay: after the solve, send the same session ID with your protected call.

Send the Challenge

Send the page details with your API key. You get a solve id back right away.

POSThttps://api.captcha.fun/v1/request
curl -X POST https://api.captcha.fun/v1/request \
  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "kind": "threatmetrix",
  "url": "https://your-domain.example",
  "threatMetrixOrgId": "YOUR_THREATMETRIX_ORG_ID",
  "threatMetrixSessionId": "YOUR_TRANSACTION_SESSION_ID"
}'

Response

Returns the solve id. Use it to get the result.

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Started Solving"
}
Request fields6 body fields · 4 required

Headers

NameTypeRequiredDescription
API_KEYstringYesYour API key
Content-TypestringYesapplication/json
APP_IDstringNoOptional app ID for request tracking

Body

NameTypeRequiredDescription
kindstringYesOne of threatmetrix, threatmetrix_proxy
urlstringYesPage URL where the challenge appears
threatMetrixOrgIdstringYesYour ThreatMetrix org ID: the account the profile binds to
threatMetrixSessionIdstringYesSession ID to bind the profile to. Send the same ID with the protected call
proxystringNoFor _proxy kinds: host:port or host:port:username:password
platformstringNoRequested platform label: windows (default) or mac

Wait for the Result

Use the solve id to fetch the result.

GEThttps://api.captcha.fun/v2/response/{id}

Poll every second until ready is true.

Example

curl -X GET https://api.captcha.fun/v2/response/550e8400-e29b-41d4-a716-446655440000 \
  -H "API_KEY: CAPFUN-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Accept: application/json"

Response

{
  "ready": true,
  "status": "SUCCESS",
  "success": true,
  "userAgent": "RETURNED_USER_AGENT",
  "secUa": "RETURNED_SEC_CH_UA",
  "token": "YOUR_TRANSACTION_SESSION_ID"
}
Request and response fields7 response fields

Request

NameTypeRequiredDescription
idstring (UUID)YesPath parameter. The id from Create Solve
API_KEYstringYesHeader. Your API key

Response Fields

NameTypeRequiredDescription
readyboolean—true when the solve is finished (v2 only)
statusstring—PENDING while solving, then SUCCESS or FAILURE
successboolean—Whether the solve succeeded
userAgentstring—Value to send as User-Agent when using the result. Preserve it exactly
secUastring—Value to send as Sec-CH-UA when using the result
tokenstring—Your session ID, echoed once the profile is bound
messagestring—Failure reason. Omitted on success

Replay the Request

  • Send the same session ID with the protected login or payment call. ThreatMetrix scores it against the profile bound during the solve.
  • The profile is bound to the solving browser's fingerprint and egress IP — send the protected call from the same egress. Profiles accumulate trust server-side; a session id solved seconds ago starts with minimal history.

When using a successful result, preserve the returned userAgent as User-Agent and secUa as Sec-CH-UA.

Wrong or rejected result? Report the failed solve.