Firecrawl Turn Websites Into LLM Ready Data: A Step-by-Step Tutorial

Firecrawl turns websites into LLM-ready data. This tutorial covers setup, scraping, full-site crawls, JSON extraction and credit pricing in six steps.

By Galactic News Editorial · Published 2026-11-24T17:07:17+00:00 · Updated 2026-11-24T17:07:17+00:00

Firecrawl turn websites into LLM ready data tutorial

Firecrawl Turn Websites Into LLM Ready Data: A Step-by-Step Tutorial

Firecrawl turns websites into LLM-ready data. Give it a URL and it returns clean markdown or structured JSON. It renders JavaScript, follows sitemaps and respects robots.txt. This tutorial walks through the setup, a first scrape, a full-site crawl, structured extraction and the pricing. Each step builds on the last. By the end you will have a working pipeline.

Firecrawl Turn Websites Into LLM Ready Data: What You Get

Raw HTML is a poor input for a language model. It carries navigation, scripts, ads and layout markup. Firecrawl strips all of that. What comes back is the page content as markdown, plus metadata such as the title and the source URL. The model reads the content, not the chrome. That is the whole product idea in one sentence.

Firecrawl has four endpoints. Scrape handles one page. Crawl handles a whole site. Map lists the URLs on a site. Search runs a web search and returns results. Extract pulls structured fields from pages. Most pipelines use scrape and crawl. Map is useful for checking what a site contains before you commit credits. Search is useful for discovery.

Step 1: Get an API Key

Create an account at firecrawl.dev. The free tier gives 1,000 credits every month, refreshed monthly, with no credit card required. Open the dashboard and copy your API key. Keep it in an environment variable, not in your code. Set FIRECRAWL_API_KEY in your shell or in a secrets file. The key is a bearer token. Every request sends it in the Authorization header.

Step 2: Install the SDK

Install the SDK for your language. For Python, run pip install firecrawl-py. For JavaScript, run npm install @mendable/firecrawl-js. The SDK wraps the API and handles polling for you. You can also call the API directly with curl. The base URL is https://api.firecrawl.dev. The scrape endpoint is POST /v2/scrape. The crawl endpoint is POST /v2/crawl.

Create the client with your key. In Python, that is Firecrawl(api_key=os.environ["FIRECRAWL_API_KEY"]). In JavaScript, it is new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY }). Test the client with a single scrape before you build anything else. A failed key shows up here, not halfway through a crawl.

Step 3: Scrape One Page

Call scrape with a URL and a formats list. The default format is markdown. The call returns the page content as clean markdown, plus the page title, description and links. A basic scrape costs 1 credit per page. The JSON format adds 4 credits per page. Keep the first call simple. Ask for markdown only.

Check the output before you scale. Open the returned markdown and read it. Look for missing content. Pages that load data with JavaScript still return their full content, because Firecrawl renders JavaScript by default. Pages behind a login will fail. Pages that block bots may return an error page. The scrape result tells you the status. Fix the problem on one page before you crawl a thousand.

Step 4: Crawl a Whole Site

Call POST /v2/crawl with a starting URL. Firecrawl discovers pages through the sitemap and the links on each page. It renders JavaScript on every page. It follows robots.txt by default. The crawl runs asynchronously. The call returns a job ID. Poll GET /v2/crawl/{id} for the status, or use the SDK's crawl method, which waits and returns the full response. Webhooks and WebSocket watching are also available for live progress.

Control the scope with parameters. The limit caps the pages per job and defaults to 10,000. maxDiscoveryDepth limits how many link hops the crawler follows from the root. includePaths and excludePaths take regex patterns matched against the URL path. Use includePaths to crawl one section, such as blog/.*. Set crawlEntireDomain to true to include sibling and parent paths. Set sitemap to "only" to crawl just the URLs listed in the sitemap.

Each crawled page costs 1 credit. A crawl that finishes is not the same as a crawl that reached every page. Check the counters in the status response. The data array holds only the pages that scraped successfully. Failed pages appear in the errors endpoint, GET /v2/crawl/{id}/errors. Robots.txt blocks are listed there too. Read the errors before you trust the dataset.

Step 5: Extract Structured Data

Markdown is good for reading. JSON is better for loading into a database. Pass a JSON format object in the scrape options. Describe the fields you want and their types. Firecrawl returns one JSON object per page. The JSON format adds 4 credits per page on top of the base cost. Use it when you need fields, not prose. Product names, prices, dates and authors are field jobs. Article bodies are markdown jobs.

Keep the schema small. Ask for five to ten fields. A wide schema costs the same but fails more often. Test the schema on three pages before you run it on three thousand. If a field comes back empty on all three, the page may not carry it. Change the field name or drop it.

Step 6: Watch the Credits

Firecrawl bills in credits from one monthly pool. The official pricing page lists the plans. Free gives 1,000 credits a month. Hobby costs $19 a month billed monthly, or $16 a month billed annually, for 5,000 credits. Standard costs $99 a month, or $83 a month billed annually, for 100,000 credits. Growth costs $399 a month, or $333 annually, for 500,000 credits. Scale costs $749 a month, or $599 annually, for 1,000,000 credits. Enterprise is custom.

The credit rules are simple. Scrape and crawl cost 1 credit per page. Map costs 1 credit per call. Search costs 2 credits per 10 results. Interact costs 2 credits per browser minute. The JSON format adds 4 credits per page. Paid plans can top up in $5 increments. Credits reset monthly and do not roll over. Set the limit parameter on every crawl. A crawl without a limit can burn a month's credits on one site.

Common Mistakes

Do not crawl before you scrape. A single scrape shows whether the site works with Firecrawl at all. Do not skip the errors endpoint. A crawl that reports success may still have missed half the site. Do not extract JSON from pages that need reading. Markdown is cheaper and more reliable for prose. Do not store the API key in code. Rotate it if it leaks. Do not ignore robots.txt. Firecrawl follows it by default for a reason. Respect the site's rules and your pipeline will keep working.

Bottom Line

Firecrawl turns websites into LLM-ready data in six steps: get a key, install the SDK, scrape one page, crawl the site, extract fields as JSON, and watch the credits. Start with markdown. Add JSON extraction only for fields. Cap every crawl. The free tier covers 1,000 pages a month, which is enough to prove the pipeline before you pay for it.