AI Agents Overview
SuperScraper is built to be called by AI agents as well as by humans. The REST API, the structured output format, the cost-preview flow, and the connector registry all exist so an agent can decide what to call, what it will cost, and how much to trust the result. Hosted MCP is not available.
Why agents use SuperScraper
1. REST first
Call POST /v1/scrape, /v1/extract, /v1/search, or /v1/chat with a Bearer key. Hosted MCP is not available. Local stdio MCP is developer-only (source checkout). See the MCP guide.
User: "Find 30 HVAC contractors in Phoenix with phone numbers."
Claude:
→ calls google_maps_search(query="HVAC Phoenix AZ", maxResults=30)
→ receives structured rows: name, address, phone, website, rating
→ presents a markdown tableThe list_tools meta-tool lets Claude discover the full connector catalog on demand without blowing up its context budget, it asks once, gets the slugs and schemas, then calls only what it needs.
2. Structured output everywhere
Every endpoint returns a consistent envelope:
{
"ok": true,
"listing": {
"name": "Apex Roofing",
"phone": "+1 (512) 555-0100",
"address": "1234 Main St, Austin, TX 78701",
"website": "https://apexroofing.com",
"rating": 4.8,
"_confidence": 0.94,
"_extraction_method": "json-ld",
"_provenance": "https://www.yelp.com/biz/apex-roofing-austin"
},
"metadata": { "fetchMethod": "plain", "latencyMs": 412 }
}_confidence (0–1), _extraction_method, and _provenance tell the agent how much to trust the data and where it came from, so it can decide whether to re-scrape, verify, or pass through.
3. Cost-preview before commitment
For large pulls, the agent can get a price estimate before spending budget:
POST /v1/preview
{ "connectorId": "google-maps", "query": "roofing Austin TX", "maxResults": 500 }Response:
{
"estimatedRows": 487,
"estimatedCostUsd": 0.97,
"cogsUsd": 0.31,
"sample": [ ...first 5 rows... ],
"jobId": "job_abc123"
}The agent can show the user the sample and price before calling /v1/pull with the jobId to execute.
4. Chat-native entry point
POST /v1/chat accepts natural language and routes it automatically:
{ "message": "Find 50 plumbers in Austin with websites", "conversationId": "sess_xyz" }The API:
- Classifies intent (lead search vs scrape vs research)
- Matches a curated connector or falls back to Playwright + LLM
- Returns a free preview (sample rows + cost)
- Holds the
jobIdfor a follow-up/v1/pull
This lets an agent accept a plain English request from a user and handle the routing without any custom logic. Subsequent messages in the same conversationId can refine (kind: "refine") without re-scraping, the conversation is stateful.
5. Connectors-as-tools model
The connector registry is the catalog of things the agent can pull. Each connector has:
id, stable identifier (google-maps,mercado-libre, ...)match(input), returnstrueif this connector handles the inputpreview(params), page-1 sample + estimated costrun(params), full pull, returns rows + CSVschema, Zod schema of output fields (name, phone, address, website, ...)pricePerRecordUsd, what the agent will pay per row
GET /v1/connectorsReturns the full catalog as JSON. Every connector is available via REST and the /v1/chat router. Hosted MCP is not available.
6. Machine-readable API discovery
GET /llms.txt, condensed ~150-line API reference, no auth required. Fetch once at agent session start to ground the agent on all endpoints, parameters, and pricing anchors.GET /llms-full.txt, full reference with example requests and responses.GET /openapi.json, OpenAPI 3.x spec for SDK generation.
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 contextSee the llms.txt guide for details.
7. Sync execution for agent loops
/v1/pull with a small maxResults (under ~200 rows) returns synchronously in a single HTTP response, no polling, no job IDs. The agent gets rows immediately and can continue reasoning in the same turn.
For larger pulls, the async /v1/crawl route returns a jobId and the agent polls GET /v1/jobs/:id. The response includes status: "complete" | "running" | "failed" and a progress percentage.
8. Structured error envelopes
Errors are machine-readable so the agent can act on them:
{
"error": {
"message": "Google Maps returned no results for this query.",
"code": "GMAPS_NO_RESULTS",
"suggested_fix": "Try a broader query or a different location.",
"request_id": "gmap_lx3f8a2b"
}
}code is a stable enum value the agent can branch on. suggested_fix is a natural-language hint the agent can relay to the user or act on directly.
Agent patterns
Lead generation loop
1. /v1/chat → "Find HVAC contractors in Phoenix" → preview + jobId
2. /v1/pull → jobId → rows (name, phone, address, website)
3. /v1/batch → scrape each website → listing data (email, tech stack)
4. /v1/enrich/website → enrich top 10 by rating → team contacts
5. Present CSV to userResearch + enrich
1. /v1/enrich/website → emails, phones, tech stack, team from a domain
2. /v1/extract with schema → typed fields with _confidence + _provenanceCompetitive intelligence
1. /v1/map → enumerate all pages on a competitor's site
2. /v1/batch → scrape pricing/features/blog pages
3. /v1/extract --schema → pull structured pricing table
4. Compare against your own productMonitor for new listings
POST /v1/feeds
{
"connectorId": "google-maps",
"params": { "query": "new roofing contractors Austin TX" },
"schedule": "0 9 * * 1", // every Monday at 9am
"webhookUrl": "https://your-app.com/webhook"
}The feed worker re-runs the pull on schedule, deduplicates against the last run, and delivers only new rows to the webhook. The agent subscribes once and receives a stream of fresh leads.
Quick reference, agent-friendly endpoints
| Endpoint | Sync? | Returns |
|---|---|---|
POST /v1/chat | Yes | Intent classification + preview + jobId |
POST /v1/preview | Yes | Cost estimate + sample rows + jobId |
POST /v1/pull | Yes (small) | Structured rows + CSV |
POST /v1/scrape | Yes | Markdown + listing JSON |
POST /v1/extract | Yes | Arbitrary JSON matching your schema |
POST /v1/batch | Yes | Up to 100 URLs concurrently |
POST /v1/crawl | No | jobId → poll /v1/jobs/:id |
GET /v1/connectors | Yes | Connector catalog as JSON |
POST /v1/feeds | Yes | Creates a scheduled monitor |
GET /llms.txt | Yes | Plain-text API reference (no auth) |
All endpoints accept Content-Type: application/json and authenticate via x-api-key header.
Getting started
- Get a free API key at app.superscraper.dev (opens in a new tab).
- Call the REST API directly from your agent, see the API Reference. Hosted MCP is not available.
- Local stdio MCP is developer-only; see the MCP guide.
- Optional Claude Code plugin from a source checkout, see the Plugin guide.
- Fetch
/llms.txtto ground your agent on the full API surface.