API reference
All requests go to https://api.sudofetch.com with Authorization: Bearer <key>.
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. |
Submitting a scrape
| Field | Type | Default | Notes |
|---|---|---|---|
url | string | — | Public http or https URL. |
format | markdown · html · text | markdown | HTML output is a minimal document with title and description. |
mode | auto · basic · stealth | auto | Which levels the job may use. |
max_credits | integer | 1 (basic, trial) or 15 | Caps the charge and the transfer each attempt may use. |
timeout_ms | integer ≤ 90000 | 30000 | Total execution budget across all levels. |
wait_ms | integer ≤ 60000 | 30000 | How long the request itself waits before returning 202. |
wait_for | CSS selector or milliseconds | — | Extra readiness condition before capture. |
block_assets | boolean | true | Skip images, fonts and media to save transfer. |
The job object
| Field | Meaning |
|---|---|
status | queued, running, succeeded, failed or canceled. |
error | Why a job failed; see errors. |
content, format, metadata | The extracted page and its title, description, language and canonical URL. |
stats.mode_used | The level that succeeded: direct, residential or premium. |
stats.attempts | Browser attempts made, across levels. |
credits.charged | What the job cost; 0 for anything but success. |
credits.billable_bytes | The transfer the charge was based on. |