Run an AI agent that browses provided URLs, follows relevant links, and extracts data based on your prompt.
plain
https://api.webcrawlerapi.com/v1/agentFormat: JSON
Method: POST
Request
prompt- (required) Natural language instruction — what data to extract or what task to perform.max_spend_usd- (required) Maximum budget in USD the agent may spend on this run. Must be > 0.urls- (optional) Seed URLs for the agent to start crawling from.seed_urls_only- (optional) Whentrue, agent only processes provided seed URLs and does not follow links. Defaultfalse.output_schema- (optional) JSON Schema object describing expected structure of extracted data.model- (optional) LLM model to use. See available models below.
Example:
json
{
"prompt": "Extract product names, prices, and descriptions",
"urls": ["https://example.com/products"],
"max_spend_usd": 0.5,
"model": "openai/gpt-5.4-mini",
"output_schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"price": { "type": "number" },
"description": { "type": "string" }
}
}
}
}curl example
bash
curl --request POST \
--url https://api.webcrawlerapi.com/v1/agent \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Extract product names, prices, and descriptions",
"urls": ["https://example.com/products"],
"max_spend_usd": 0.5
}'Available Models
google/gemini-3.1-flash-lite-previewgoogle/gemini-3-flash-previewgoogle/gemini-3.1-pro-previewopenai/gpt-5.4-miniopenai/gpt-5.4openai/gpt-5.5anthropic/claude-sonnet-4.6
Response
Returns an AgentRun object for the run.
json
{
"id": "ar_abc123",
"status": "in_progress",
"prompt": "Extract product names, prices, and descriptions",
"model": "openai/gpt-5.4-mini",
"urls": ["https://example.com/products"],
"max_spend_usd": 0.5,
"balance_used_usd": 0.0,
"success": false,
"created_at": "2025-01-01T00:00:00Z"
}Response fields
id— unique identifier of the agent runstatus—in_progress,done,error, orcanceledprompt— prompt from the requestmodel— LLM model usedurls— seed URLs providedmax_spend_usd— spending cap set for this runbalance_used_usd— actual amount spentdata— extracted result data (present whenstatusisdone)success—truewhen run completed with non-empty dataerror_reason— error message if run failedcreated_at— ISO 8601 timestamp
Agent runs are asynchronous. Poll GET /v1/agent/job/{id} to check progress.
Error Responses
400 Bad Request- Missing or invalid parameters (e.g.max_spend_usdis 0 or missing)401 Unauthorized- Invalid or missing API key402 Payment Required- Insufficient account balance500 Internal Server Error- Server-side error