How to scrape a site for an AI agent

How to scrape a site for an AI agent
Trusted by770,000+ Techpresso subscribers·Editorial policy·How we make money
Key factsScrape for an AI agent: get markdown or JSON, never raw HTML
  • Updated: September 17, 2026
  • Check robots.txt and the site's terms before scraping; if you would not email the site owner, do not put the scrape in a cron job.
  • Use an API like Firecrawl or Context to return markdown or JSON output instead of feeding raw HTML into the agent's prompt.
  • Chunk, embed, or otherwise select only the smallest useful piece of scraped content rather than stuffing a 200-page crawl into one context window.
  • Firecrawl's free tier is 1,000 credits a month with no card required, and Hobby costs $16/month billed annually or $19 monthly for 5,000 credits.
  • Cache scraped content and re-crawl on a schedule rather than re-scraping on every user message.

An agent that "reads the web" with a raw HTTP get will choke on the first JS-rendered pricing table. You want markdown or JSON out, not a blob of nav chrome.

The two APIs we reviewed are Firecrawl (10% off via the partner link) and Context (25% off for six months). Devshot already ranks scrapers in best web scraping tools.

The short version

  1. Decide the job: one URL, a crawl of a docs site, or a search-then-scrape. Do not start with "the whole internet."
  2. Check robots.txt and the site's terms. If you would not email the owner, do not put it in a cron.
  3. Call Firecrawl or Context for markdown / JSON. Keep the raw HTML out of the prompt.
  4. Chunk, embed, or stuff the smallest useful piece into the agent. A 200-page crawl in one context window is how you waste money and get a confident wrong answer.
  5. Cache. Re-crawl on a schedule, not on every user message.

Firecrawl's free tier is 1,000 credits a month, no card. Hobby is $16/mo annual ($19 monthly) for 5,000 credits, per their pricing page as of September 2026. Start free.

When this is the wrong tool

  • You need a human-readable briefing. Use Perplexity.
  • You need to pay an affiliate when someone signs up. That is Dub.
  • You need a browser the user drives. That is not a scrape API.

This article may contain affiliate links and paid recommendations. How we make money

Related Articles
Tutorial

How to Integrate AI into a Website (2026)

How to integrate AI into a website: chatbots, search, and personalization. Covers no-code tools, plugins, and custom API integration.

Tutorial

How to Build an AI Agent: Beginner-Friendly Guide (2026)

Learn how to build an AI agent from scratch: frameworks, tools, and step-by-step instructions. Covers LangChain, CrewAI, AutoGen, and no-code options.

Blog Post

What Is Hermes Agent? Nous Research's Self-Improving AI Agent (2026)

Hermes Agent is Nous Research's open-source AI agent with persistent memory across Telegram, Slack, email, and CLI. What it does, real pricing, and how to start.

Blog Post

The Best AI Coding Agents in 2026 (Compared and Ranked)

I compared the best AI coding agents of 2026, from Claude Code and Cursor to Devin and Codex. Real pricing, benchmark scores, and where each one falls short.

Blog Post

The 8 Best AI Agent Frameworks in 2026

I compared the best AI agent frameworks of 2026, from LangGraph and CrewAI to the OpenAI Agents SDK and Pydantic AI. Real pricing, honest downsides, and how to pick.

Article

10 Best AI Agent Observability Tools in 2026

The best AI agent observability tools in 2026: Arize AX Pro at $50/mo, LangSmith Plus at $39/seat, Logfire Team at $49/mo. Checked September 23, 2026.

TECHPRESSO

Keep up with Tech in 5 minutes

Get the free daily email with the most interesting tech news and insights. The best way to stay ahead in just a few minutes.

No spam · 100% free · Unsubscribe anytime