AI Parser

Extract structured data from a webpage with AI using the MrScraper Playground API.

Use AI to parse a webpage and return structured data. Send the target url together with a natural language prompt describing the fields you need, and pick the agent that matches the page type.

POST
/

Query Parameters

token*string

API token.

html*boolean
Defaulttrue
super?boolean

Route requests through real devices to bypass anti-bot protection.

browserRendering?boolean

Render page using Chromium.

waitUntil?string

Defines when the browser considers navigation complete. 'Network Idle 0' waits until all network activity stops — most thorough but slowest

Value in"domcontentloaded" | "load" | "networkidle0" | "networkidle2"
timeout?integer

Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages

blockResources?boolean

Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage

waitForSelector?string

Pause until a specific CSS selector appears in the DOM. Useful for content that loads asynchronously after the initial page load

returnCookie?boolean

Include the browser session cookies from the scraped page in the API response

geoCode?string

The geographic code for the location of the proxy server

proxyCountry?string

The country of the proxy server

screenshot?boolean

Captures a full-page screenshot of the rendered page as a base64-encoded image

markdown?boolean

Converts the page content into clean Markdown format, stripping HTML tags

Header Parameters

x-api-token*string

API token.

Request Body

application/json

url*string
Formaturi
prompt?string
agent*string
Value in"general" | "detail" | "map"
maxPages?integer

Maximum number of pages to crawl or paginate.

Range1 <= value
maxDepth?integer

Maximum crawl depth from the starting URL.

Range1 <= value
limit?integer

Maximum number of URLs to collect.

Range1 <= value
includePatterns?array<string>

Only URLs matching these patterns will be crawled.

excludePatterns?array<string>

URLs matching these patterns will be skipped.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.mrscraper.com/?token=string&html=true" \  -H "x-api-token: string" \  -H "Content-Type: application/json" \  -d '{    "url": "https://example.com",    "prompt": "Extract all data as complete as possible.",    "agent": "general"  }'
{
  "code": null,
  "screenshots": [],
  "recording_path": null,
  "extractions": "{}",
  "data": {},
  "data_path": "results/6cef400f-ec7f-4a21-86df-0c7d46bfcf49/data.json",
  "html_path": "results/6cef400f-ec7f-4a21-86df-0c7d46bfcf49/page.html",
  "error": null,
  "residential_proxy_usage": {
    "received": 0.0009365081787109375,
    "sent": 0.0002651214599609375,
    "total": 0.001201629638671875
  },
  "runtime": 4.082163572311401,
  "token_usage": 2,
  "listen_network_data": {},
  "html": "<!DOCTYPE html>...</html>",
  "markdown": "",
  "screenshot": ""
}
{
  "error": "Unauthorized",
  "message": "Invalid or missing API token",
  "statusCode": 401
}
{
  "error": "Internal Server Error",
  "message": "An unexpected error occurred",
  "statusCode": 500
}