{
  "name": "Unphurl Domain Intelligence API",
  "version": "2.0.0",
  "description": "URL intelligence for autonomous AI agents. One URL in, structured signals out. Score + signals + breakdown. You decide the threshold.",
  "endpoints": [
    {
      "method": "GET",
      "path": "/v1/check",
      "auth": true,
      "description": "Analyse a URL and get structured signals. Pass the URL as a query parameter: /v1/check?url=https://example.com"
    },
    {
      "method": "POST",
      "path": "/v1/check/batch",
      "auth": true,
      "description": "Analyse up to 500 URLs in one request. Known/cached URLs resolve immediately. Unknowns are queued for async pipeline processing. Returns a job_id for polling."
    },
    {
      "method": "GET",
      "path": "/v1/jobs/:id",
      "auth": true,
      "description": "Poll for async batch job status and results."
    },
    {
      "method": "POST",
      "path": "/v1/signup",
      "auth": false,
      "description": "Create an account. Send JSON body with { \"email\": \"...\", \"first_name\": \"...\" }. Returns an API key shown exactly once."
    },
    {
      "method": "GET",
      "path": "/v1/account",
      "auth": true,
      "description": "View account info: email, name, verified status, balance, free lookups."
    },
    {
      "method": "DELETE",
      "path": "/v1/account",
      "auth": true,
      "description": "Permanently delete account and all associated data. Cannot be undone."
    },
    {
      "method": "GET",
      "path": "/v1/history",
      "auth": true,
      "description": "Paginated check history. Supports ?page=1&limit=20 (max 100). Returns domain, score, phishing status, and timestamp for each check."
    },
    {
      "method": "POST",
      "path": "/v1/purchase",
      "auth": true,
      "description": "Buy pipeline check credits. Send { \"package\": \"pkg_500\" }. Returns a Stripe Checkout URL to complete payment."
    },
    {
      "method": "GET",
      "path": "/v1/balance",
      "auth": true,
      "description": "View your credit balance, total purchased, total used, and free lookups."
    },
    {
      "method": "POST",
      "path": "/v1/keys/rotate",
      "auth": true,
      "description": "Rotate your API key. New key shown exactly once."
    },
    {
      "method": "GET",
      "path": "/v1/pricing",
      "auth": false,
      "description": "View pipeline check packages, pricing, and what's free."
    },
    {
      "method": "GET",
      "path": "/v1/known",
      "auth": false,
      "description": "Check if a domain is in the Tranco Top 100K. Known domain checks are free. /v1/known?domain=example.com"
    },
    {
      "method": "GET,POST,DELETE",
      "path": "/v1/profiles",
      "auth": true,
      "description": "Manage custom scoring profiles. Different use cases need different signal weights."
    }
  ],
  "auth": {
    "type": "API Key",
    "methods": [
      "Authorization: Bearer <api_key>",
      "x-api-key: <api_key>",
      "?api_key=<api_key> (query parameter)"
    ],
    "signup": "POST /v1/signup with { \"email\": \"you@example.com\" }"
  },
  "pricing": {
    "model": "prepaid_pipeline_checks",
    "known_domains": "Free (Tranco Top 100K)",
    "cached_domains": "Free (previously analysed domains)",
    "pipeline_checks": "1 credit per unknown domain. Buy packages starting at $9.",
    "purchase": "POST /v1/purchase"
  },
  "response_time_ms": "200-500ms typical"
}