Firecrawl API Tutorial: Keys, Search, Scrape and Limits

• Tapovan

A keyless curl call to the Firecrawl API, made from our test network, returned HTTP 403: the IP address "looks like a VPN or proxy" and needs a key. This firecrawl tutorial covers the endpoints, key setup, Python and Node.js search and scrape code for an agent, and the limits that decide whether it keeps running.

What the Firecrawl API does

Firecrawl is a hosted API that turns web pages into text an agent or script can use. Web scraping for AI agents mostly comes down to clean text out of pages, and two endpoints do that work here:

  • POST https://api.firecrawl.dev/v2/search takes a query and returns results grouped by type, in data.web, data.news and data.images.
  • POST https://api.firecrawl.dev/v2/scrape takes a url and a formats list such as ["markdown", "html"]. The result comes back in data.markdown, with data.metadata beside it.

On the keyless tier, crawl, extract, map and batch scrape need a key. New to scraping? Read our web scraping for beginners post first.

Get a key and set it up

Keyless use and its limits

Keyless use is free but capped per IP address per day, and going over either daily cap returns HTTP 429. The rate-limits page says: "Sign up for a free API key to get 1,000 credits and higher rate limits at no cost." The GitHub README instead says 1,000 free credits a month with no key or signup. The rate-limits and billing pages do not say that, so this post follows them: the 1,000 credits come with a free key.

Create a Firecrawl API key

Create the key on the API keys page, which the Python and Node quickstarts link to. The old quickstart address, developer-guides/quickstart, returned 404 when we checked.

When no key is passed, the Python and Node clients read FIRECRAWL_API_KEY. In Windows PowerShell, this sets it for the current session (tested on PowerShell 5.1.26100.9818):

# this session only
$env:FIRECRAWL_API_KEY = "fc-YOUR-API-KEY"

The persistent form, setx, is untested here, so we leave it out. On macOS or Linux, this line uses the same variable name, also untested:

export FIRECRAWL_API_KEY=fc-YOUR-API-KEY

First call with curl

One POST to /v2/scrape with the key in a Bearer header is the simplest check. We ran it in Git Bash with curl 8.17.0. Set the variable to a real key first. Our keyless run sent no key:

curl -s -X POST "https://api.firecrawl.dev/v2/scrape" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -d '{"url": "https://example.com", "formats": ["markdown"]}'

The keyless request returned HTTP 403 with this body, shortened:

{"success":false,"error":"Unfortunately, your IP address looks like a VPN or proxy, so Firecrawl can't be used without an API key from here. ...","signup_url":"https://firecrawl.dev/k/7gpj1p0s4rmv"}

A fake key, Bearer fc-NOT-A-REAL-KEY, returned HTTP 401 with {"success":false,"error":"Unauthorized: Invalid token"}. A 401 means the key is missing, malformed or revoked, and it is not retryable. The 403 message says the request needs an API key from this network, so a key is the fix. We had no real key, so this post shows no success response.

Firecrawl Python: install firecrawl and scrape or search

Install with pip install firecrawl. On PyPI, firecrawl is version 4.57.0, uploaded 12 November 2026, and needs Python 3.8 or newer. The firecrawl-py repository is marked OLD in its README, and its FirecrawlApp examples are out of date.

pip install firecrawl
pip show firecrawl

We tested the install on Python 3.14.5 in a Windows virtual environment, and pip show reported 4.57.0. This script does one scrape and one search with the Firecrawl class:

# pip install firecrawl
from firecrawl import Firecrawl

app = Firecrawl()  # reads FIRECRAWL_API_KEY; with no key, the keyless tier applies
doc = app.scrape("https://example.com", formats=["markdown"])
print(doc.markdown)

results = app.search("firecrawl web scraping", limit=3)
for hit in results.web or []:
    print(hit.title, hit.url)

Without a key from our network, both calls raised WebsiteNotSupportedError with the VPN message. The attribute names were checked against a local mock, not the live API. The current quickstart calls search without await.

Node.js: install firecrawl and scrape or search

The Node quickstart asks for Node.js 22 or newer. The npm package's engines field says Node 18 or newer. We tested Node v24.15.0 with npm 11.12.1, and the npm latest tag was firecrawl 4.54.0.

npm install firecrawl
node -e "console.log(require('./node_modules/firecrawl/package.json').version)"

Save the file as .mjs, because the example uses top-level await:

// npm install firecrawl
import { Firecrawl } from 'firecrawl';

const app = new Firecrawl(); // reads FIRECRAWL_API_KEY
const doc = await app.scrape('https://example.com', { formats: ['markdown'] });
console.log(doc.markdown);

const results = await app.search('firecrawl web scraping', { limit: 3 });
for (const hit of results.web ?? []) console.log(hit.title, hit.url);

Without a key, scrape threw an SdkError with the same VPN message. With FIRECRAWL_API_KEY=fc-NOT-A-REAL-KEY set, new Firecrawl() threw SdkError: Unauthorized: Invalid token, so the variable was read. The search call was checked only against the mock.

Firecrawl search API: a search-then-scrape loop for an agent

This script searches, takes up to three hits, scrapes each as markdown and saves the text. The Python SDK does not retry 429. In the 4.57.0 source (http_client.py) it retries only on 502 and transport errors, so the loop backs off itself. Two search details matter: limit defaults to 10 with a maximum of 100 in the REST reference, and when sources lists more than one type, the limit applies to each type. The github category was removed, and a request that includes it returns HTTP 400. Use includeDomains: ["github.com"] or the developer category instead.

import hashlib
import os
import random
import sys
import time

from firecrawl import Firecrawl, RateLimitError

API_URL = os.environ.get("FIRECRAWL_API_URL", "https://api.firecrawl.dev")
app = Firecrawl(api_url=API_URL)  # reads FIRECRAWL_API_KEY from the environment when set


def with_backoff(call, label, attempts=5):
    for attempt in range(attempts):
        try:
            return call()
        except RateLimitError as err:
            delay = min(2 ** attempt, 30) + random.random()
            print(f"{label}: 429 ({err}); retrying in {delay:.1f}s")
            time.sleep(delay)
    raise RuntimeError(f"{label}: still rate limited after {attempts} attempts")


def main(query, limit=3):
    results = with_backoff(lambda: app.search(query, limit=limit), "search")
    hits = results.web or []
    if not hits:
        print(f"no web results for {query!r}")
        return 0
    os.makedirs("pages", exist_ok=True)
    for hit in hits:
        doc = with_backoff(lambda: app.scrape(hit.url, formats=["markdown"]), "scrape")
        if not doc.markdown:
            print(f"skip {hit.url}: no markdown returned")
            continue
        name = "pages/" + hashlib.sha1(hit.url.encode()).hexdigest()[:12] + ".md"
        with open(name, "w", encoding="utf-8") as f:
            f.write(f"<!-- {hit.url} -->\n{doc.markdown}\n")
        print(f"saved {hit.url} -> {name} ({len(doc.markdown)} chars)")
    return len(hits)


if __name__ == "__main__":
    sys.exit(0 if main(sys.argv[1] if len(sys.argv) > 1 else "firecrawl web scraping") else 0)

Tested against a local mock, not the live API. The mock returned the documented response shape and answered the first search with HTTP 429 and Retry-After: 1. Output:

search: 429 (Rate Limit Exceeded: Failed to search. Rate limit exceeded - No additional error details provided.); retrying in 1.6s
saved https://example.com/a -> pages/c4ed1c218d14.md (49 chars)
saved https://example.com/b -> pages/69a42cc26896.md (49 chars)

Only main() was run. The final sys.exit line always exits with status 0, so do not rely on the exit code. Set FIRECRAWL_API_URL to point the script at another base URL. If Python is new to you, read Python essentials for AI agents first.

Read the response and handle 429 and empty results

Error bodies are JSON with "success": false and a string error. Check the status code first, then the message:

What you seeWhat it meansWhat to do
HTTP 403, "looks like a VPN or proxy"A keyless call from a network that Firecrawl refuses without a key (seen from our network)Add a key, as the message says
HTTP 401, "Unauthorized: Invalid token"The key is missing, malformed or revokedCheck FIRECRAWL_API_KEY in the shell that runs the script. Not retryable
HTTP 402, "Payment Required: Insufficient credits"The credit balance is used upCheck the balance on the pricing and billing pages. The Free plan refreshes monthly
HTTP 429, "Rate limit exceeded" or "Concurrency limit reached"A per-minute limit or the concurrent-browser limit was hitWait for the Retry-After seconds when sent; otherwise back off, as the loop does
Empty scrape resultThe scrape returned no dataNot charged. The loop skips the page

Firecrawl pricing, credits and rate limits

The pricing page lists these monthly plans in USD, with annual prices in brackets:

PlanPrice per monthCredits per month
Free$01,000
Hobby$19 ($16)5,000
Standard$99 ($83)100,000
Growth$399 ($333)500,000
Scale$749 ($599)1,000,000
EnterpriseCustomCustom

The page shows no publication date. Its credit rules are marked "Effective September 4, 2026", and as the page states them:

  • A basic scrape, crawl or map call costs 1 credit per page.
  • Search costs 2 credits per 10 results. Search and scraping draw on one shared balance.
  • The JSON, Question and Highlight formats add 4 credits per page on scrape and crawl.
  • A scrape with no result is not charged. A page that returns an error status such as 403 or 404 is still returned and costs 1 credit.

Per-minute limits for the Free and Hobby plans:

LimitFreeHobby
/scrape per minute10100
/map per minute10100
/crawl per minute220
/search per minute10100
/agent per minute220
Concurrent browsers25

Standard allows 25 concurrent browsers, Growth 50, and Scale and Enterprise 100 or more. Limits apply per team, so every key on one team shares the same counters.

Firecrawl Local vs Firecrawl Cloud

Firecrawl Local, a Rust binary, was announced in a changelog entry dated 18 November 2026. On crates.io, firecrawl-local was at version 0.1.1 when we checked, under AGPL-3.0. We did not install it, because the test machine had no cargo. These are the README's steps, untested:

# untested: the README's steps, not run on our machine
cargo install firecrawl-local
firecrawl-local serve
curl -s http://localhost:3002/v2/scrape -H 'content-type: application/json' -d '{"url":"https://example.com","formats":["markdown"]}'

Per the README, serve exposes POST /v2/scrape and POST /v2/map on localhost, port 3002. /v2/search goes to Firecrawl Cloud, so search is not local. Crawl and batch jobs expire an hour after they start. The changelog's speed and memory figures are Firecrawl's own; we did not measure them.

Firecrawl alternatives: a comparison table

Firecrawl's compare hub is written by Firecrawl. Each cell below is the vendor's own claim. We did not run any of these services.

ToolHow you call it (vendor docs)Self-host or localFree tier (according to the vendor)
FirecrawlREST scrape and search endpoints (api.firecrawl.dev/v2), plus crawl, map and interactFirecrawl Local (Rust, untested here)1,000 credits a month with a free key
TavilyPOST https://api.tavily.com/search, key starts with tvly-See vendor page1,000 API credits a month
ExaPOST https://api.exa.ai/search with an x-api-key headerSee vendor pageSee vendor page
Crawl4AIOpen-source library under Apache-2.0Yes, self-hostedSee vendor page
Jina ReaderPut r.jina.ai/ in front of a URLSee vendor pageAnonymous use is the most rate-limited; an API key raises the quota

Vendor figures, not checked by us: Firecrawl's benchmark reports a 96% scrape success rate over 1,000 URLs (13 January 2026). Tavily says its credits cost $0.008 each pay-as-you-go. The two define a credit differently, so compare per use case. For firecrawl vs tavily, run both on your own pages. For another hosted search API, see our Cloudflare Web Search API tutorial.

When to use Firecrawl and when not to

Use it when you want markdown from arbitrary pages and search from one API, and you accept a hosted service that bills in credits. Skip it, or plan for a key from the start, if:

  • Your test or CI runs from a VPN or proxy. A keyless call can return 403 there.
  • You need keyless crawl or map. Those need a key.
  • Your loop runs at the Free plan's limit of 10 searches or scrapes a minute. The loop above backs off, but it will be slow.
  • The data cannot leave your machine. Local keeps scrape and map on localhost, but search goes to Cloud, and we have not tested Local.

FAQ

Does the Firecrawl API need an API key?

Not always. The search docs say the Bearer header is optional for REST search and raises limits. Our keyless calls from one test network were refused, so some networks need a key. Keyless access is capped per IP address per day, and crawl, extract, map and batch scrape need a key. A free key gives 1,000 credits a month.

How many credits does one scrape cost?

A basic scrape costs 1 credit per page. The JSON, Question and Highlight formats add 4 credits per page. Search costs 2 credits per 10 results. A scrape that returns no result is not charged.

Why do I get HTTP 429 from Firecrawl?

You hit a per-minute limit or the concurrent-browser limit. The response can include a Retry-After header in seconds. The Python SDK does not retry 429 on its own, so wait and retry in your code, as the loop above does.

Is firecrawl search synchronous in Python?

In the current SDK, yes. The Python quickstart calls app.search(...) and reads results.web with no await. Older examples show async calls, so follow the quickstart.

Sources and what we tested

  • Tested:pip install firecrawl on Python 3.14.5 (firecrawl 4.57.0); npm install firecrawl on Node v24.15.0 (firecrawl 4.54.0); curl 8.17.0 in Git Bash; the PowerShell session variable on 5.1.26100.9818.
  • Live calls from our network: keyless calls were refused with HTTP 403, and a fake key got HTTP 401. No successful live response is shown.
  • The search-and-scrape scripts ran against a local mock, not Firecrawl.
  • Not tested: the Local install and server, setx, the macOS and Linux export, and every alternative in the table.

Last updated: 2026-11-27; tested on Python 3.14.5 with firecrawl 4.57.0, Node v24.15.0 with firecrawl 4.54.0, PowerShell 5.1.26100.9818 and curl 8.17.0. Live API calls were refused from our network, and the loop was tested against a local mock.

Last updated: November 27, 2026
an "open and free" initiative. Powered by Blogger.