MarkUDown

Agent API — MarkUDown AI web browsing agent API docs

POST/api/agent

Agent

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.

ParameterTypeRequiredDefaultDescription
urlstringrequired—Page where the agent starts.
promptstringrequired—Question or task for the agent.
max_stepsintegeroptional10Maximum number of decisions the agent makes (capped at 25).
max_pagesintegeroptional5Maximum pages the agent may visit (at least 1, capped at 15). The job is charged max_pages × 2 credits when it starts.
allow_navigationbooleanoptionaltrueLet the agent follow links to other pages.
timeoutintegeroptional120Page load timeout in seconds, per page.
callback_urlstringoptionalnullWebhook 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.