Skip to main content
Scraping a page is often just step one — the real work 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 8 total for a standard scrape.

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).
FieldTypeRequiredDescription
querystringyesYour question, max 1000 characters
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.
FieldTypeRequiredDescription
schemaobjectyesJSON Schema-like object describing the fields to extract, max 4000 bytes
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.

3. product — Preset Product Extraction

A ready-made schema tuned for e-commerce pages — no schema definition needed.
No additional fields — product takes only type.
currency is always returned as an ISO 4217 code (e.g. USD, INR), never a symbol. If the page isn’t a product page, all fields are returned as null.

4. listing — Category/Search Page Extraction

Extract an array of items from a category or search-results page using your own item schema.
FieldTypeRequiredDefaultDescription
itemSchemaobjectyesJSON Schema-like object for each item, max 4000 bytes
maxItemsnumberno20Maximum items to extract (1–50)
Navigation links, ads, and unrelated content are excluded automatically. Items are returned in page order, capped at maxItems.

5. summary — Condensed Page Summary

Summarize the page in paragraph, unordered list, or TL;DR form, optionally focused on one topic.
FieldTypeRequiredDefaultDescription
stylestringnoparagraphparagraph, bullets (unordered list), or tldr
focusstringnoOnly summarize content relevant to this topic, max 200 characters
maxLengthnumberno5Sentence count for paragraph/tldr, item count for bullets (1–20)
summary is a string for paragraph/tldr style, and an array of strings for bullets style.

6. contact — Contact & Company Details

Extract company name, emails, phone numbers, address, social links, and business hours from a contact or about page.
No additional fields — contact takes only type.
Only data explicitly present in the content is returned — the model never guesses an email or phone number.

7. sentiment — Sentiment Analysis

Analyze overall or aspect-based sentiment across reviews, comments, or opinion text on the page.
FieldTypeRequiredDescription
aspectsstring[]noUp to 10 aspects to score individually. Omit to return only overall sentiment.

8. keywords — Keywords, Tags & Entities

Extract ranked keywords, named entities, and suggested content tags.
FieldTypeRequiredDefaultDescription
maxKeywordsnumberno10Maximum keywords to return (1–30)
includeEntitiesbooleannofalseAlso extract named entities (orgs, people, dates, laws, locations)
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.