Skip to main content

Score Lookup

To retrieve the Trust Score for a specific session by RequestID, use the debug endpoint with search_type=request_id.

Endpoint

GET /pub/{public_key}/{secret_key}/debug/request_id/{request_id}

Example

curl "https://api.shieldlabs.ai/pub/YOUR_PUBLIC_KEY/YOUR_SECRET/debug/request_id/550e8400-e29b-41d4-a716-446655440000"
Response:
[
  {
    "RequestID": "550e8400-e29b-41d4-a716-446655440000",
    "Score":     42,
    "Details":   [{ "Value": 20, "Description": "Is datacenter" }],
    "IP":        "93.184.216.34",
    "OS":        "Windows",
    "Country":   "US",
    "CreatedAt": "2026-04-14T10:00:00Z"
  }
]
While it’s possible to poll for a score by RequestID after the browser check, the recommended pattern is to use webhooks:
// ❌ Polling — adds latency and complexity
async function pollScore(requestId, maxAttempts = 10) {
  for (let i = 0; i < maxAttempts; i++) {
    const res = await fetch(`/pub/${KEY}/${SECRET}/debug/request_id/${requestId}`);
    const data = await res.json();
    if (data.length > 0) return data[0];
    await sleep(500);
  }
  return null;
}

// ✅ Recommended — use webhooks
// See /setup/webhooks
Use the webhook for real-time score delivery. Use the score lookup endpoint only for:
  • Debugging specific sessions
  • Looking up historical data
  • Admin tooling and dashboards