RunPuffin

Reference

Every request authenticates with an API key in the Authorization: Bearer header. Tasks run asynchronously: queue, poll, then read the result.

REST API

MethodPathDescription
POST/v1/extractQueue an extraction. Body is the task input. Returns 202, or 200 if deduplicated.
POST/v1/tasksQueue a task with an explicit kind: navigate or extract.
GET/v1/tasksList your tasks, newest first. Query: limit (1–100), before (ISO timestamp).
GET/v1/tasks/:idTask status, attempts and failure details.
GET/v1/tasks/:id/resultResult of a finished task. 409 with Retry-After while it is still running.
GET/v1/tasks/:id/eventsEvent trail. Query: after (event id), limit (1–200).
POST/v1/tasks/:id/cancelRequest cancellation of a queued or running task.
GET/v1/usageTask count, browser time and limits for the current period.
GET/v1/healthPublic. Database reachability, worker heartbeat and queue depth.
Task input
{
  "url": "https://example.com/pricing",
  "allowed_domains": ["example.com"],
  "fields": {
    "plan_names": { "selector": ".plan h3", "all": true },
    "cta_link":   { "selector": "a.cta", "attr": "href" }
  },
  "output_schema": {
    "type": "object",
    "required": ["plan_names"],
    "properties": { "plan_names": { "type": "array", "items": { "type": "string" } } }
  }
}
Polling
# Poll until the task is terminal
curl https://runpuffin.com/v1/tasks/$TASK_ID \
  -H "Authorization: Bearer $RUNPUFFIN_API_KEY"

# Then read the result
curl https://runpuffin.com/v1/tasks/$TASK_ID/result \
  -H "Authorization: Bearer $RUNPUFFIN_API_KEY"

Errors

Errors share one shape. A task owned by another organization returns 404, never 403. Blocked targets finish with status blocked and a POLICY_* failure code.

Error body
{
  "error": { "code": "not_found", "message": "Task not found." }
}

MCP server

Streamable HTTP at /mcp, stateless, POST only. It uses the same API key and queue as the REST API.