Scrape, search and browse the web with a Firecrawl AI agent webhook
Turn any prompt into structured web data. Send a POST request with a natural language prompt and an optional JSON schema, and get back clean, structured results scraped from the web by an AI agent powered by Firecrawl...
Template notes
Turn any prompt into structured web data. Send a POST request with a natural language prompt and an optional JSON schema, and get back clean, structured results scraped from the web by an AI agent powered by Firecrawl.
Use Cases
- Data Enrichment: Feed company names or URLs from your CRM and get back structured firmographic data (industry, funding, team size, tech stack). - Lead Generation: Ask the agent to find pricing, contact pages, or product details for a list of competitors. - Market Research: Extract structured pricing plans, feature comparisons, or product catalogs from any website. - Content Aggregation: Pull structured news, events, or job postings from across the web on a schedule. - Sales Intelligence: Enrich prospect lists with company info, recent news, or tech stack details before outreach.
How It Works
POST /webhook/scrape-agent
1. Receive Scrape Request receives a POST request with prompt and an optional outputschema. 2. Validate Output Schema checks the schema. If none is provided, it falls back to a permissive default. If the schema is malformed, it returns a clear error via Return Schema Error. 3. Research & Extract Web Data takes the prompt and uses the full Firecrawl toolkit to research the web: - Search (/search): Finds relevant pages and sources across the web. - Scrape (/scrape): Extracts clean, structured content from any URL. - Interact (interactContext, interact, interactStop): Lets the agent interact with scraped pages in a live session. After scraping a page, the agent can click buttons, fill forms, navigate dynamic content, and extract data that static scraping cannot reach, all without managing sessions manually. This combination gives the AI agent complete web navigation capabilities. It can discover sources, read pages, and interact with dynamic content autonomously. 4. Format Response to Schema (Structured Output Parser) formats the agent's response to match the provided (or default) schema. 5. Return Structured Results sends the structured JSON back to the caller.
Setup Requirements
- Firecrawl API Key: Sign up at [firecrawl.dev](https://www.firecrawl.dev) and grab your API key. Connect it in the Firecrawl credential nodes. - LLM Provider: Configure your Primary Chat Model and Fallback Chat Model nodes (e.g., OpenRouter, OpenAI, Anthropic). The template uses two model nodes for reliability, plus a separate Parser Chat Model for the output parser. - n8n Instance: Self-hosted or cloud. Make sure the webhook node is set to accept POST requests.