Guides
AI Agents Overview

AI Agents Overview

SuperScraper is built to be called by AI agents as well as by humans. The REST API, the structured output, the per-call credit rules and the machine-readable references all exist so an agent can decide what to call, what it will cost, and how much to trust the result. Hosted MCP is coming soon.

Why agents use SuperScraper

1. REST first

Call POST /v1/scrape, /v1/extract, /v1/search and the rest of /v1 with an x-api-key header (or Authorization: Bearer <key>). An agent can mint its own free-tier key with POST /v1/keys/provision, no sign-in needed. Hosted MCP is coming soon; see the MCP guide.

User: "What does this company do, and how do I reach them? northside-roasters.example"

Agent:
  → POST /v1/resolve  { "domain": "northside-roasters.example" }   → name, industry, match score
  → POST /v1/enrich   { "domain": "northside-roasters.example" }   → emails, phones, tech stack
  → answers with the fields, noting how the company was matched

2. Structured output with a completeness score

Scrape and extract results carry the same quality fields:

{
  "ok": true,
  "listing": {
    "name": "Northside Coffee Roasters",
    "phone": "+1 (503) 555-0142",
    "address": "2210 N Williams Ave, Portland, OR 97227",
    "website": "https://www.northside-roasters.example",
    "rating": 4.8,
    "_completeness": 0.94,
    "_extraction_method": "json-ld"
  },
  "metadata": { "fetchMethod": "plain", "latencyMs": 412 }
}

_completeness (0–1) and _extraction_method tell the agent how complete the data is and which layer read it, so it can decide whether to re-scrape, verify, or pass it through. /v1/scrape also reports which fetch tier served the page (cascade) and whether the content is partial.

3. Know the cost before you call

GET /v1/pricing is public and lists the credit cost of every endpoint and the per-request caps of every plan. Every billable response carries X-Credits-Consumed and, when available, X-Credits-Remaining. To enrich a list, POST /v1/enrich/estimate quotes the batch before POST /v1/enrich/batch spends anything.

4. Grounded answers

POST /v1/search with include_answer: true returns an answer only when every citation in it points at a returned result. Otherwise answer is null and answer_reason says why, so an agent can tell a cited answer from a missing one. See Search.

5. Machine-readable API discovery

  • GET /llms.txt: condensed API reference, no auth required. Fetch it once at the start of a session.
  • GET /llms-full.txt: full reference with example requests and responses.
  • GET /openapi.json: OpenAPI 3.x spec for SDK generation.
  • GET /agent-onboarding/SKILL.md: a one-file onboarding an agent can act on. See SKILL.md onboarding.
import httpx
 
# Ground the agent on the API at the start of the session
api_ref = httpx.get("https://api.superscraper.dev/llms.txt").text
# Prepend to system prompt or inject as retrieval context

See the llms.txt guide for details.

6. Sync calls for agent loops, jobs for large work

Scrape, extract, search, map, sync batch (up to 100 URLs, or your plan cap if lower), enrich, brand and resolve all answer in the same HTTP response, so the agent can keep reasoning in the same turn.

For larger work, POST /v1/crawl and POST /v1/batch with async: true return a jobId. Poll GET /v1/jobs/:id until status is "completed", "failed" or "cancelled", or pass a webhook URL to be told when the job finishes.

7. Structured error envelopes

Errors are machine-readable so the agent can act on them:

{
  "error": "`url` is required",
  "code": "missing_url",
  "fix_hint": "Include a `url` string in the request body.",
  "docs_url": "https://docs.superscraper.dev/scrape"
}

code is a stable value the agent can branch on. fix_hint is a short instruction the agent can act on or relay to the user. See Errors.

Agent patterns

Research a company

1. /v1/resolve → identity, industry, match score
2. /v1/brand   → logo, colors, socials
3. /v1/enrich  → emails, phones, tech stack, team

Build a dataset from a site

1. /v1/map     → enumerate the pages on a site
2. /v1/batch   → scrape the pages you need
3. /v1/extract with a schema → typed fields per page

Answer a question from the web

1. /v1/search with include_answer: true → cited answer + citations
2. /v1/scrape the cited URLs if the agent needs the full text

Find businesses by technology

1. /v1/graph/query → e.g. coffee roasters in Oregon using a given ecommerce platform
2. /v1/graph/business/:idOrDomain → one record

Quick reference: agent-friendly endpoints

EndpointSync?Returns
POST /v1/scrapeYesMarkdown + listing JSON
POST /v1/extractYesJSON matching your schema, or the free JSON-LD listing
POST /v1/searchYesResults + optional cited answer
POST /v1/mapYesURLs on a site
POST /v1/batchYes (up to 100 URLs) / jobMany pages at once
POST /v1/crawlNojobId → poll /v1/crawl/:id, pages at /v1/crawl/:id/results
POST /v1/parseYesPDF or DOCX → markdown, optional RAG chunks
POST /v1/enrichYesContacts and tech stack from a domain
POST /v1/resolveYesCompany profile with a match score
POST /v1/graph/queryYesBusinesses matching tech, industry or location
GET /v1/pricingYesCredit units and plan caps (no auth)
GET /llms.txtYesPlain-text API reference (no auth)

All endpoints accept Content-Type: application/json (parse also takes multipart uploads) and authenticate via the x-api-key header.

Getting started

  1. Get a free API key at app.superscraper.dev (opens in a new tab), or mint one with POST /v1/keys/provision.
  2. Call the REST API directly from your agent; see the API Reference. Hosted MCP is coming soon.
  3. The local MCP server and the Claude Code plugin are available on request; see the MCP guide and the Plugin guide.
  4. Fetch /llms.txt to ground your agent on the full API surface.