{"openapi":"3.1.0","info":{"title":"Scrapegoat API","version":"1.0.0","description":"Web search, cited answers and page content. Requires an active enterprise API key. Manage Scrapegoat keys at https://scrapegoat.ai/account."},"externalDocs":{"description":"Agent integration guide","url":"https://scrapegoat.ai/docs.md"},"servers":[{"url":"https://scrapegoat.ai"}],"security":[{"bearerAuth":[]},{"apiKey":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/v1/search":{"post":{"operationId":"search","summary":"Search the web","description":"limit is a maximum, not a guaranteed result count.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000},"country":{"type":"string","pattern":"^[a-zA-Z]{2}$"},"limit":{"default":10,"type":"integer","minimum":1,"maximum":10}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","required":["id","title","url"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"text":{"type":"string","description":"Available source excerpt; not full page content."}}}}}}}},"headers":{"X-Cache":{"schema":{"type":"string","enum":["HIT","MISS","BYPASS"]},"description":"BYPASS means a successful response could not be cached."},"X-Cache-Age":{"schema":{"type":"integer"},"description":"Cached result age in seconds."},"X-Request-Id":{"schema":{"type":"string"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"400":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"401":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"403":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"413":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"415":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"422":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"429":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"502":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"503":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"504":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}}}}},"/v1/ask":{"post":{"operationId":"ask","summary":"Get an answer with numbered citations","description":"Returns an answer as Markdown. Each [n] citation resolves to citations[n-1]. Answers without attributable sources are rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000},"country":{"type":"string","pattern":"^[a-zA-Z]{2}$"},"language":{"type":"string","pattern":"^[a-zA-Z]{2}$"}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","required":["answer","citations"],"properties":{"answer":{"type":"string"},"citations":{"type":"array","items":{"type":"object","required":["id","title","url"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"url":{"type":"string","format":"uri"},"text":{"type":"string","description":"Available source excerpt; not full page content."}}}}}}}},"headers":{"X-Cache":{"schema":{"type":"string","enum":["HIT","MISS","BYPASS"]},"description":"BYPASS means a successful response could not be cached."},"X-Cache-Age":{"schema":{"type":"integer"},"description":"Cached result age in seconds."},"X-Request-Id":{"schema":{"type":"string"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"400":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"401":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"403":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"413":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"415":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"422":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"429":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"502":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"503":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"504":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}}}}},"/v1/scrape":{"post":{"operationId":"scrape","summary":"Fetch a public page as Markdown","description":"Fetches one public HTTP(S) URL. Facebook page URLs use a dedicated render that opens the hours panel where available; groups, posts, videos and authenticated content are unsupported. Returns Markdown without model extraction. url is the normalized requested URL (Facebook short links are resolved), not a guaranteed final redirect URL. Content is capped at 500,000 characters; truncated reports clipping. Cached for 24 hours.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":4096,"format":"uri"}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","required":["url","markdown","truncated"],"properties":{"url":{"type":"string","format":"uri"},"markdown":{"type":"string"},"truncated":{"type":"boolean"}}}}},"headers":{"X-Cache":{"schema":{"type":"string","enum":["HIT","MISS","BYPASS"]},"description":"BYPASS means a successful response could not be cached."},"X-Cache-Age":{"schema":{"type":"integer"},"description":"Cached result age in seconds."},"X-Request-Id":{"schema":{"type":"string"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}}},"400":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"401":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"403":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"413":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"415":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"422":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"429":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"502":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"503":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}},"504":{"description":"Request failed; inspect error.code and error.retryable.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retryable","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"request_id":{"type":"string"}}}}}}}}}}}}}