deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Firecrawl converts JavaScript-heavy pages to markdown for LLM and agent pipelines

A dev.to walkthrough covers Firecrawl, an AGPL-licensed scraping API that returns markdown from JavaScript-rendered pages, with SDKs, a CLI and MCP support for coding agents.

Firecrawl converts JavaScript-heavy pages to markdown for LLM and agent pipelines

The problem it solves

Pasting a web page into ChatGPT or Claude sends mostly boilerplate — navigation, cookie banners and script tags — while a plain HTTP request to a JavaScript-heavy site often comes back nearly empty. A walkthrough published on dev.to by Deduped presents Firecrawl as a fix for both: hand the service a URL and it returns markdown of the page's main content, suitable for a prompt or a retrieval pipeline.

What the service covers

According to the post, Firecrawl is an API aimed at AI agents that can search, scrape and otherwise interact with the web. Its scrape endpoint takes a URL and can return markdown, HTML, screenshots or structured JSON. The service manages proxy rotation and rate limiting, reaches content that only appears after JavaScript executes, and can also turn PDF and DOCX files into markdown. The project is open source under AGPL-3.0 with MIT-licensed SDKs, and a hosted version is available; the hosted API requires a key from firecrawl.dev, and the README links a self-hosting guide for anyone who prefers to run the stack themselves.

Scraping one page four ways

Setup starts with an account at firecrawl.dev. Keys begin with fc-, and the post recommends storing the key in an environment variable such as FIRECRAWL_API_KEY rather than committing it to a file.

The walkthrough then shows the same scrape from four angles. The Python SDK (pip install firecrawl) builds a client with the key and calls app.scrape with the markdown format; the Node package (npm install firecrawl) mirrors that flow. A curl example posts the target URL to the v2 scrape endpoint with the key supplied as a bearer token. The CLI adds an --only-main-content flag that discards navigation and other boilerplate, leaving the headings, lists and text worth feeding to a model or splitting into chunks.

Mapping, batching and crawling

The same client covers the follow-on jobs. The map call returns the URLs found on a site, ranked against a search term such as pricing. batch_scrape fetches several addresses in a single job. crawl walks a documentation site up to a configurable page limit, and the SDK waits until the job finishes before returning results. The author calls this the quickest path to the knowledge base behind a documentation chatbot.

Connecting coding agents

Two integrations bring the capability into agent tooling. Running npx -y firecrawl-cli@latest init --all --browser installs Firecrawl as a skill for Claude Code or Cursor, after which the agent is restarted. Alternatively, any MCP client can run firecrawl-mcp as a server via npx, with the API key passed through the server's environment block. The goal, per the post, is letting an agent consult current documentation rather than guessing from its training data. Because the MCP configuration holds the key, the post advises keeping it out of shared or committed config files.

Caveats

The walkthrough closes with three cautions: scraper operators should honour each site's terms and robots rules; hosted crawls consume credits per page, so limits matter while testing; and although the README examples hardcode a placeholder key, reading it from the environment is the safer pattern.

Why it matters

Language model pipelines are only as good as the text fed into them. Converting noisy HTML into markdown trims wasted tokens, makes chunking for retrieval more predictable, and unlocks the large share of the web that only renders through JavaScript. Firecrawl bundles that conversion layer together with site-wide crawling and MCP-based agent integration in one AGPL-licensed package, which makes it a practical building block for chatbots, research agents and retrieval systems that depend on live web content.

  • #web-scraping
  • #markdown
  • #llm
  • #open-source
  • #mcp

Related posts