Skip to main content
Scraping a page is the first step. The next is turning that content into an answer, a structured record, or a summary. AI Extraction does that in the same request: pass an aiPrompt object alongside your url, and Geekflare scrapes the page, feeds the cleaned Markdown to an LLM, and returns the result under aiResult.
AI Extraction always runs against Markdown content. Any format you set in the same request is ignored — you don’t need to (and shouldn’t) combine format with aiPrompt.
Endpoint: POST https://api.geekflare.com/webscraping Credits: +6 on top of the base scrape cost.

How It Works

Every aiPrompt object has a required type field that selects the extraction mode, plus mode-specific fields:
The result is returned under aiResult in the response, alongside the usual data field (which contains the Markdown content that was analyzed) and meta.

1. prompt — Open-Ended Question

Ask any question about the page. The model answers strictly from page content and quotes the supporting sentence(s).
If the answer isn’t present in the page content, answered is false and answer/sourceExcerpt are null — the model never guesses.

2. schema — Custom JSON Schema Extraction

Define your own field shape and let AI extract matching data from any page.
AI extraction output is validated against your schema on a best-effort basis. Fields the model couldn’t find are returned as null rather than omitted or invented.

Looking for product or contact-info extraction? Those are now covered by the standard extraction templates — see product and contact in the Web Scraping guide.

3. listing — Category/Search Page Extraction

Extract an array of items from a category or search-results page using your own item schema.
Navigation links, ads, and unrelated content are excluded automatically. Items are returned in page order, capped at maxItems.

4. summary — Condensed Page Summary

Summarize the page in paragraph, unordered list, or TL;DR form, optionally focused on one topic.
summary is a string for paragraph/tldr style, and an array of strings for bullets style.

5. sentiment — Sentiment Analysis

Analyze overall or aspect-based sentiment across reviews, comments, or opinion text on the page.

6. keywords — Keywords, Tags & Entities

Extract ranked keywords, named entities, and suggested content tags.
entities is only included when includeEntities is true.

Content Handling

AI Extraction always uses the page’s Markdown content — the same content you’d get from the markdown format — regardless of any format value you set. This keeps the model’s input focused on primary content.

Notes & Limits

  • Only one aiPrompt mode can be used per request.
  • Every mode answers strictly from the scraped page content — the model does not use outside knowledge and will not invent data that isn’t present.
  • Page content is treated as untrusted data: instructions embedded in scraped pages are ignored.
  • Very long pages are truncated before analysis; if you’re missing expected data from a long listing or product page, try narrowing the url to a more specific page.