Scoring Endpoints

AI agent and bot detection

Tell helpful agents from hostile bots. POST /v1/score/bot scores ai agent and bot detection from 0 to 1000 for $0.002 a call.

Tell the agents that work for your customers from the bots that attack them. Some automated traffic is a customer's own agent placing an order. Some is a script testing stolen cards. Describe the session, and get a score for how likely it is automated abuse.

EndpointPriceGroup
POST /v1/score/bot$0.002 per callPolicy & Abuse

Request

Send what you know in one context object. session is required; every other field is optional. A field can hold text, JSON or CSV.

curl https://api.finic.ai/v1/score/bot \
  --header "Authorization: Bearer $FINIC_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "context": {
      "session": { "duration_seconds": 60, "checkout_attempts": 42, "distinct_cards": 42, "pointer_events": 0, "median_ms_between_actions": 140 },
      "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/126.0.0.0 Safari/537.36",
      "ip": { "address": "192.0.2.146", "type": "datacenter", "city": "Ashburn", "region": "VA", "sessions_today": 300 },
      "account": { "signed_in": false, "checkout": "guest" },
      "device": { "webdriver": true, "plugins": 0, "screen": "800x600" }
    }
  }'

Fields you send

Send the details, not only an ID: an account ID tells the score nothing, but the account's age, profile and history do. Fields that are not in this list are also read.

FieldDescription
sessionRequiredWhat the session did: its events or its counts, with timings.
user_agentOptionalThe full user agent string, with any client hints.
ipOptionalThe IP address with what your lookup says about it: country, city and network type. An address by itself says little.
accountOptionalA description of the account in use, not an account ID: its age, its history, and whether the customer has set up an agent.
declared_agentOptionalWhat the client says it is, if it identifies itself as an agent, and who it says it acts for.
deviceOptionalA description of the device: its fingerprint traits, and the other sessions seen on it.
other_contextOptionalAny other information, structured or unstructured, that is useful for scoring.

Response

score runs from 0, the lowest risk, to 1000, the highest. questions are the yes/no questions behind it, each with the probability that the answer is yes.

{
  "score": 968,
  "questions": [
    {
      "text": "Are actions arriving faster than a person could click?",
      "probability": 0.97
    },
    {
      "text": "Is one client trying many cards or accounts?",
      "probability": 0.96
    },
    {
      "text": "Does the browser report traits of an automation tool?",
      "probability": 0.94
    },
    {
      "text": "Is this an agent acting for a signed-in customer?",
      "probability": 0.04
    }
  ],
  "request_id": "req_01M4YF1068X8B4C458ENPD4JHT"
}

The questions behind the score

  1. Are actions arriving faster than a person could click?
  2. Is one client trying many cards or accounts?
  3. Does the browser report traits of an automation tool?
  4. Is this an agent acting for a signed-in customer?

Every organization gets the same questions for this score. To use your own questions, or to calibrate a score to your own outcomes, copy it to a custom scoring model in the Finic app (Starter plan and above).

Turn the score into an action

These thresholds are examples. Choose your own, and change them as you learn.

ScoreActionExample
Under 300ApproveLet the session go on.
300 to 599Step upShow a challenge.
600 to 849ReviewFlag the session for an analyst.
850 or moreBlockEnd the session.

Errors

StatustypeWhen
400invalid_requestcontext is missing, is not a JSON object, or a required field (session) is empty. param names the field.
401authentication_errorThe API key is missing or not valid.
402insufficient_creditThe organization has no credit. Add credit in the Finic app.
429rate_limitedToo many requests. Retry with exponential backoff.

See the API reference for every error and limit, and Pricing for what a call costs.

On this page