Base URL
https://api.scrapx.io/Get your API key from app.scrapx.io → Settings → API.
Pass your API key in the x-api-key header. No Workspace ID needed.
curl -X POST https://api.scrapx.io/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"agentTask": { ... }
}'Requests are counted per workspace per calendar day (UTC). The limit is configured in your workspace settings (maxAPIRequest, default 1000).
| Response Header | Description |
|---|---|
| x-api-ratelimit-limit | Max requests per day |
| x-api-ratelimit-remaining | Requests remaining today |
| x-api-ratelimit-reset | Unix timestamp of next midnight UTC |
When the limit is exceeded the API returns 429 Too Many Requests.
Send a plain-text prompt. The AI agent launches a real browser, renders JavaScript, and returns a screenshot, raw HTML, or a data extract. No URL field, no credentials — just describe what you need.
| Field | Type | Description |
|---|---|---|
| agentTask.goal | string | Required. Plain-language task — include the URL in your prompt, e.g. "Go to shop.example.com and extract all product names and prices" |
| agentTask.maxSteps | number | Max browser actions (default 10) |
| agentTask.output | string | ai_extract | text | html | markdown | screenshot |
| agentTask.url | string | Optional starting URL. Alternatively include the URL directly in goal |
| agentTask.credentials | object | Key/value pairs for login fields, e.g. {"username": "...", "password": "..."}. The agent fills in matching fields automatically |
curl -X POST https://api.scrapx.io/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"agentTask": {
"goal": "Go to shop.example.com/products and extract all product names and prices"
}
}'curl -X POST https://api.scrapx.io/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"agentTask": {
"goal": "Go to dashboard.example.com, wait for the charts to load, and take a screenshot",
"output": "screenshot"
}
}'Define exact browser steps. No AI per-step cost. Perfect for stable, well-known page structures.
| Action | Fields | Description |
|---|---|---|
| navigate | url | Go to URL |
| click | selector | Click element (CSS selector or visible text) |
| type | selector, value | Type text into input |
| wait | ms | Wait milliseconds |
| extract | selector, multiple?, attribute?, as? | Extract text or attribute from element(s). as sets the key in the result |
| screenshot | as? | Full-page screenshot — returns an S3 URL (30-day TTL) |
| scroll | direction?, amount? | Scroll up or down by px |
| evaluate | expression, as? | Run custom JS in page context |
json (default) — returns all extract results as an object · text / html / markdown — final page content · screenshot — last screenshot taken, returned as an S3 URL (30-day TTL)
curl -X POST https://api.scrapx.io/ \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"commandTask": {
"url": "https://example.com",
"steps": [
{ "action": "type", "selector": "input[name=q]", "value": "scrapx" },
{ "action": "wait", "ms": 1500 },
{ "action": "extract", "selector": "h3.result-title", "multiple": true, "as": "titles" },
{ "action": "extract", "selector": ".price", "multiple": true, "as": "prices" },
{ "action": "screenshot", "as": "final" }
],
"returnType": "json"
}
}'{
"requestId": "uuid",
"output": {
"status": "success",
"steps": 4,
"result": { "data": "Product A: $12.99, Product B: $8.49", "format": "ai_extract" },
"usage": { "promptTokens": 4200, "completionTokens": 80, "totalTokens": 4280, "estimatedCostUsd": 0.0011 },
"sessionUrl": "https://...s3.amazonaws.com/.../response.json",
"videoUrl": "https://...s3.amazonaws.com/.../agent-session.webm"
}
}{
"requestId": "uuid",
"output": {
"status": "success",
"steps": 2,
"result": { "data": "https://...s3.amazonaws.com/.../screenshot.png", "format": "screenshot" },
"usage": { "promptTokens": 3100, "completionTokens": 42, "totalTokens": 3142, "estimatedCostUsd": 0.0008 },
"sessionUrl": "https://...s3.amazonaws.com/.../response.json",
"videoUrl": "https://...s3.amazonaws.com/.../agent-session.webm"
}
}{
"requestId": "uuid",
"output": {
"status": "success",
"steps": 3,
"extractions": {
"titles": ["Product A", "Product B"],
"prices": ["$12.99", "$8.49"],
"final": "https://...s3.amazonaws.com/.../screenshot-0.png"
},
"returnType": "json",
"sessionUrl": "https://...s3.amazonaws.com/.../response.json"
}
}{ "error": "Invalid API key" }
{ "error": "Rate limit exceeded", "limit": 1000, "used": 1001, "reset": 1716681600 }
{ "error": "Missing agentTask or commandTask in request body" }| Header | Description |
|---|---|
| x-api-request-id | Unique ID for this request (use for support) |
| x-api-workspace-id | Workspace ID used |
| x-api-ratelimit-limit | Daily request limit |
| x-api-ratelimit-remaining | Remaining requests today |
| x-api-ratelimit-reset | Unix timestamp of next reset (midnight UTC) |
| x-api-version | API version |
| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid body |
| 401 | Unauthorized — missing or invalid API key |
| 429 | Rate limit exceeded — check x-api-ratelimit-reset |
| 500 | Internal error — task execution failed |
Check today's usage without executing a task.
GET https://api.scrapx.io/usage
x-api-key: YOUR_API_KEY
// Response
{
"limit": 1000,
"used": 47,
"remaining": 953,
"reset": 1716681600
}