Skip to main content

Command line web scraping: 100 pages in about 3 seconds

Three Spider CLI runs each crawled 100 FastAPI docs pages to markdown in about 3 seconds. Install it, add a key, then pipe the JSON to jq or write a WARC file.

Updated 6 min read

Three runs of one Spider CLI command on November 17, 2026 each crawled 100 pages of the FastAPI docs to markdown, in 2.876, 2.964 and 3.018 seconds. Every page came back as a 200.

Each run sent its requests through Spider’s proxy with an API key, from one machine, and printed one JSON object per page with the markdown in its content field:

spider -u https://fastapi.tiangolo.com/ -r --limit 100 --spider-cloud-mode proxy scrape > fastapi.json
RunStarted, UTCPagesStatus 200Seconds
116:10:481001002.876
216:11:021001002.964
316:11:051001003.018

Without a key the CLI crawls from your own machine, and the time depends on your connection.

The rest of this page covers installing spider_cli 2.52.3, saving a key, checking the JSON with jq and writing a WARC archive. The web scraping guide covers the method in general, and web scraping at scale measures crawl speed and cost per page through the API.

How do I install the Spider CLI?

With a Rust toolchain on your machine:

cargo install spider_cli
spider --version

On the machine that ran every command on this page, the version check printed:

spider_cli 2.52.3

The runs used 2.52.3 with the default features. cargo install spider_cli gets the newest release, which crates.io listed as 2.53.9 on November 17, 2026. cargo install spider_cli --version 2.52.3 gets the one measured here.

On Linux, the CLI’s README lists OpenSSL and pkg-config as build dependencies. The openssl crate docs give the packages for Debian and Ubuntu:

sudo apt-get install pkg-config libssl-dev

How do I add an API key?

spider authenticate --paste

The CLI prints Enter your Spider Cloud API key:, reads one line, and then prints API key saved to with the path, ~/.spider/credentials in your home directory. You can also pass the key as an argument with spider authenticate "$SPIDER_CLOUD_API_KEY". Later commands read it from that file.

The CLI looks for a key in this order:

  1. The --spider-cloud-key flag on the command
  2. The SPIDER_CLOUD_API_KEY environment variable
  3. The file that spider authenticate saved

It is the same key the Spider API takes. With no key at all, the CLI crawls from your machine on its own.

What does proxy mode do?

With an API key, --spider-cloud-mode proxy sends every request the crawl makes through Spider’s proxy, with the key as the login. The scrape and WARC commands on this page both pass it.

I checked that against a test server on my own machine. With the flag and a placeholder key, the CLI sent its request to Spider’s proxy, which refused the key with a 407. The test server logged no request at all, robots.txt included.

Spider bills proxy traffic by bandwidth. The proxy reference lists the rate for each proxy type, and the pricing guide explains the bill.

What does the output look like?

scrape prints one JSON object per page. This is the first object from run 1, with the markdown cut short:

{
  "content": "FastAPI - FastAPI\n[\nSkip to content\n](#fastapi)\n...",
  "headers": null,
  "links": null,
  "status_code": 200,
  "url": "https://fastapi.tiangolo.com/"
}

The objects follow one another across many lines, and jq reads them as a stream. These four lines check a crawl:

jq -r '.status_code' fastapi.json | sort | uniq -c
jq -s 'length' fastapi.json
jq -r '.url' fastapi.json | head -3
jq -r 'select(.status_code == 200) | .content' fastapi.json | wc -c

What they printed for run 1, on a Mac:

 100 200
100
https://fastapi.tiangolo.com/
https://fastapi.tiangolo.com/deployment/server-workers/
https://fastapi.tiangolo.com/reference/templating/
 1929309

That is 100 pages, all 200, and 1,929,309 bytes of markdown. scrape -o adds each page’s links to its object, and scrape --output-html puts the raw HTML in content in place of markdown.

How do I save a crawl as a WARC file?

Add -W and a file name. The CLI writes every page it fetches to a WARC 1.1 archive:

spider -u https://fastapi.tiangolo.com/ -r --limit 5 --spider-cloud-mode proxy -W fastapi.warc crawl -o
https://fastapi.tiangolo.com/
https://fastapi.tiangolo.com/zh-hant/
https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/
https://fastapi.tiangolo.com/advanced/custom-response/
https://fastapi.tiangolo.com/pt/

It finished in 2.164 seconds. The file came to 896,340 bytes, with one warcinfo record and five response records, one per page. This is how it starts:

WARC/1.1
WARC-Type: warcinfo
WARC-Record-ID: <urn:uuid:...>
WARC-Date: 2026-11-17T16:22:30Z
Content-Type: application/warc-fields
Content-Length: 55

software: spider/2.52.3
format: WARC File Format 1.1

WARC/1.1
WARC-Type: response
WARC-Record-ID: <urn:uuid:...>
WARC-Date: 2026-11-17T16:22:31Z
WARC-Target-URI: https://fastapi.tiangolo.com/
Content-Type: application/http; msgtype=response
Content-Length: 156152

HTTP/1.1 200 OK

Each of the five response records holds the status line, the response headers and the page’s HTML, so you can parse the crawl again later without another fetch. The file holds the site’s responses and not your key. I searched it for the key and for an authorization header, and found neither.

Which flags control the crawl?

All of these go before the subcommand, the way -r and --limit do in the commands above.

FlagWhat it does
--limit 100Stop after 100 pages
-d 3Limit the crawl depth to 3
-B "*,100,/blog/,10"Budget by path: 100 pages in all, at most 10 under /blog/
--blacklist-url "/admin,/login"Skip pages that match, as a comma-separated list
-rRespect robots.txt. Off unless you pass it.
-D 500Wait 500 milliseconds between requests
-sFollow subdomains. Placed after crawl, -s means --sync instead, one page at a time.
-E docs.example.comGroup another domain into the same crawl
-a "my-crawler/1.0"Set the User-Agent
-p http://user:pass@proxy.example.com:8080Send requests through your own proxy
--headlessRender pages in a browser. Needs a build with the chrome feature.
--chrome-connection-url ws://127.0.0.1:9222Connect to a Chrome you already run
-W site.warcWrite every page to a WARC 1.1 file
--return-format textPick the output format

Of the flags in this table, the runs on this page used --limit and -r, and the WARC run added -W. Every run also passed -u and --spider-cloud-mode proxy, and the WARC run passed -o after crawl. The other rows come from the help text of 2.52.3. When a browser renders the page, --wait-for-selector makes the CLI wait up to 60 seconds for a CSS selector to appear.

Which output formats can it write?

You wantRun
Markdown for each pagescrape, which returns markdown by default
Plain text, CommonMark or XML--return-format text, commonmark or xml
The raw HTMLscrape --output-html
Each page’s links as wellscrape -o
Only the list of URLs crawledcrawl -o
HTML files on diskdownload -t ./pages
A WARC archive of the crawl-W site.warc

How were the runs done?

All runs were on November 17, 2026, with spider_cli 2.52.3 on one machine. Seconds are the wall time of the whole command, from start to exit. Each of the three scrape runs exited with code 0 and returned 100 objects, all with status_code 200, for 100 distinct URLs.

--limit caps the count, and the three runs did not return the same 100 pages. 35 URLs were in all three, and 157 distinct URLs came back across the three.

The WARC run started at 16:22:30 UTC with --limit 5 and exited with code 0. The proxy check ran the same day, against a test server on my own machine.

The CLI is built on spider, the open source crawler behind the Spider API, under the MIT license and on GitHub since 2018.

Run it on a site you work with

Create an API key, save it with spider authenticate --paste, and run the first command on this page against a site you work with.

Frequently asked questions

How do I scrape a website from the command line?

Install the Spider CLI with cargo install spider_cli, save an API key with spider authenticate --paste, then run spider -u with the site's URL, -r, --limit 100, --spider-cloud-mode proxy and the scrape command. Each page prints as a JSON object with the markdown in its content field. On November 17, 2026 that command crawled 100 pages of the FastAPI docs in about 3 seconds, in each of three runs.

Can the Spider CLI output markdown?

Yes. In version 2.52.3 the scrape command returns markdown by default. The --return-format flag switches to plain text, CommonMark or XML, and scrape --output-html returns the raw HTML instead.

Can the Spider CLI save a crawl as a WARC file?

Yes. Pass -W with a file name and the CLI writes every page it fetches to a WARC 1.1 archive. A five-page crawl of the FastAPI docs wrote an 896,340-byte file with one warcinfo record and five response records.

Does the Spider CLI respect robots.txt?

Only when you pass -r, which is off by default. Every run on this page passed it.

Where does the Spider CLI keep the API key?

spider authenticate saves it to ~/.spider/credentials in your home directory. The CLI checks the --spider-cloud-key flag first, then the SPIDER_CLOUD_API_KEY environment variable, then that file.

Is the Spider CLI open source?

Yes. It lives in the spider repository on GitHub under the MIT license and ships on crates.io as spider_cli.

Sources

  1. spider_cli on crates.io, 2.53.9 listed as newest on 2026-11-17
  2. spider_cli source and README on GitHub (MIT)
  3. openssl crate docs, Debian and Ubuntu build packages
  4. Spider proxy mode reference
  5. Spider pricing guide
  6. Spider blog, crawl speed and cost per 1,000 pages, measured 2026-11-17

Keep reading

Run this on a page you care about

The playground sends the request this page describes and shows you the response. Keyless runs work without an account and are rate limited.