Point it at any website. Describe what you want. Get structured JSON data.
Navigates to the given URL using a headless browser, captures the page content, and uses an OpenAI model to extract exactly what you describe. Returns structured JSON.
| Header | Type | Description | |
|---|---|---|---|
| Content-Type | string | required | Must be application/json |
| X-Pass-Key | string | optional | Required only when PASS_KEY is set in server .env |
| Field | Type | Description | |
|---|---|---|---|
| url | string | required | The full URL of the page to scrape (e.g. https://example.com) |
| extractionDetails | string | required | Plain-English description of what data to extract |
| openaiApiKey | string | optional | Your OpenAI API key. Falls back to OPENAI_API_KEY in server .env |
| model | string | optional | OpenAI model to use. Default: gpt-4o-mini |
| outputFormat | object | optional | A JSON schema / example structure. The AI fills in values matching this shape. |
curl -X POST http://localhost:3000/api/extract \
-H "Content-Type: application/json" \
-d '{
"url": "https://news.ycombinator.com",
"extractionDetails": "Extract the top 5 stories: title, URL, and points for each",
"model": "gpt-4o-mini"
}'
curl -X POST http://localhost:3000/api/extract \
-H "Content-Type: application/json" \
-H "X-Pass-Key: your-pass-key" \
-d '{
"url": "https://example.com/product/123",
"extractionDetails": "Extract product details",
"model": "gpt-4o",
"outputFormat": {
"name": "",
"price": 0,
"currency": "",
"rating": 0,
"reviews": [{ "author": "", "stars": 0, "text": "" }]
}
}'
{
"success": true,
"data": { ... }, // extracted data matching your request
"url": "https://...",
"extractedAt": "2025-01-15T08:30:00.000Z",
"model": "gpt-4o-mini",
"tokensUsed": 1842
}
{
"success": false,
"error": "Human-readable error message"
}
Verifies agent-browser is installed and returns the server configuration. No authentication required.
curl http://localhost:3000/api/health
{
"status": "ok",
"agentBrowser": "1.2.3",
"hasApiKey": true,
"requiresPassKey": false,
"timestamp": "2025-01-15T08:00:00.000Z"
}