Firecrawl icon

Firecrawl

Interactive with the firecrawl api

Extract

AI-generated

Summary

Extract structured data by sending a URL with a prompt, schema, and system prompt to the Firecrawl API, optionally enabling web search and source display, and optionally caching results in Postgres for faster subsequent retrieval.

Inputs

  • url (required) — The URL of the web page to extract data from.
  • prompt (required) — The text prompt to guide the data extraction from the page.
  • schema (required) — A JSON object defining the schema to extract structured data from the page.
  • systemPrompt (required) — The system prompt for guiding the extraction model.
  • showSources — Whether to include source references in the extraction results.
  • enableWebSearch — Enable web search integration during extraction to supplement the data.
  • cache — Select cache type to speed up extraction by storing and retrieving previous results; 'postgres' enables caching using a Postgres database, 'none' disables caching.
  • cacheTTL — The time-to-live in seconds for cached entries when using Postgres cache; a negative value disables expiration.

Output shape

a single JSON object containing the structured extraction result as returned by the Firecrawl API

The extraction method returns the API response JSON on success or throws an error if extraction fails; caching (if enabled) first checks stored results and updates cache on new results.

Examples

Example 1: Extract structured data from a web page using a specific prompt and schema with caching enabled.

Set url to the target webpage, define extraction prompt and schema JSON, provide system prompt; optionally enable showSources and enableWebSearch flags; use 'postgres' caching with a desired cacheTTL to leverage cached extraction results.

Links

Discussion