Skip to content

Quickstart

Markdown agents.txt

import { Steps, Aside } from ‘@astrojs/starlight/components’;

From zero to a working html scrape, then an analyse call. Use browser when the page needs JavaScript or interaction.

  1. Get an API key

    1. Sign up and confirm your email.
    2. Open API keys and click Generate key.
    3. Copy the plaintext sf_… value shown on creation.

    You can also call the API from the dashboard’s built-in Run scrape page (no key required — the browser session is bound to your account), but for anything outside the browser you need a bearer token.

  2. First scrape — html

    The action DSL maps each output key to a selector string: "selector@extractor" (CSS by default — no css= prefix needed).

    Terminal window
    curl -sS -X POST https://api.scrapesilo.com/scrape \
    -H "Authorization: Bearer sf_…" \
    -H "Content-Type: application/json" \
    -d '{
    "url": "https://scrapesilo.com/fixtures/article",
    "engine": "html",
    "actions": {
    "title": "h1",
    "body": "p",
    "cta": "a.sf-cta@href"
    }
    }'

    /scrape always returns an array (one item per URL):

    [
    {
    "url": "https://scrapesilo.com/fixtures/article",
    "data": {
    "title": "How to pin an article field",
    "body": "This lead is the body field. Select the first paragraph after the heading.",
    "cta": "https://scrapesilo.com/docs/quickstart"
    },
    "tookMs": 312,
    "executionId": "ex_…",
    "antibot": []
    }
    ]

    Open the /executions page in the dashboard to inspect the full request/result/error JSON for the run.

  3. Interpretation — analyse

    For outlines, summaries, or “is X present?” use POST /analyse (or the MCP analyse tool). That is a separate surface — scrape only runs an actions plan. Do not send query on /scrape.

    Terminal window
    curl -sS -X POST https://api.scrapesilo.com/analyse \
    -H "Authorization: Bearer sf_…" \
    -H "Content-Type: application/json" \
    -d '{
    "url": "https://scrapesilo.com/fixtures/prose",
    "query": "Outline the article sections and state the main claim in one sentence."
    }'
  4. Need JS or clicks? Use browser

    html is a plain HTTP fetch — no JavaScript. Switch to "engine": "browser" when the page is a SPA, needs clicks/fills, or fields come back empty. Same actions tree; 5 credits per URL. See Engines.

Every scrape spends credits from your plan’s monthly pool (the free tier starts with 1,000). Cost depends on the engine — html is 1 credit, analyse is 3, browser is 5.

ScrapeSilo API: https://api.scrapesilo.com
Auth: Authorization: Bearer $SCRAPESILO_API_KEY
Rules:
- POST /scrape extracts exact fields. Required: url, engine ("html" | "browser"), actions. No query field. CSS selectors, no css= prefix (e.g. h1@text). Response is always an array of { url, data, tookMs, executionId, antibot }.
- POST /analyse interprets a page (outline, summary, flags). Required: url, query. Not a CSS plan.
- Credits per URL: html 1, analyse 3, browser 5. Use browser only when the page needs JS or interaction.
curl -sS -X POST https://api.scrapesilo.com/scrape \
-H "Authorization: Bearer $SCRAPESILO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://scrapesilo.com/fixtures/article",
"engine": "html",
"actions": { "title": "h1", "body": "p", "cta": "a.sf-cta@href" }
}'
curl -sS -X POST https://api.scrapesilo.com/analyse \
-H "Authorization: Bearer $SCRAPESILO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://scrapesilo.com/fixtures/prose",
"query": "Outline the article sections and state the main claim in one sentence."
}'
  • Engines — pick HTML or Browser.
  • Actions DSL — full selector + attribute reference.
  • Pricing & quotas — credit costs, plans, and limits.
  • MCP — drive scrapes from Claude Code or another MCP client.