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.POST https://api.geekflare.com/webscraping
Credits: +6 on top of the base scrape cost 8 total for a standard scrape.
How It Works
EveryaiPrompt object has a required type field that selects the extraction mode, plus mode-specific fields:
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).
| Field | Type | Required | Description |
|---|---|---|---|
query | string | yes | Your question, max 1000 characters |
Response
Response
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.
| Field | Type | Required | Description |
|---|---|---|---|
schema | object | yes | JSON Schema-like object describing the fields to extract, max 4000 bytes |
Response
Response
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.
product takes only type.
Response
Response
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.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
itemSchema | object | yes | — | JSON Schema-like object for each item, max 4000 bytes |
maxItems | number | no | 20 | Maximum items to extract (1–50) |
Response
Response
maxItems.
5. summary — Condensed Page Summary
Summarize the page in paragraph, unordered list, or TL;DR form, optionally focused on one topic.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
style | string | no | paragraph | paragraph, bullets (unordered list), or tldr |
focus | string | no | — | Only summarize content relevant to this topic, max 200 characters |
maxLength | number | no | 5 | Sentence count for paragraph/tldr, item count for bullets (1–20) |
Response
Response
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.
contact takes only type.
Response
Response
7. sentiment — Sentiment Analysis
Analyze overall or aspect-based sentiment across reviews, comments, or opinion text on the page.
| Field | Type | Required | Description |
|---|---|---|---|
aspects | string[] | no | Up to 10 aspects to score individually. Omit to return only overall sentiment. |
Response
Response
8. keywords — Keywords, Tags & Entities
Extract ranked keywords, named entities, and suggested content tags.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
maxKeywords | number | no | 10 | Maximum keywords to return (1–30) |
includeEntities | boolean | no | false | Also extract named entities (orgs, people, dates, laws, locations) |
Response
Response
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 themarkdown format — regardless of any format value you set. This keeps the model’s input focused on primary content.
Notes & Limits
- Only one
aiPromptmode 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
urlto a more specific page.