API is live

Trust Engine API

Real-time fraud detection for phone numbers, crypto tokens, and properties. One endpoint, consistent schema, sub-200ms responses.

Base URL
trustscore.dev
Avg latency
<200ms
Auth
Not required (MVP)

Quick start

bash
curl -X POST https://trustscore.dev/api/score \
  -H "Content-Type: application/json" \
  -d '{
    "type": "phone",
    "input": { "phone_number": "+15551234567" }
  }'

Interactive playground

Try it live

Endpoints

POST/api/score

Evaluate trust score

Accepts a type and input, routes to the domain module, and returns a trust assessment. Currently supports phone numbers, with token and property coming soon.

Request body

typestringrequired"phone", "token", or "property". Determines which module processes the input.
inputobjectrequiredInput data for the module. For phone: { phone_number: string }. Accepts E.164, national, or formatted numbers.

Response

json
{
  "score": 97,
  "confidence": 0.75,
  "decision": "safe",
  "signals": {
    "e164": "+15551234567",
    "valid": true,
    "carrier": "T-Mobile",
    "line_type": "Wireless",
    "is_voip": false,
    "fraud_score": 0,
    "active": true,
    "spammer": false
  },
  "risk_flags": [],
  "summary": "This number appears trustworthy with a score of 97/100.",
  "_meta": {
    "latency_ms": 342,
    "type": "phone",
    "sources": ["libphonenumber", "ipqs"]
  }
}

Response fields

scoreinteger (0-100)Trust score. 100 = most trustworthy, 0 = highest risk.
confidencenumber (0-1)Confidence level. Higher when more data sources contributed.
decisionstring"safe" (≥70), "warning" (40-69), or "high_risk" (<40).
signalsobjectRaw signals from all data sources. Shape varies by module type.
risk_flagsstring[]Human-readable risk indicators. E.g. "VoIP number", "Known spammer".
summarystringHuman-readable summary of the trust evaluation.
_metaobjectMetadata: latency_ms, type, sources array.
POST/api/batch-score

Batch evaluate trust scores

Process up to 25 inputs in parallel. Each item follows the same schema as POST /api/score. Failed items return an error string instead of a result.

bash
curl -X POST https://trustscore.dev/api/batch-score \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "type": "phone", "input": { "phone_number": "+15551234567" } },
      { "type": "phone", "input": { "phone_number": "+18005550199" } }
    ]
  }'
itemsarray (max 25)requiredArray of { type, input } objects. Same schema as /api/score.
GET/api/health

Health check

Returns server status, registered modules, and current timestamp. Use for uptime monitoring.

json
{
  "status": "ok",
  "modules": ["phone"],
  "timestamp": "2026-04-14T12:00:00.000Z"
}
GET/api/openapi

OpenAPI specification

Returns the full OpenAPI 3.1 spec as JSON. Import into Swagger UI, Postman, or use as a tool schema for LLM agents.

Returns the complete OpenAPI 3.1.0 specification including all schemas, examples, and error codes.

Error codes

INVALID_JSON400Request body is not valid JSON
MISSING_FIELDS400Missing required "type" or "input" fields
UNKNOWN_TYPE422Unrecognized module type (not phone/token/property)
BATCH_TOO_LARGE400Batch exceeds 25 items
INTERNAL_ERROR500Unexpected server error
Trust Engine API v1.1 — Spark Engineering
OpenAPI JSONStatus