MCP Server
Official MrScraper MCP server for retrieving web pages, web search, and account usage. Connect AI clients or run the open-source server locally.
MrScraper MCP is the official Model Context Protocol server for MrScraper. It connects AI clients to web page retrieval, web search, and your account usage.
MrScraper MCP server source code on GitHub · Install the @mrscraper/mcp npm package
The server exposes seven tools:
status
Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields.
scrapeHtml
Retrieve the raw HTML of a page. Browser rendering is optional.
scrapeMarkdown
Retrieve a page as clean Markdown. Browser rendering is optional.
getScreenshot
Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
scrapeBrand
Extract a website's colors, typography, logos, and social links as JSON.
scrapeJson
Extract structured JSON from a page using a natural-language prompt.
webSearch
Search the web and return ranked results with titles, URLs, descriptions, and sources.
Use the hosted Streamable HTTP endpoint for a managed connection, or run the published MCP package locally through Streamable HTTP or stdio.
Package information
This page documents @mrscraper/mcp version 0.7.0. Its seven tools share their descriptions, inputs, and defaults with the MrScraper CLI, SDKs, and integrations. The tools follow the API reference for every input, always save page results to your dashboard, send an input's default when you leave the input out, and send inputs without a default only when you set them.
Capabilities
Page Retrieval
Retrieve a known URL as HTML, Markdown, or a screenshot, with optional browser rendering, country selection, selector waiting, cached results, retry limits, token caps, and session cookies.
Brand and JSON Extraction
Extract a website's colors, typography, logos, and social links, or structured JSON from a natural-language prompt.
Web Search
Search the web for ranked results, for a chosen country and up to 100 results at a time.
Account Status
Read the subscription, token limit, token usage, remaining tokens, and rate limit.
Managed Endpoint
Connect to the hosted MCP endpoint through Streamable HTTP with OAuth 2.1 browser sign-in.
Structured Tool Results
Receive a consistent response envelope in MCP structured content.
Interactive Widgets
Render search results and an account usage meter in hosts that support MCP Apps.
Requirements
- A MrScraper account
- An MCP client with Streamable HTTP support
- An API key only when the client cannot use OAuth 2.1 or when running the server locally
Quick start with the hosted server
Add the hosted endpoint
Configure a Streamable HTTP server named mrscraper with no credential:
{
"mcpServers": {
"mrscraper": {
"type": "http",
"url": "https://mcp.mrscraper.com/mcp"
}
}
}Use this exact URL, including the /mcp path.
Sign in
Connect or reload the MCP server. Your client follows the OAuth 2.1
challenge, opens MrScraper in your browser, and asks you to approve
scrape:read for the six scraping and search tools and account:read
for status.
Reload and verify
Reload the client or start a new session, then inspect its MCP tool list.
The connection should expose status, scrapeHtml, scrapeMarkdown,
getScreenshot, scrapeBrand, scrapeJson, and webSearch.
Copyable AI setup prompt
Connect MrScraper MCP to this agent. Detect the current MCP client and use its native Streamable HTTP setup to add a server named mrscraper at exactly https://mcp.mrscraper.com/mcp with no static credential. Complete the OAuth 2.1 browser sign-in; if it does not start automatically, use the client's MCP login or authenticate command. Only if the client does not support OAuth, fall back to a MrScraper API key from https://app.mrscraper.com/api-tokens stored through the client's environment-variable or secret-storage mechanism and sent as Authorization: Bearer <key>. Reload the MCP client when required, then list the tools and confirm that status, scrapeHtml, scrapeMarkdown, getScreenshot, scrapeBrand, scrapeJson, and webSearch are available.Client configuration
Add the hosted URL without a static Authorization header, then complete
browser sign-in when the client prompts you.
Codex
codex mcp add mrscraper \
--url https://mcp.mrscraper.com/mcpCodex uses OAuth by default for Streamable HTTP servers. If browser sign-in does
not start automatically, run codex mcp login mrscraper.
Claude Code
claude mcp add \
--transport http \
--scope user \
mrscraper https://mcp.mrscraper.com/mcpOpen /mcp inside Claude Code and authenticate, or run
claude mcp login mrscraper from your shell.
To add MrScraper's three skills for page retrieval and web search along with the server, install the MrScraper plugin for Claude Code instead:
claude plugin marketplace add mrscraper-com/mrscraper-claude-plugin
claude plugin install mrscraper@mrscraper-claudeThe plugin is also listed on ClaudePluginHub.
Claude and Claude Desktop
Open the custom connector form
In a general Claude chat, select the + button below the input box, then choose Connectors → Add connector → Add custom connector.

Add MrScraper
Enter MrScraper as the name and
https://mcp.mrscraper.com/mcp as the MCP server URL, then select
Continue.

Sign in
Complete the MrScraper OAuth browser flow when Claude prompts you.
Cursor
Open Cursor Settings → Tools & MCP → Add Custom MCP, then add:
{
"mcpServers": {
"mrscraper": {
"type": "http",
"url": "https://mcp.mrscraper.com/mcp"
}
}
}Refresh the MCP server list, then authenticate when prompted.
VS Code
Add the server to your user settings:
{
"mcp": {
"servers": {
"mrscraper": {
"type": "http",
"url": "https://mcp.mrscraper.com/mcp"
}
}
}
}For a workspace configuration, place the server object under servers in
.vscode/mcp.json. Start the server and VS Code opens a browser for OAuth.
Windsurf
Add the following entry to the Windsurf MCP configuration:
{
"mcpServers": {
"mrscraper": {
"serverUrl": "https://mcp.mrscraper.com/mcp"
}
}
}Refresh the MCP server list, then complete OAuth when prompted.
Other MCP clients
Use these connection values:
| Setting | Value |
|---|---|
| Name | mrscraper |
| Transport | Streamable HTTP |
| URL | https://mcp.mrscraper.com/mcp |
| Authentication | OAuth 2.1; do not configure a static header |
API key fallback
If a client cannot complete OAuth, create an API key, store it through the client's secret mechanism, and send it as a bearer token:
{
"mcpServers": {
"mrscraper": {
"type": "http",
"url": "https://mcp.mrscraper.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_MRSCRAPER_API_KEY"
}
}
}
}For Codex, pass the environment-variable name instead of embedding the key:
export MRSCRAPER_API_KEY="YOUR_MRSCRAPER_API_KEY"
codex mcp add mrscraper \
--url https://mcp.mrscraper.com/mcp \
--bearer-token-env-var MRSCRAPER_API_KEYAuthentication
| Connection | Credential source |
|---|---|
| Hosted Streamable HTTP | OAuth 2.1 browser sign-in, or an API key fallback |
| Self-hosted Streamable HTTP | OAuth 2.1 access token, or Authorization: Bearer <MrScraper API key> |
| Local stdio | MRSCRAPER_API_KEY, then MRSCRAPER_API_TOKEN |
The hosted server publishes OAuth 2.1 protected-resource metadata and challenges
unauthenticated clients to start browser sign-in. Access tokens are issued for
the exact https://mcp.mrscraper.com/mcp resource. A tool called without its
required scope returns 403 insufficient_scope, and your client can offer to
grant the missing permission.
| Scope | Tools |
|---|---|
scrape:read | scrapeHtml, scrapeMarkdown, getScreenshot, scrapeBrand, scrapeJson, and webSearch |
account:read | status |
These are the only application scopes the server advertises; the
authorization server also offers offline_access for refresh tokens. Clients
take the scopes from the server's metadata, so don't pin scopes in client
configurations.
OAuth connections that hold scrape:read work without reconnecting.
Connections without scrape:read must reconnect and approve it to run the
scraping and search tools; status uses account:read.
API keys remain supported for clients without OAuth and carry full account authority, so no scope is enforced against them. Authentication stays at the transport layer; tools never accept credentials as arguments.
Run the MCP server locally
Node.js 20 or newer is required.
Published package over stdio
{
"mcpServers": {
"mrscraper": {
"command": "npx",
"args": ["-y", "@mrscraper/mcp@latest"],
"env": {
"MRSCRAPER_API_KEY": "YOUR_MRSCRAPER_API_KEY"
}
}
}
}Source checkout over Streamable HTTP
Clone and build
git clone https://github.com/mrscraper-com/mrscraper-mcp.git
cd mrscraper-mcp
npm ci
npm run buildStart HTTP transport
TRANSPORT=http npm startThe default endpoint is http://127.0.0.1:8000/mcp.
Connect the client
{
"mcpServers": {
"mrscraper": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp",
"headers": {
"Authorization": "Bearer YOUR_MRSCRAPER_API_KEY"
}
}
}
}Docker
docker build -f docker/Dockerfile -t mrscraper-mcp .
docker run --rm -p 8000:8000 mrscraper-mcpThe image binds to 0.0.0.0. Apply network controls appropriate for the
deployment and keep bearer verification enabled.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
TRANSPORT | stdio | Selects stdio or http. |
HOST | 127.0.0.1 | HTTP bind address; the Docker image uses 0.0.0.0. |
PORT | 8000 | HTTP listen port. |
MRSCRAPER_API_KEY | — | Primary stdio credential. |
MRSCRAPER_API_TOKEN | — | Alternative stdio credential, also used by the Python SDK. |
MRSCRAPER_HTTP_AUTH | 1 | Enables HTTP bearer verification. |
MRSCRAPER_OAUTH | 1 | Accepts OAuth 2.1 access tokens alongside API keys. |
MRSCRAPER_MCP_PUBLIC_URL | https://mcp.mrscraper.com | Public origin; <origin>/mcp is the required token audience. |
MRSCRAPER_OAUTH_ISSUER | https://api.app.mrscraper.com | Authorization server issuer. |
MRSCRAPER_OAUTH_JWKS_URL | <issuer>/.well-known/jwks.json | Key set used to verify access tokens. |
MRSCRAPER_ALLOWED_ORIGINS | — | Comma-separated browser origins allowed to call the HTTP server. |
MRSCRAPER_API_BASE_URL | MrScraper platform API | Platform endpoint override used by status. |
MRSCRAPER_FETCH_BASE_URL | MrScraper Scraper API | Endpoint override used by the six scraping and search tools. |
MRSCRAPER_LOG_HTTP_PAYLOAD | off | Enables trusted-environment request-body diagnostics. |
MRSCRAPER_LOG_HTTP_PAYLOAD_MAX | 8192 | Maximum diagnostic payload length. |
Security behavior
- HTTP authentication is enabled by default.
- Credential-bearing response headers are filtered from tool output.
- Credential metadata in scraping and search responses is redacted, and network errors redact signed query credentials.
statuspreserves every field of the account status response body, including account identity and billing identifiers. Only credential-bearing response headers are removed.- Browser-origin requests are accepted from trusted local origins, from
claude.aiandchatgpt.com, and from exact values configured throughMRSCRAPER_ALLOWED_ORIGINS. - Tool calls receive the caller's authenticated OAuth token or API key through the MCP transport rather than through tool arguments.
Choosing the right tool
| Starting point | Desired outcome | Tool |
|---|---|---|
| A known URL | Raw HTML, optionally with a screenshot | scrapeHtml |
| A known URL | Markdown | scrapeMarkdown |
| A known URL | A screenshot of the full page, the first viewport, or a custom viewport | getScreenshot |
| A website | Colors, typography, logos, and social links | scrapeBrand |
| A known URL | Data extracted as JSON with a natural-language prompt | scrapeJson |
| A topic or keyword | Search result discovery | webSearch |
| An account | Plan, token usage, and remaining tokens | status |
A discovery workflow commonly uses webSearch first, followed by
scrapeMarkdown or scrapeHtml for the pages that will inform the answer.
Agents produce summaries, tables, and structured output from the retrieved
content, or call scrapeJson to have MrScraper extract the data.
The MCP server does not create AI scrapers, rerun saved scrapers, or list stored results. Manage those in the MrScraper dashboard.
Common response envelope
Every tool returns the same envelope in MCP structuredContent and as
formatted JSON in a text content block:
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": "<html><body>Example page content...</body></html>",
"headers": {
"content-type": "text/html; charset=utf-8"
}
}
}| Field | Type | Description |
|---|---|---|
status_code | number or null | HTTP status returned by the MrScraper service, or null when the request ends before an HTTP response arrives. |
data | JSON value, string, or null | The API response body, as parsed JSON or text. Its field names are not converted. |
headers | object | Response headers with credential-bearing headers filtered out. |
error | string, when present | Request failure summary. |
status preserves the complete account status body without adding summary
fields.
Error handling
HTTP and network failures set isError: true on the MCP tool result and
include error in the envelope. Network failures use status_code: null.
Invalid inputs, including inputs a tool does not define, are rejected before
any upstream call. Authentication and missing OAuth scopes are enforced by the
HTTP transport before a tool runs.
Tool reference
Tool names, descriptions, inputs, and defaults match the MrScraper CLI, SDKs, and integrations. Inputs use camel case and are sent to the API under the same names. Tools authenticate through the MCP connection and do not accept a token argument.
| Tool | Title | OAuth scope | readOnlyHint | openWorldHint |
|---|---|---|---|---|
status | Account Status | account:read | true | false |
scrapeHtml | Scrape HTML | scrape:read | false | true |
scrapeMarkdown | Scrape Markdown | scrape:read | false | true |
getScreenshot | Get Screenshot | scrape:read | false | true |
scrapeBrand | Scrape Brand | scrape:read | true | true |
scrapeJson | Scrape JSON | scrape:read | false | true |
webSearch | Web Search | scrape:read | true | true |
Every tool sets destructiveHint: false. scrapeHtml, scrapeMarkdown,
getScreenshot, and scrapeJson are not marked read-only because they
always save their results to your dashboard Result tab. The six scraping and
search tools use tokens from your plan.
Examples use https://example.com as the sample target. Replace it for your
use case. Response examples show the envelope from structuredContent, with
selected keys and types observed in live API responses. Values are
placeholders; page content, base64 images, and arrays are abbreviated. Actual
responses may contain additional fields.
Shared parameters
The tools take the parameters documented for each service in the API reference, with these integration rules:
- A parameter with a default always sends it: when you leave it out, the
server sends the default shown in the tool's table. A parameter without a
default is sent only when you set it. For example, leaving
browserRenderingout tries the page without a browser first and switches to one if the request is blocked, whilefalsedisables the browser unless one is required. browserRenderingis sent as true wheneverwaitForSelectoris set, even if you chose false, and onscrapeHtmlwheneverscreenshotis true.- HTML, Markdown, screenshots, and JSON extraction always send
saveResult=true, so every result is saved to the dashboard Result tab and these four tools are not read-only. - Each tool sends its own fixed values:
html=trueandmarkdown=falsefor HTML;markdown=true,html=false, andscreenshot=falsefor Markdown;browserRendering=true,html=false, andmarkdown=falsefor screenshots;agent=generalfor JSON;action=brand-scrapingandbundle=nonefor brand;action=websearchfor search. - Query fields are sent in a fixed order. Booleans are sent as
trueorfalse, country codes in lowercase, and the search query trimmed.cookiesis sent as given, URL-encoded in the query string (for examplecookies=cookie_name%3Dvalue). - The HTTP deadline of HTML, Markdown, screenshots, and JSON extraction is
timeoutplus 30 seconds. - A call that sets a parameter missing from the tool's table is rejected.
The six scraping and search tools send GET requests to the Scraper API with
their inputs as query parameters:
GET https://api.mrscraper.comEvery tool's table below lists its exact parameters, types, and the defaults the server sends.
status
Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields.
status takes no service parameters and calls:
GET https://api.app.mrscraper.com/api/v1/subscription-accountsThe HTTP deadline is fixed at 600 seconds. It is not a service parameter.
Example
{
"name": "status",
"arguments": {}
}Response
The API body contains message and data. Account details remain nested in data, including subscriptionItem and scraperAllowance. The response envelope therefore exposes account details at data.data. Sensitive response headers are removed.
{
"status_code": 200,
"data": {
"message": "Example response",
"data": {
"id": "ACCOUNT_ID",
"tokenLimit": 100000,
"tokenUsage": 2500,
"stripeStatus": "active",
"user": {
"name": "Example user",
"email": "user@example.com",
"isVerified": true
},
"subscriptionItem": {
"name": "Example plan",
"tokenLimit": 100000
},
"scraperAllowance": {
"remaining": 97500,
"plans": [
{
"remaining": 97500
}
]
}
}
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}scrapeHtml
Retrieve the raw HTML of a page. Browser rendering is optional.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | integer (milliseconds) | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
screenshot | boolean | false | Capture a screenshot too (forces browser rendering). Set to true to include a screenshot, or false (default) for none. |
tokenCap | integer | Omitted | 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. |
cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: html=true, markdown=false, and saveResult=true.
Example
{
"name": "scrapeHtml",
"arguments": {
"url": "https://example.com",
"browserRendering": true,
"warmStart": true,
"waitForSelector": "body",
"timeout": 120,
"maxRetries": 0
}
}Response
The response body is HTML text. With screenshot set to true, it is JSON with html and the base64 screenshot.
{
"status_code": 200,
"data": "<html><body>Example page content...</body></html>",
"headers": {
"content-type": "text/html; charset=utf-8"
}
}scrapeMarkdown
Retrieve a page as clean Markdown. Browser rendering is optional.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | integer (milliseconds) | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
tokenCap | integer | Omitted | 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. |
cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: markdown=true, html=false, screenshot=false, and saveResult=true.
Example
{
"name": "scrapeMarkdown",
"arguments": {
"url": "https://example.com",
"warmStart": true
}
}Response
The response body is Markdown text.
{
"status_code": 200,
"data": "# Example page\n\nExample Markdown content...",
"headers": {
"content-type": "text/markdown; charset=utf-8"
}
}getScreenshot
Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
screenshot | string: full, top, or WIDTHxHEIGHT[-ZOOM] | "full" | full (default) captures the entire scroll height, top captures the first viewport, or a custom size WIDTHxHEIGHT with optional -ZOOM, e.g. 1280x800 or 1920x1080-75. Width/height 100 to 3840, zoom 25 to 300. |
timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | integer (milliseconds) | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
tokenCap | integer | Omitted | 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. |
cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: browserRendering=true, html=false, markdown=false, and saveResult=true.
Example
{
"name": "getScreenshot",
"arguments": {
"url": "https://example.com",
"screenshot": "1280x800"
}
}Response
The response body is JSON with the base64 PNG screenshot and the page html, which the API includes although html=false is sent.
{
"status_code": 200,
"data": {
"screenshot": "BASE64_PNG_DATA"
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}scrapeBrand
Extract a website's colors, typography, logos, and social links as JSON.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
The HTTP deadline is fixed at 120 seconds. It is not a service parameter.
The request always sends action=brand-scraping and bundle=none. No other parameters are accepted.
Example
{
"name": "scrapeBrand",
"arguments": {
"url": "https://example.com"
}
}Response
The API body contains message and a data object with job_id, status, url, final_url, brand, and error. Brand details are available at data.data.brand in the response envelope.
{
"status_code": 200,
"data": {
"data": {
"job_id": "JOB_ID",
"status": "succeeded",
"url": "https://example.com",
"final_url": "https://example.com",
"brand": {
"name": "Example brand",
"colors": {
"background": "#ffffff",
"text": "#222222"
},
"typography": {
"body": {
"font_family": "Example font"
}
}
},
"error": null,
"bundle_url": null
},
"message": "Example response"
},
"headers": {
"content-type": "application/json"
}
}scrapeJson
Extract structured JSON from a page using a natural-language prompt.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
prompt | string | "Extract all data as complete as possible." | Describe the data shape you want back (e.g. fields like title, price, rating). This prompt only parses the scraped content. It cannot instruct the scraper flow itself. |
html | boolean | true | Whether to include the page HTML in the response. |
browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | integer (milliseconds) | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
screenshot | boolean | false | Whether to include a base64 screenshot in the response. |
tokenCap | integer | Omitted | 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. |
Always sent: agent=general and saveResult=true. The request uses GET. If the encoded URL exceeds 8,000 characters, it switches to POST with url, prompt, and agent in the body; the other settings stay in the query.
Example
{
"name": "scrapeJson",
"arguments": {
"url": "https://example.com",
"prompt": "Extract the first 2 items with title and price.",
"browserRendering": true
}
}Response
Extracted data is in the API body's data field, with html unless disabled and screenshot when enabled. Response metadata includes thread_id, token_usage, status, error, runtime, and cookies. markdown, and screenshot when not requested, can be empty strings.
{
"status_code": 200,
"data": {
"success": true,
"data": [
{
"title": "Example item",
"price": "10.00"
}
],
"thread_id": "THREAD_ID",
"token_usage": 1,
"html": "<html>...</html>",
"markdown": "",
"screenshot": "",
"status": "Results ready",
"error": "",
"runtime": 1.23,
"cookies": []
},
"headers": {
"content-type": "application/json"
}
}webSearch
Search the web and return ranked results with titles, URLs, descriptions, and sources.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | Required | Search query text, trimmed before sending, containing 1 to 1000 characters. |
country | string | Omitted | Two-letter country code to search from, sent in lowercase. |
numResults | integer | 10 | Number of search results to request, as an integer from 10 to 100. Fewer results may be returned. |
Always sent: action=websearch.
The HTTP deadline is fixed at 120 seconds. It is not a service parameter.
Example
{
"name": "webSearch",
"arguments": {
"query": "site:example.com documentation",
"country": "id",
"numResults": 20
}
}Response
The API body contains success, message, a data array, and tokenUsage. Each result includes rank, title, url, description, and source.
{
"status_code": 200,
"data": {
"success": true,
"message": "Example response",
"data": [
{
"rank": 1,
"title": "Example result",
"url": "https://example.com",
"description": "Example result description.",
"source": "example.com"
}
],
"tokenUsage": 1
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}Troubleshooting
CLI
Install, authenticate, and use the MrScraper CLI to retrieve pages as HTML, Markdown, or screenshots, extract brand details and structured JSON, search the web, and check account status.
Billing
Compare MrScraper subscription plans, understand how token usage and billing cycles work, and choose the right plan for your scraping workload.