MarkUDown
Agent API — MarkUDown AI web browsing agent API docs
POST
/api/agentAgent
Give the agent a start URL and a question. It reads the page, asks an LLM whether to answer or follow a link, and repeats until it can answer or runs out of steps. You get the answer plus every step it took.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | required | — | Page where the agent starts. |
| prompt | string | required | — | Question or task for the agent. |
| max_steps | integer | optional | 10 | Maximum number of decisions the agent makes (capped at 25). |
| max_pages | integer | optional | 5 | Maximum pages the agent may visit (at least 1, capped at 15). The job is charged max_pages × 2 credits when it starts. |
| allow_navigation | boolean | optional | true | Let the agent follow links to other pages. |
| timeout | integer | optional | 120 | Page load timeout in seconds, per page. |
| callback_url | string | optional | null | Webhook URL to POST the result to when the job completes. |
Request
curl -X POST https://api.scrapetechnology.com/api/agent \
-H "X-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://quotes.toscrape.com/", "prompt": "Which tags appear on the quotes by Albert Einstein on the first two pages?", "max_pages": 3}'Response
// POST returns { "success": true, "id": "abc123", "url": "/api/agent/abc123" }
// Poll GET /api/agent/{id}
{
"success": true,
"id": "abc123",
"status": "completed",
"data": {
"success": true,
"data": {
"url": "https://quotes.toscrape.com/",
"answer": "Einstein's quotes are tagged: change, deep-thoughts, ...",
"steps": [
{
"step": 1,
"url": "https://quotes.toscrape.com/",
"action": "navigate",
"reasoning": "Page 1 read; page 2 is needed.",
"result": "Navigating to: https://quotes.toscrape.com/page/2/"
},
{
"step": 2,
"url": "https://quotes.toscrape.com/page/2/",
"action": "answer",
"reasoning": "Both pages read.",
"result": "Einstein's quotes are tagged: change, deep-thoughts, ..."
}
],
"pages_visited": [
"https://quotes.toscrape.com/",
"https://quotes.toscrape.com/page/2/"
],
"total_steps": 2
},
"processing_time_ms": 21400
}
}Python — pip install markudown
from markudown import MarkUDown
md = MarkUDown(api_key="your-api-key")
job = md.agent(
"https://quotes.toscrape.com/",
"Which tags appear on the quotes by Albert Einstein on the first two pages?",
max_pages=3,
)
print(job["data"]["data"]["answer"])Node.js — npm install markudown-sdk
import { MarkUDown } from "markudown-sdk";
const md = new MarkUDown({ apiKey: "your-api-key" });
const job = await md.agent(
"https://quotes.toscrape.com/",
"Which tags appear on the quotes by Albert Einstein on the first two pages?",
{ maxPages: 3 },
);
console.log(job.data.data.answer);The agent reads pages (scrolling to load lazy content) and follows links; it does not click buttons or fill in forms. Each step's action is answer, navigate, extract or done (scrape_failed or llm_error when something broke). Cancel a running job with DELETE /api/agent/{id}.
Cost: max_pages × 2 credits, charged when the job starts.