Skip to content
stolosio

Complete pages, or it doesn't count

Stolosio captures one page per call and checks that it is complete before returning it. A complete page counts toward your usage. An empty shell, a refusal or a half-loaded page comes back as a named failure and doesn't.

What counts

Quickstart

Create an API key under API keys in your pilot account's dashboard. It is shown once; keep it in STOLOSIO_API_KEY. Then send a URL:

POST /v1/capture
curl https://api.stolosio.dev/v1/capture \
  -H "Authorization: Bearer $STOLOSIO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://quotes.toscrape.com/js/"}' \
  -o capture.json

Read outcome first: a 200 can carry a failed capture. On captured, decode document.body_base64:

jq
jq '{outcome, usage, completeness: .completeness.status, failure: .failure.code}' capture.json

# captured: the page itself
jq -r '.document.body_base64' capture.json | base64 -d > page.html
quotes.toscrape.com/js/ · captured
{
  "outcome": "captured",
  "usage": { "captures": 1, "challenge_solves": 0 },
  "completeness": "complete",
  "failure": null
}

On failed, act on failure.code. Retry only when failure.transient is true: after failure.retry_after_seconds when it's set, otherwise after 5 s, doubling each time up to 5 minutes. usage says what the request used from your allowance; a failure uses nothing:

a host that doesn't exist · failed
{
  "outcome": "failed",
  "usage": { "captures": 0, "challenge_solves": 0 },
  "completeness": null,
  "failure": "host_not_found"
}

A request without a valid key gets 401 unauthorized; once the account's captures are used, 402 budget_exhausted. An account runs one capture at a time: a request sent while another is running gets 429 account_concurrency_exceeded and uses nothing; wait Retry-After and send it again. The API reference lists every field, status and failure code.

Challenge solving

Solving is off for every account. Once the account owner turns it on in the dashboard, ask for it per request with "resolve_bot_challenges": true. Without the account setting, or once its solves are used, the capture still runs without solving and challenge_resolution.skipped_reason says why. A page still behind its challenge then fails as bot_challenge.

More