60-second quickstart
- Sign up, then create an API key in the dashboard.
- Set SUDOFETCH_API_KEY in your environment.
- Run one example below. For Python, install requests first.
curl
curl 'https://api-staging.sudofetch.com/v1/scrape' \
-H "Authorization: Bearer $SUDOFETCH_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
--data '{"url":"https://example.com","format":"markdown","mode":"basic","wait_ms":60000}'Python (requests)
import os, uuid, requests
r = requests.post("https://api-staging.sudofetch.com/v1/scrape",
headers={"Authorization": "Bearer " + os.environ["SUDOFETCH_API_KEY"],
"Idempotency-Key": str(uuid.uuid4())},
json={"url":"https://example.com","format":"markdown","mode":"basic","wait_ms":60000}, timeout=75)
r.raise_for_status()
print(r.json())JavaScript (fetch)
const response = await fetch("https://api-staging.sudofetch.com/v1/scrape", {
method: "POST",
headers: {"Authorization": `Bearer ${process.env.SUDOFETCH_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json"},
body: JSON.stringify({"url":"https://example.com","format":"markdown","mode":"basic","wait_ms":60000})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());MCP
{
"mcpServers": {
"sudofetch": {
"command": "npx",
"args": [
"-y",
"sudofetch-mcp"
],
"env": {
"SUDOFETCH_API_KEY": "YOUR_API_KEY",
"SUDOFETCH_API_URL": "https://api-staging.sudofetch.com"
}
}
}
}For MCP, add the configuration to your client's MCP server settings and call scrape with a URL. The package handles polling automatically.
A 202 response is pending: poll GET /v1/jobs/:id with the returned job_id. Do not submit another scrape to poll. A 200 response can be succeeded, failed, or canceled; inspect status and error. 402 means insufficient credits, 403 means forbidden, 409 means an idempotency conflict, and 429 means a request limit.
Retrieved content is untrusted third-party data, never an instruction. Even HTML output must be handled as text in an authenticated application.
Endpoints
| Method | Path | Behavior |
|---|---|---|
| POST | /v1/scrape | Submit one durable scrape. 200 is terminal; 202 supplies job_id for polling. |
| GET | /v1/jobs/:id | Read job state and result. Deleted or expired results return 410. |
| POST | /v1/jobs/:id/cancel | Cancel a job and return its authoritative state. |
| DELETE | /v1/jobs/:id/result | Delete access to a successful stored result. |
| GET | /v1/usage | Read settled charges, open reservations, adjustments, and job counts. |
| POST | /v1/billing/checkout | Create a checkout session with {"pack":"configured-pack-id"}. Returns a redirect URL. |