Developers

Public fraud-check API

Query the FraudLens reputation engine from your own app, bot, or checkout flow. Authenticated with an API key and rate-limited per key.

Endpoint

GET /api/check?upi=sbi-kyc@oksbi
GET /api/check?phone=+919876500011
GET /api/check?url=http://sbi-kyc-update.in
GET /api/check?q=<free text>&ai=1

Authenticate with an x-api-key header (or ?key=). Add &ai=1 to include the Gemini verdict.

Example

curl "http://localhost:3000/api/check?upi=sbi-kyc@oksbi&ai=1" \
  -H "x-api-key: flk_demo_key_2026"

Response:

{
  "query": { "kind": "upi", "value": "sbi-kyc@oksbi" },
  "reputation": { "known": true, "riskScore": 94, "reportCount": 7, "isFlagged": true },
  "analysis": { "scamProbability": 0.96, "category": "Fake KYC", "advice": "..." },
  "rateLimit": { "remaining": 119, "limit": 120 }
}

Notes

  • Rate limits are per key, per minute. Responses include X-RateLimit-Remaining.
  • Keys are stored hashed (SHA-256); shown in full only once.
  • Demo key flk_demo_key_2026 is seeded by bun run db:seed.

Database not connected

Add DATABASE_URL to .env.local, then run bun run db:push and bun run db:seed.