Scrape JSON

Extract structured, strongly-typed JSON from a single page with the Scrape JSON endpoint, using a natural language prompt instead of CSS selectors or XPath.

Scrape a single page and return structured JSON. The general agent analyzes the page against your prompt and returns clean, strongly-typed data without fragile CSS selectors or custom XPath parsers.

Note

  • Use the Playground API Server (https://api.mrscraper.com) host when calling this endpoint.
  • The prompt only parses the scraped content. It cannot instruct the scraper itself.
  • To shape the output with a JSON schema, append it to the prompt as a Json Schema: section.
  • For multi-page catalogs, search results, and infinite-scroll listings, use the Listing Page endpoint instead.
  • See Scrape JSON in the Playground guide for the full list of settings.
POST
/

Query Parameters

token*string

API token.

html?boolean

Returns the raw HTML of the scraped page in the response.

Defaulttrue
browserRendering?boolean

Render the page using a real Chromium browser. Required for JavaScript-heavy sites, SPAs, and pages that load content dynamically.

Defaultfalse
waitUntil?string

Defines when the browser considers navigation complete. networkidle0 waits until all network activity stops — the most thorough option, but the slowest.

Default"domcontentloaded"
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.

Default300
screenshot?boolean

Captures a screenshot of the rendered page as a base64-encoded image. Useful for verifying what the scraper actually saw.

Defaultfalse
super?boolean

Uses additional resources to improve extraction accuracy on complex websites. Enable for sites protected by anti-bot systems or containing heavily dynamic content.

Defaultfalse
geoCode?string

Country to load the page from. Defaults to the United States.

Default"us"
proxyCountry?string

Country of the proxy server. Defaults to the United States.

Default"us"
saveResult?boolean

Saves the result to the Result tab.

Defaulttrue

Header Parameters

x-api-token*string

API token.

Request Body

application/json

url*string

The full URL of the page you want to scrape. Must include the protocol (https://).

Formaturi
prompt?string

Describe the data shape you want back, for example fields like title, price, and rating. The prompt only parses the scraped content — it cannot instruct the scraper itself. To shape the output with a JSON schema, append it to the prompt as a 'Json Schema:' section.

Default"Extract all data as complete as possible."
agent*string

The AI agent used for extraction. Scrape JSON uses the general agent, optimised for single-page structured extraction.

Default"general"
Value in"general"
tokenCap?integer

Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit.

Range1 <= value
maxRetries?integer

Maximum number of retries for the request. Omit for no limit.

Range0 <= value

Response Body

application/json

application/json

application/json

curl -X POST "https://api.mrscraper.com/?token=string" \  -H "x-api-token: string" \  -H "Content-Type: application/json" \  -d '{    "url": "https://quotes.toscrape.com/",    "prompt": "Extract all data as complete as possible.",    "agent": "general"  }'
{
  "code": null,
  "screenshots": [],
  "recording_path": null,
  "extractions": "{}",
  "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": 214,
  "listen_network_data": {},
  "html": "<!DOCTYPE html>...</html>",
  "markdown": "",
  "screenshot": "",
  "data": {
    "quotes": [
      {
        "text": "The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking.",
        "author": "Albert Einstein",
        "author_url": "/author/Albert-Einstein",
        "tags": [
          "change",
          "deep-thoughts",
          "thinking",
          "world"
        ]
      },
      {
        "text": "It is our choices, Harry, that show what we truly are, far more than our abilities.",
        "author": "J.K. Rowling",
        "author_url": "/author/J-K-Rowling",
        "tags": [
          "abilities",
          "choices"
        ]
      }
    ]
  }
}
{
  "error": "Unauthorized",
  "message": "Invalid or missing API token",
  "statusCode": 401
}
{
  "error": "Internal Server Error",
  "message": "An unexpected error occurred",
  "statusCode": 500
}