Skip to content

Code Lab

Firecrawl Explained: From a Web Page to Markdown with a Tested Scrape

By Miles Park·
GitHub preview of firecrawl/firecrawl, Turn public pages into Markdown and inspect how the Python client builds requests.

CODE LAB · PROJECT SPOTLIGHT

Firecrawl Source walkthrough

Turn public pages into Markdown and inspect how the Python client builds requests.

Preview: GitHub · firecrawl/firecrawl

A web page contains navigation, layout, text, links, and sometimes an application that loads after the first response. Firecrawl provides scraping interfaces that turn that material into documents an agent can work with. We used its public scrape endpoint on an existing Tech Trend Insight article, inspected the returned Markdown, and traced the Python client’s request builder at a pinned commit.

Start from the publisher’s actual API guide

Firecrawl official documentation showing the direct API request example and navigation for scrape and agent integrations.
Our capture of Firecrawl’s public documentation. The page shows the official request setup, independently of our scrape result. Original creator page or image.

The guide puts the endpoint request beside the available integration paths. Start with one URL and one output format so the result is easy to inspect. The repository describes Local, Cloud, and full self-hosted deployment. Local uses your machine, Cloud runs the hosted service, and the full server brings its own queues and infrastructure. Choose the documented setup that fits the job. Account requirements and limits should be checked for the endpoint you use.

What the client sends for one page

firecrawl/firecrawlPython · source excerpt
Py  apps/python-sdk/firecrawl/v2/methods/scrape.py
35    if not url or not url.strip():36        raise ValueError("URL cannot be empty")3738    request_data: Dict[str, Any] = {"url": url.strip()}3940    if options is not None:41        validated = validate_scrape_options(options)42        if validated is not None:43            opts = prepare_scrape_options(validated)44            if opts:45                request_data.update(opts)4647    return request_data
Lines 35–47 · commit 73aea36View original on GitHub ↗

Source credit: firecrawl/firecrawl. AGPL-3.0 license and copyright notices.

The request builder refuses a blank URL, trims whitespace, and adds validated options when they are present. Later in the file, the scrape method posts that payload to /v2/scrape and constructs a Document from the returned data. Separating those steps helps diagnose a failure. A rejected URL is an input problem. A server error or a partial document requires inspecting the response and the page itself.

Worked example: scrape our existing FFmpeg article

We sent the following request to Firecrawl’s public endpoint without an API key during this check. It returned HTTP 200 and success=true. This is one observed request, so readers should confirm current access and limits before building a larger workflow. The source URL is our already published ffmpeg-skill article.

import requests
url = "https://www.techtrendinsight.com/2026/11/ffmpeg-skill-local-video-editing-crop-captions.html"
response = requests.post(
    "https://api.firecrawl.dev/v2/scrape",
    json={"url": url, "formats": ["markdown"]},
    timeout=35,
)
response.raise_for_status()
result = response.json()
print(result["success"])
markdown = result["data"]["markdown"]
print("607.5" in markdown)
# Observed output
# True
# True

The returned document retained the article’s crop example, including the 607.5-pixel calculation. It also retained links and some navigation text. That matters when an agent summarizes the page. Inspect the Markdown around the relevant heading and preserve the source URL. A successful request establishes that a document was returned, while a comparison against the original tells you whether the material needed for your task survived extraction.

Check the input before spending a server request

_prepare_scrape_request("  https://www.techtrendinsight.com/category/code-lab  ")
# Observed
# {"url": "https://www.techtrendinsight.com/category/code-lab"}

_prepare_scrape_request("   ")
# Observed exception
# ValueError: URL cannot be empty

We also ran the unchanged request-builder function in isolation with options omitted. Its first output strips the spaces. Its second refuses an empty value. This small check covers request construction, while the earlier endpoint call covers one actual public page. It does not test login-required content, every JavaScript application, or a large crawl. For a collection of pages, add limits and inspect representative documents before relying on an automated summary.

Use the document as evidence for the next step

A useful research pipeline saves the URL, the extraction time, and the exact passage behind a claim. Ask the agent to quote the relevant code or instruction and then verify it against the repository. The main repository identifies AGPL-3.0 licensing, while hosted access and individual components have their own applicable terms. The card links to the upstream source and release history.

For PDFs and Office files, compare MarkItDown. For interactive browser work, read agent-browser. For researching discussion around the extracted source, continue with last30days.

Join the discussion

Your email address will not be published. Required fields are marked *