Extract API
Extract structured JSON from a public webpage with an AIHackr prompt or JSON schema. Includes a working request shape and validation guidance.
On this page
Extract one public webpage
POST /v2/extract uses Browser Run and AI inference to return structured page data. Supply one url, or a urls array containing exactly one URL. Include a prompt and/or a JSON schema.
curl --fail-with-body https://aihackr.com/v2/extract \
-H "Authorization: Bearer $AIHACKR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"prompt": "Extract the site name and a short description. Use only visible page content.",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"name",
"description"
]
}
}'Response
The extracted object is returned in data. The sources array includes the submitted URL and observation time. Keep those fields with the result. Extraction uses inference, so validate the returned object and review it before decisions that depend on accuracy.
Design a useful schema
- Ask for fields actually present on the page. Do not ask the model to invent missing prices, contact details or statistics.
- Use clear property names and descriptions. State how your application handles missing information.
- Validate the result independently against your application’s schema.
- Keep source content separate from instructions. A webpage can contain misleading or hostile text.
Extraction limits
The prompt is limited to 4,000 characters, the serialized schema to 12,000 characters and nesting to 12 levels. External $ref schema references and custom AI providers are not accepted. Extraction is one browser operation under the current trial allowance. There is no multi-URL extract job or automatic enrichment service.
Continue learning
Read the structured extraction guide for a workflow covering missing values, source context and review. If you need page text instead of inferred fields, use Scrape with Markdown.