Skip to main content
You have a list of pages with the same kind of data on each, and you want one CSV row per page. This guide uses Batch scrape with a schema, so every row has the same columns, and writes the CSV in Python. You need Python 3.9+, pip install spidra, and your API key in SPIDRA_API_KEY.

1. Describe the columns as a schema

The schema’s properties become your CSV columns. Make anything that may be missing nullable:

2. Scrape the URLs and write the CSV

batch_scrape() sends up to 50 URLs and waits for all of them. Each item has its own status, so a page that fails doesn’t stop the others:
Running it prints the page that doesn’t exist and the totals:
And books.csv:
Each book page cost 2 credits (1 for the page, 1 for the AI). The page that doesn’t exist cost nothing.

3. More than 50 URLs

A batch takes up to 50 URLs. Send longer lists in chunks of 50 and append to the same file:
You can send up to 20 batches a minute.

If something fails

  • A page failed. Its error says why, and it wasn’t charged. Handle failed pages and retries shows how to retry just the failed items.
  • A column is empty. The value isn’t in the page’s text. Check the page, then reword the prompt or the field name.
  • The site blocks you. Add use_proxy=True and proxy_country="us" (or the site’s country) to batch_scrape().

Variations