Skip to main content
In this quickstart you’ll scrape books.toscrape.com, a practice site built for scraping, and get the title and price of every book on the page as JSON. Prefer to click? Follow the dashboard quickstart instead.

1. Get an API key

Sign up with your email, Google or GitHub. New accounts get 300 free credits and no card is needed. This quickstart uses 5. Your first API key is created for you. Copy it from API Keys in the dashboard and store it in an environment variable:

2. Start a scrape

A scrape takes a few seconds to a minute, so it runs as a job. With curl you get the job’s ID straight away:
The SDKs wait for the job and return the finished result, so with an SDK you can skip to step 4. Every SDK works the same way; the tabs show Node.js and Python.

3. Get the result

Ask for the job every few seconds until status is completed:
While it runs, status is queued or active and progress.message says what it’s doing (“Processing content with AI…“).

4. Read the data

When it’s done, the answer is in result.content:
The list has all 20 books on the page, shortened here to three. data has the page itself as Markdown. This run cost 3 credits: 1 for the page and 2 for the AI that read it.

5. Fix the shape with a schema

The AI chose the field names above, and the prices came back as text. To get the same fields and types every time, add a JSON Schema:
result.content now has exactly those fields, with a real number for the price:
rating is null because that page shows its stars as an image, not as text. Spidra returns null for anything it can’t find rather than guessing. This run cost 2 credits.

If something goes wrong

Errors lists every code.

Next

Core concepts

Jobs, result shapes, credits and what’s free.

Scrape

Every option for scraping pages.

Crawl

Get every page of a site that matches a description.

Templates

Ready-made jobs for Google Maps, Amazon, LinkedIn and more.