@mrscraper/sdk 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,15 +8,15 @@ An async JavaScript and TypeScript SDK for the seven MrScraper services.
8
8
 
9
9
  Seven services share the same descriptions, parameter meanings, and defaults across the CLI, SDKs, and integrations. Names, types, authentication, and code examples follow each surface's conventions. See the [API Reference](https://docs.mrscraper.com/docs/api/overview).
10
10
 
11
- | Service | Public name | Description |
12
- | ----------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
13
- | [Status](#status) | `status` | Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields. |
14
- | [Scrape HTML](#scrape-html) | `scrapeHtml` | Retrieve the raw HTML of a page. Browser rendering is optional. |
15
- | [Scrape Markdown](#scrape-markdown) | `scrapeMarkdown` | Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON. |
16
- | [Get screenshot](#get-screenshot) | `getScreenshot` | Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled. |
17
- | [Scrape brand](#scrape-brand) | `scrapeBrand` | Extract a website's colors, typography, logos, and social links as JSON. |
18
- | [Scrape JSON](#scrape-json) | `scrapeJson` | Extract structured JSON from a page using a natural-language prompt. Append Json Schema: and a JSON schema to shape the output. |
19
- | [Web search](#web-search) | `webSearch` | Search the web and return ranked results with titles, URLs, descriptions, and sources. |
11
+ | Service | Public name | Description |
12
+ | ----------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
13
+ | [Status](#status) | `status` | Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields. |
14
+ | [Scrape HTML](#scrape-html) | `scrapeHtml` | Retrieve the raw HTML of a page. Browser rendering is optional. |
15
+ | [Scrape Markdown](#scrape-markdown) | `scrapeMarkdown` | Retrieve a page as clean Markdown. Browser rendering is optional. |
16
+ | [Get screenshot](#get-screenshot) | `getScreenshot` | Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled. |
17
+ | [Scrape brand](#scrape-brand) | `scrapeBrand` | Extract a website's colors, typography, logos, and social links as JSON. |
18
+ | [Scrape JSON](#scrape-json) | `scrapeJson` | Extract structured JSON from a page using a natural-language prompt. Append Json Schema: and a JSON schema to shape the output. |
19
+ | [Web search](#web-search) | `webSearch` | Search the web and return ranked results with titles, URLs, descriptions, and sources. |
20
20
 
21
21
  ## Installation
22
22
 
@@ -59,11 +59,15 @@ Response examples show selected keys and types observed in live API responses. V
59
59
 
60
60
  ### Page controls
61
61
 
62
- HTML, Markdown, screenshots, and JSON extraction share `url`, `timeout`, `geoCode`, `proxyCountry`, `super`, `waitUntil`, `proxy`, `maxRetries`, and `saveResult` (using the naming style shown below). Page defaults are 300 seconds, US geolocation/proxy country, real-device routing off, and dashboard saving off. Omitted retry limits mean no limit. Exact types, defaults, and standard descriptions appear in each service table.
62
+ HTML, Markdown, screenshots, and JSON extraction share `url`, `timeout`, `waitForSelector`, `geoCode`, `maxAge`, and `maxRetries` (using the naming style shown below). Defaults are a 300-second timeout (up to 330) and a `maxAge` of 0 milliseconds, which always scrapes fresh; `maxAge` accepts up to 604800000 (7 days). `geoCode` and `maxRetries` are omitted unless set, so the API loads the page from the United States with no retry limit. Results are always saved to the dashboard (`saveResult=true`), and `tokenCap` is never sent. Exact types, defaults, and standard descriptions appear in each service table.
63
63
 
64
64
  ### Loading controls
65
65
 
66
- HTML, Markdown, and screenshots additionally accept `blockResources`, `waitForSelector`, and `returnCookie`. JSON extraction does not accept these controls. Browser rendering is optional for HTML, Markdown, and JSON; screenshots always enable it. Markdown with HTML also enables browser rendering.
66
+ HTML, Markdown, and JSON extraction also accept `browserRendering`, `warmStart`, and `blockResources`. `browserRendering` is omitted unless set: the API loads the page without a browser first and switches to one if the request is blocked, while `true` always renders and `false` never does. Screenshots always render in a browser: Get screenshot sends `browserRendering=true`, and so does Scrape HTML whenever a screenshot is set.
67
+
68
+ ### Fixed request fields
69
+
70
+ Each service adds its documented fixed fields automatically, so they are not service parameters: `html=true` and `markdown=false` for HTML (plus `browserRendering=true` when a screenshot is set), `markdown=true`, `html=false`, and `screenshot=false` for Markdown, `browserRendering=true`, `html=false`, and `markdown=false` for screenshots, `action=brand-scraping` and `bundle=none` for brand, `agent=general` for JSON extraction, and `action=websearch` for search. HTML, Markdown, screenshots, and JSON extraction also always send `saveResult=true`.
67
71
 
68
72
  ## Service reference
69
73
 
@@ -137,22 +141,20 @@ Retrieve the raw HTML of a page. Browser rendering is optional.
137
141
 
138
142
  #### Parameters
139
143
 
140
- | Parameter | HTTP field | Type | Default | Description |
141
- | ------------------ | ------------------ | ------------------------------------------------------------------ | -------------------- | ----------------------------------------------------------------------------------------------- |
142
- | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
143
- | `timeout` | `timeout` | number (integer) | `300` | Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. |
144
- | `geoCode` | `geoCode` | string | `"us"` | Two-letter country code to load the page from, sent in lowercase. |
145
- | `proxyCountry` | `proxyCountry` | string | `"us"` | Two-letter country code of the proxy server, sent in lowercase. |
146
- | `super` | `super` | boolean | `false` | Whether to route the request through real devices. |
147
- | `waitUntil` | `waitUntil` | string: `domcontentloaded`, `load`, `networkidle0`, `networkidle2` | `"domcontentloaded"` | Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. |
148
- | `proxy` | `proxy` | string | Omitted | Custom proxy URL used to load the page. |
149
- | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
150
- | `saveResult` | `saveResult` | boolean | `false` | Whether to save the result to the dashboard Result tab. |
151
- | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
152
- | `waitForSelector` | `waitForSelector` | string | Omitted | Wait for the page to contain the specified CSS selector before returning the result. |
153
- | `returnCookie` | `returnCookie` | boolean | `false` | Whether to include browser session cookies in the response. |
154
- | `browserRendering` | `browserRendering` | boolean | `false` | Whether to render the page in a browser before returning the result. |
155
- | `warmStart` | `warmStart` | boolean | `false` | Whether to enable warm start for more reliable scraping, at the cost of additional latency. |
144
+ | Parameter | HTTP field | Type | Default | Description |
145
+ | ------------------ | ------------------ | ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
+ | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
147
+ | `browserRendering` | `browserRendering` | boolean | Omitted | Whether to load the page in a browser: true always does and false never does. Omit it to load the page without a browser first and switch to a browser automatically if the request is blocked. |
148
+ | `timeout` | `timeout` | number (integer) | `300` | Maximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds. |
149
+ | `warmStart` | `warmStart` | boolean | `false` | Whether to open the site's home page first to warm the session before loading the target URL. |
150
+ | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
151
+ | `waitForSelector` | `waitForSelector` | string | Omitted | CSS selector or text to wait for on the page before returning the result, up to 500 characters. |
152
+ | `geoCode` | `geoCode` | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
153
+ | `maxAge` | `maxAge` | number (integer) | `0` | Return a cached result of the same request when it is newer than the selected age. A cached result costs the same tokens as the original scrape. |
154
+ | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
155
+ | `screenshot` | `screenshot` | `false` or string | `false` | Screenshot to capture with the HTML: false for none, full for the entire page, top for the first viewport, or a WIDTHxHEIGHT viewport from 100 to 3840 pixels with an optional -ZOOM percent from 25 to 300, such as 1280x800 or 1920x1080-75. Setting a screenshot also sends browserRendering=true. |
156
+
157
+ The request uses `html=true`, `markdown=false`, and `saveResult=true`. The screenshot is optional; setting one also sends `browserRendering=true`, because a screenshot needs a rendered page, and the response becomes JSON with `html` and `screenshot`.
156
158
 
157
159
  #### Example
158
160
 
@@ -171,9 +173,9 @@ console.log(result.data);
171
173
 
172
174
  #### Response
173
175
 
174
- The default response body is HTML text. Additional controls can cause the API to return JSON; the returned structure is preserved.
176
+ The response body is HTML text. With a screenshot, the API returns JSON containing html and a base64 screenshot.
175
177
 
176
- **Success response**
178
+ **Default HTML text**
177
179
 
178
180
  ```json
179
181
  {
@@ -185,31 +187,42 @@ The default response body is HTML text. Additional controls can cause the API to
185
187
  }
186
188
  ```
187
189
 
190
+ **With a screenshot**
191
+
192
+ ```json
193
+ {
194
+ "status_code": 200,
195
+ "data": {
196
+ "html": "<html>...</html>",
197
+ "screenshot": "BASE64_IMAGE_DATA"
198
+ },
199
+ "headers": {
200
+ "content-type": "application/json; charset=utf-8"
201
+ }
202
+ }
203
+ ```
204
+
188
205
  ### Scrape Markdown
189
206
 
190
207
  #### Description
191
208
 
192
- Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON.
209
+ Retrieve a page as clean Markdown. Browser rendering is optional.
193
210
 
194
211
  #### Parameters
195
212
 
196
- | Parameter | HTTP field | Type | Default | Description |
197
- | ------------------ | ------------------ | ------------------------------------------------------------------ | -------------------- | ----------------------------------------------------------------------------------------------- |
198
- | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
199
- | `timeout` | `timeout` | number (integer) | `300` | Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. |
200
- | `geoCode` | `geoCode` | string | `"us"` | Two-letter country code to load the page from, sent in lowercase. |
201
- | `proxyCountry` | `proxyCountry` | string | `"us"` | Two-letter country code of the proxy server, sent in lowercase. |
202
- | `super` | `super` | boolean | `false` | Whether to route the request through real devices. |
203
- | `waitUntil` | `waitUntil` | string: `domcontentloaded`, `load`, `networkidle0`, `networkidle2` | `"domcontentloaded"` | Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. |
204
- | `proxy` | `proxy` | string | Omitted | Custom proxy URL used to load the page. |
205
- | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
206
- | `saveResult` | `saveResult` | boolean | `false` | Whether to save the result to the dashboard Result tab. |
207
- | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
208
- | `waitForSelector` | `waitForSelector` | string | Omitted | Wait for the page to contain the specified CSS selector before returning the result. |
209
- | `returnCookie` | `returnCookie` | boolean | `false` | Whether to include browser session cookies in the response. |
210
- | `browserRendering` | `browserRendering` | boolean | `false` | Whether to render the page in a browser before returning the result. |
211
- | `warmStart` | `warmStart` | boolean | `false` | Whether to enable warm start for more reliable scraping, at the cost of additional latency. |
212
- | `html` | `html` | boolean | `false` | Whether to include the page HTML in the response. |
213
+ | Parameter | HTTP field | Type | Default | Description |
214
+ | ------------------ | ------------------ | ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
215
+ | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
216
+ | `browserRendering` | `browserRendering` | boolean | Omitted | Whether to load the page in a browser: true always does and false never does. Omit it to load the page without a browser first and switch to a browser automatically if the request is blocked. |
217
+ | `timeout` | `timeout` | number (integer) | `300` | Maximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds. |
218
+ | `warmStart` | `warmStart` | boolean | `false` | Whether to open the site's home page first to warm the session before loading the target URL. |
219
+ | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
220
+ | `waitForSelector` | `waitForSelector` | string | Omitted | CSS selector or text to wait for on the page before returning the result, up to 500 characters. |
221
+ | `geoCode` | `geoCode` | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
222
+ | `maxAge` | `maxAge` | number (integer) | `0` | Return a cached result of the same request when it is newer than the selected age. A cached result costs the same tokens as the original scrape. |
223
+ | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
224
+
225
+ The request uses `markdown=true`, `html=false`, `screenshot=false`, and `saveResult=true`.
213
226
 
214
227
  #### Example
215
228
 
@@ -217,30 +230,15 @@ Retrieve a page as Markdown. Including HTML also enables browser rendering and r
217
230
  import { scrapeMarkdown } from "@mrscraper/sdk";
218
231
 
219
232
  const result = await scrapeMarkdown("https://example.com", {
220
- html: true,
221
233
  warmStart: true,
234
+ maxAge: 86400000,
222
235
  });
223
236
  console.log(result.data);
224
237
  ```
225
238
 
226
239
  #### Response
227
240
 
228
- The default response body is Markdown text. Enabling HTML returns JSON containing both HTML and Markdown.
229
-
230
- **With html enabled**
231
-
232
- ```json
233
- {
234
- "status_code": 200,
235
- "data": {
236
- "html": "<html>...</html>",
237
- "markdown": "# Example page\n\n..."
238
- },
239
- "headers": {
240
- "content-type": "application/json"
241
- }
242
- }
243
- ```
241
+ The response body is Markdown text.
244
242
 
245
243
  **Default Markdown text**
246
244
 
@@ -258,27 +256,21 @@ The default response body is Markdown text. Enabling HTML returns JSON containin
258
256
 
259
257
  #### Description
260
258
 
261
- Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled.
259
+ Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
262
260
 
263
261
  #### Parameters
264
262
 
265
- | Parameter | HTTP field | Type | Default | Description |
266
- | ----------------- | ----------------- | ------------------------------------------------------------------ | -------------------- | ----------------------------------------------------------------------------------------------- |
267
- | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
268
- | `timeout` | `timeout` | number (integer) | `300` | Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. |
269
- | `geoCode` | `geoCode` | string | `"us"` | Two-letter country code to load the page from, sent in lowercase. |
270
- | `proxyCountry` | `proxyCountry` | string | `"us"` | Two-letter country code of the proxy server, sent in lowercase. |
271
- | `super` | `super` | boolean | `false` | Whether to route the request through real devices. |
272
- | `waitUntil` | `waitUntil` | string: `domcontentloaded`, `load`, `networkidle0`, `networkidle2` | `"domcontentloaded"` | Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. |
273
- | `proxy` | `proxy` | string | Omitted | Custom proxy URL used to load the page. |
274
- | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
275
- | `saveResult` | `saveResult` | boolean | `false` | Whether to save the result to the dashboard Result tab. |
276
- | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
277
- | `waitForSelector` | `waitForSelector` | string | Omitted | Wait for the page to contain the specified CSS selector before returning the result. |
278
- | `returnCookie` | `returnCookie` | boolean | `false` | Whether to include browser session cookies in the response. |
279
- | `screenshot` | `screenshot` | string: `full`, `top` | `"full"` | Screenshot area to capture: full for the entire page or top for the top viewport. |
280
- | `html` | `html` | boolean | `true` | Whether to include the page HTML in the response. |
281
- | `markdown` | `markdown` | boolean | `false` | Whether to include the page Markdown in the response. |
263
+ | Parameter | HTTP field | Type | Default | Description |
264
+ | ----------------- | ----------------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
265
+ | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
266
+ | `screenshot` | `screenshot` | string | `"full"` | Screenshot area to capture: full for the entire scroll height, top for the first viewport, or a WIDTHxHEIGHT viewport from 100 to 3840 pixels with an optional -ZOOM percent from 25 to 300, such as 1280x800 or 1920x1080-75. |
267
+ | `timeout` | `timeout` | number (integer) | `300` | Maximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds. |
268
+ | `waitForSelector` | `waitForSelector` | string | Omitted | CSS selector or text to wait for on the page before returning the result, up to 500 characters. |
269
+ | `geoCode` | `geoCode` | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
270
+ | `maxAge` | `maxAge` | number (integer) | `0` | Return a cached result of the same request when it is newer than the selected age. A cached result costs the same tokens as the original scrape. |
271
+ | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
272
+
273
+ The request uses `browserRendering=true`, `html=false`, `markdown=false`, and `saveResult=true`; these are not service parameters. `screenshot` defaults to `full` and also accepts `top` or a `WIDTHxHEIGHT[-ZOOM]` viewport. The API still includes the page HTML in the response.
282
274
 
283
275
  #### Example
284
276
 
@@ -287,15 +279,14 @@ import { getScreenshot } from "@mrscraper/sdk";
287
279
 
288
280
  const result = await getScreenshot("https://example.com", {
289
281
  screenshot: "top",
290
- html: false,
291
- markdown: true,
282
+ timeout: 120,
292
283
  });
293
284
  console.log(result.data);
294
285
  ```
295
286
 
296
287
  #### Response
297
288
 
298
- The response body contains a base64 screenshot and requested page outputs. The API can still include HTML when HTML output is disabled.
289
+ The response body is JSON containing a base64 PNG screenshot and the page HTML, which the API includes even though html=false is sent.
299
290
 
300
291
  **Success response**
301
292
 
@@ -304,8 +295,7 @@ The response body contains a base64 screenshot and requested page outputs. The A
304
295
  "status_code": 200,
305
296
  "data": {
306
297
  "html": "<html>...</html>",
307
- "screenshot": "BASE64_PNG_DATA",
308
- "markdown": "# Example page\n\n..."
298
+ "screenshot": "BASE64_PNG_DATA"
309
299
  },
310
300
  "headers": {
311
301
  "content-type": "application/json; charset=utf-8"
@@ -384,23 +374,22 @@ Extract structured JSON from a page using a natural-language prompt. Append Json
384
374
 
385
375
  #### Parameters
386
376
 
387
- | Parameter | HTTP field | Type | Default | Description |
388
- | ------------------ | ------------------ | ------------------------------------------------------------------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
389
- | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
390
- | `timeout` | `timeout` | number (integer) | `300` | Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. |
391
- | `geoCode` | `geoCode` | string | `"us"` | Two-letter country code to load the page from, sent in lowercase. |
392
- | `proxyCountry` | `proxyCountry` | string | `"us"` | Two-letter country code of the proxy server, sent in lowercase. |
393
- | `super` | `super` | boolean | `false` | Whether to route the request through real devices. |
394
- | `waitUntil` | `waitUntil` | string: `domcontentloaded`, `load`, `networkidle0`, `networkidle2` | `"domcontentloaded"` | Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. |
395
- | `proxy` | `proxy` | string | Omitted | Custom proxy URL used to load the page. |
396
- | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
397
- | `saveResult` | `saveResult` | boolean | `false` | Whether to save the result to the dashboard Result tab. |
398
- | `prompt` | `prompt` | string | `"Extract all data as complete as possible."` | Instructions describing the data to extract. Append Json Schema: and a JSON schema to shape the output. |
399
- | `browserRendering` | `browserRendering` | boolean | `false` | Whether to render the page in a browser before returning the result. |
400
- | `html` | `html` | boolean | `false` | Whether to include the page HTML in the response. |
401
- | `screenshot` | `screenshot` | boolean | `false` | Whether to include a base64 screenshot in the response. |
402
-
403
- The request uses `agent=general` and GET. If the encoded URL exceeds 8,000 characters, it switches to POST with `url`, `prompt`, and `agent` in the body; page controls remain in the query.
377
+ | Parameter | HTTP field | Type | Default | Description |
378
+ | ------------------ | ------------------ | ---------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
379
+ | `url` | `url` | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
380
+ | `prompt` | `prompt` | string | `"Extract all data as complete as possible."` | Instructions describing the data to extract. Append Json Schema: and a JSON schema to shape the output. |
381
+ | `html` | `html` | boolean | `true` | Whether to include the page HTML in the response. |
382
+ | `browserRendering` | `browserRendering` | boolean | Omitted | Whether to load the page in a browser: true always does and false never does. Omit it to load the page without a browser first and switch to a browser automatically if the request is blocked. |
383
+ | `timeout` | `timeout` | number (integer) | `300` | Maximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds. |
384
+ | `warmStart` | `warmStart` | boolean | `false` | Whether to open the site's home page first to warm the session before loading the target URL. |
385
+ | `blockResources` | `blockResources` | boolean | `false` | Whether to block images, fonts, and stylesheets while loading the page. |
386
+ | `waitForSelector` | `waitForSelector` | string | Omitted | CSS selector or text to wait for on the page before returning the result, up to 500 characters. |
387
+ | `geoCode` | `geoCode` | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
388
+ | `maxAge` | `maxAge` | number (integer) | `0` | Return a cached result of the same request when it is newer than the selected age. A cached result costs the same tokens as the original scrape. |
389
+ | `maxRetries` | `maxRetries` | number (integer) | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
390
+ | `screenshot` | `screenshot` | boolean | `false` | Whether to include a base64 screenshot in the response. |
391
+
392
+ The request uses `agent=general`, `saveResult=true`, and GET. If the encoded URL exceeds 8,000 characters, it switches to POST with `url`, `prompt`, and `agent` in the body; page controls remain in the query.
404
393
 
405
394
  #### Example
406
395
 
@@ -417,7 +406,7 @@ console.log(result.data);
417
406
 
418
407
  #### Response
419
408
 
420
- Extraction results are in the API body's data field and follow the requested schema. Response metadata includes thread_id, token_usage, status, error, runtime, and cookies. html, markdown, and screenshot can be empty strings when not requested.
409
+ Extraction results are in the API body's data field and follow the requested schema. Response metadata includes thread_id, token_usage, status, error, runtime, and cookies. html contains the page HTML unless disabled; markdown and screenshot can be empty strings.
421
410
 
422
411
  **Success response**
423
412
 
@@ -434,7 +423,7 @@ Extraction results are in the API body's data field and follow the requested sch
434
423
  ],
435
424
  "thread_id": "THREAD_ID",
436
425
  "token_usage": 1,
437
- "html": "",
426
+ "html": "<html>...</html>",
438
427
  "markdown": "",
439
428
  "screenshot": "",
440
429
  "status": "Results ready",
@@ -459,11 +448,13 @@ Search the web and return ranked results with titles, URLs, descriptions, and so
459
448
  | Parameter | HTTP field | Type | Default | Description |
460
449
  | ------------ | ------------ | ---------------- | -------- | ------------------------------------------------------------------------------------------------- |
461
450
  | `query` | `query` | string | Required | Search query text, trimmed before sending, containing 1 to 1000 characters. |
462
- | `country` | `country` | string | `"us"` | Two-letter country code to search from, sent in lowercase. |
451
+ | `country` | `country` | string | Omitted | Two-letter country code to search from, sent in lowercase. |
463
452
  | `numResults` | `numResults` | number (integer) | `10` | Number of search results to request, as an integer from 10 to 100. Fewer results may be returned. |
464
453
 
465
454
  The HTTP deadline is fixed at 120 seconds. It is not a service parameter.
466
455
 
456
+ The request uses `action=websearch`. `country` is omitted unless set, so the API searches from the United States.
457
+
467
458
  #### Example
468
459
 
469
460
  ```js
@@ -541,7 +532,7 @@ try {
541
532
 
542
533
  ### Configuration
543
534
 
544
- Functions return promises and use camelCase options. Omit optional controls or use `undefined`; explicit `false` and `0` are preserved. TypeScript exports include `PageOptions`, `HtmlOptions`, `MarkdownOptions`, `ScreenshotOptions`, `JsonOptions`, `WebSearchOptions`, `StatusOptions`, and `MrScraperResponse<T>`.
535
+ Functions return promises and use camelCase options. Omit optional controls or use `undefined`; explicit `false` and `0` are preserved. TypeScript exports include `PageOptions`, `LoadingOptions`, `HtmlOptions`, `MarkdownOptions`, `ScreenshotOptions`, `JsonOptions`, `WebSearchOptions`, `StatusOptions`, and `MrScraperResponse<T>`.
545
536
 
546
537
  ### Advanced usage
547
538
 
@@ -572,11 +563,7 @@ if (
572
563
 
573
564
  ### Troubleshooting
574
565
 
575
- Check environment credentials when authentication fails. Use camelCase option names and `super`, rather than old snake_case options or `superMode`. Page timeouts are integers from 1 to 300; status and search do not expose timeout options.
576
-
577
- ## Migration
578
-
579
- Replace `account()` with `status()` and read the raw API body. Remove status/search timeout options and rename `superMode` to `super`. Replace combined scraper calls with `scrapeHtml`, `scrapeMarkdown`, or `getScreenshot`; use camelCase options. Replace `full_page` with `screenshot: "full"` or `"top"`. Search uses `query`, `country`, and `numResults`.
566
+ Check environment credentials when authentication fails. Use camelCase option names rather than snake_case. Page timeouts are integers from 1 to 330; status and search do not expose timeout options.
580
567
 
581
568
  ## Development and testing
582
569
 
package/dist/api.d.ts CHANGED
@@ -12,58 +12,48 @@ export interface StatusOptions {
12
12
  /** API key used to authenticate the request. */
13
13
  token?: string;
14
14
  }
15
- export type WaitUntil = "domcontentloaded" | "load" | "networkidle0" | "networkidle2";
15
+ /** Page controls shared by HTML, Markdown, screenshots, and JSON extraction. */
16
16
  export interface PageOptions {
17
17
  /** API key used to authenticate the request. */
18
18
  token?: string;
19
- /** Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. */
19
+ /** Maximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds. */
20
20
  timeout?: number;
21
+ /** CSS selector or text to wait for on the page before returning the result, up to 500 characters. */
22
+ waitForSelector?: string;
21
23
  /** Two-letter country code to load the page from, sent in lowercase. */
22
24
  geoCode?: string;
23
- /** Two-letter country code of the proxy server, sent in lowercase. */
24
- proxyCountry?: string;
25
- /** Whether to route the request through real devices. */
26
- super?: boolean;
27
- /** Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. */
28
- waitUntil?: WaitUntil;
29
- /** Custom proxy URL used to load the page. */
30
- proxy?: string;
25
+ /** Return a cached result of the same request when it is newer than the selected age. A cached result costs the same tokens as the original scrape. */
26
+ maxAge?: number;
31
27
  /** Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. */
32
28
  maxRetries?: number;
33
- /** Whether to save the result to the dashboard Result tab. */
34
- saveResult?: boolean;
35
29
  }
30
+ /** Loading controls accepted by HTML, Markdown, and JSON extraction. */
36
31
  export interface LoadingOptions {
32
+ /** Whether to load the page in a browser: true always does and false never does. Omit it to load the page without a browser first and switch to a browser automatically if the request is blocked. */
33
+ browserRendering?: boolean;
34
+ /** Whether to open the site's home page first to warm the session before loading the target URL. */
35
+ warmStart?: boolean;
37
36
  /** Whether to block images, fonts, and stylesheets while loading the page. */
38
37
  blockResources?: boolean;
39
- /** Wait for the page to contain the specified CSS selector before returning the result. */
40
- waitForSelector?: string;
41
- /** Whether to include browser session cookies in the response. */
42
- returnCookie?: boolean;
43
38
  }
39
+ /** Screenshot area: full, top, or a WIDTHxHEIGHT viewport with an optional -ZOOM percent. */
40
+ export type ScreenshotArea = "full" | "top" | `${number}x${number}` | `${number}x${number}-${number}`;
41
+ /** Scrape HTML screenshot: false for none, or a screenshot area. */
42
+ export type ScreenshotCapture = false | ScreenshotArea;
44
43
  export interface HtmlOptions extends PageOptions, LoadingOptions {
45
- /** Whether to enable warm start for more reliable scraping, at the cost of additional latency. */
46
- warmStart?: boolean;
47
- /** Whether to render the page in a browser before returning the result. */
48
- browserRendering?: boolean;
44
+ /** Screenshot to capture with the HTML: false for none, full for the entire page, top for the first viewport, or a WIDTHxHEIGHT viewport from 100 to 3840 pixels with an optional -ZOOM percent from 25 to 300, such as 1280x800 or 1920x1080-75. Setting a screenshot also sends browserRendering=true. */
45
+ screenshot?: ScreenshotCapture;
49
46
  }
50
- export interface MarkdownOptions extends HtmlOptions {
51
- /** Whether to include the page HTML in the response. */
52
- html?: boolean;
47
+ /** Scrape Markdown accepts the shared page and loading controls. */
48
+ export interface MarkdownOptions extends PageOptions, LoadingOptions {
53
49
  }
54
- export interface ScreenshotOptions extends PageOptions, LoadingOptions {
55
- /** Screenshot area to capture: full for the entire page or top for the top viewport. */
56
- screenshot?: "full" | "top";
57
- /** Whether to include the page HTML in the response. */
58
- html?: boolean;
59
- /** Whether to include the page Markdown in the response. */
60
- markdown?: boolean;
50
+ export interface ScreenshotOptions extends PageOptions {
51
+ /** Screenshot area to capture: full for the entire scroll height, top for the first viewport, or a WIDTHxHEIGHT viewport from 100 to 3840 pixels with an optional -ZOOM percent from 25 to 300, such as 1280x800 or 1920x1080-75. */
52
+ screenshot?: ScreenshotArea;
61
53
  }
62
- export interface JsonOptions extends PageOptions {
54
+ export interface JsonOptions extends PageOptions, LoadingOptions {
63
55
  /** Instructions describing the data to extract. Append Json Schema: and a JSON schema to shape the output. */
64
56
  prompt?: string;
65
- /** Whether to render the page in a browser before returning the result. */
66
- browserRendering?: boolean;
67
57
  /** Whether to include the page HTML in the response. */
68
58
  html?: boolean;
69
59
  /** Whether to include a base64 screenshot in the response. */
@@ -112,12 +102,12 @@ export declare function status<T = unknown>(options?: StatusOptions): Promise<Mr
112
102
  * @param options Service options and authentication.
113
103
  */
114
104
  export declare function scrapeHtml<T = PageData>(url: string, options?: HtmlOptions): Promise<MrScraperResponse<T>>;
115
- /** Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON.
105
+ /** Retrieve a page as clean Markdown. Browser rendering is optional.
116
106
  * @param url Absolute HTTP or HTTPS URL of the page to process.
117
107
  * @param options Service options and authentication.
118
108
  */
119
109
  export declare function scrapeMarkdown<T = PageData>(url: string, options?: MarkdownOptions): Promise<MrScraperResponse<T>>;
120
- /** Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled.
110
+ /** Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
121
111
  * @param url Absolute HTTP or HTTPS URL of the page to process.
122
112
  * @param options Service options and authentication.
123
113
  */
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAK7C;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,SAAS,GACnB,kBAAkB,GAAG,MAAM,GAAG,cAAc,GAAG,cAAc,CAAC;AAChE,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAA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/B;AACD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,GAAG,OAAO,EAC1C,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAmC/B;AACD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,OAAO,EAC3C,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAM/B;AACD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,CAAC,GAAG,iBAAiB,EACnD,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAiB/B"}
package/dist/api.js CHANGED
@@ -102,6 +102,11 @@ export async function status(options = {}) {
102
102
  ].includes(key.toLowerCase()))),
103
103
  };
104
104
  }
105
+ const MAX_TIMEOUT_SECONDS = 330;
106
+ const MAX_SELECTOR_LENGTH = 500;
107
+ // Seven days, the oldest cached result the Scraper API serves.
108
+ const MAX_CACHE_AGE_MS = 604800000;
109
+ const SCREENSHOT_VIEWPORT = /^(\d{3,4})x(\d{3,4})(?:-(\d{2,3}))?$/;
105
110
  function integer(name, value, min, max = Number.MAX_SAFE_INTEGER) {
106
111
  if (!Number.isSafeInteger(value) || value < min || value > max)
107
112
  throw new RangeError(`${name} must be an integer from ${min} to ${max}`);
@@ -112,6 +117,15 @@ function text(name, value) {
112
117
  throw new TypeError(`${name} must be a non-empty string`);
113
118
  return value.trim();
114
119
  }
120
+ function optionalText(name, value) {
121
+ return value === undefined ? undefined : text(name, value);
122
+ }
123
+ function selector(value) {
124
+ const result = optionalText("waitForSelector", value);
125
+ if (result !== undefined && [...result].length > MAX_SELECTOR_LENGTH)
126
+ throw new RangeError(`waitForSelector must be at most ${MAX_SELECTOR_LENGTH} characters`);
127
+ return result;
128
+ }
115
129
  function pageUrl(value) {
116
130
  let parsed;
117
131
  try {
@@ -134,33 +148,80 @@ function boolean(name, value) {
134
148
  throw new TypeError(`${name} must be a boolean`);
135
149
  return value;
136
150
  }
137
- function pageParams(url, options) {
138
- const { timeout = 300, geoCode = "us", proxyCountry = "us", super: superRouting = false, waitUntil = "domcontentloaded", proxy, maxRetries, saveResult = false, } = options;
139
- if (!["domcontentloaded", "load", "networkidle0", "networkidle2"].includes(waitUntil))
140
- throw new TypeError("Invalid waitUntil event");
141
- const params = {
151
+ /** Whether a value is full, top, or a WIDTHxHEIGHT viewport with an optional -ZOOM. */
152
+ function isScreenshotArea(value) {
153
+ if (value === "full" || value === "top")
154
+ return true;
155
+ const match = typeof value === "string" ? SCREENSHOT_VIEWPORT.exec(value) : null;
156
+ if (!match)
157
+ return false;
158
+ const width = Number(match[1]);
159
+ const height = Number(match[2]);
160
+ const zoom = match[3] === undefined ? 100 : Number(match[3]);
161
+ return (width >= 100 &&
162
+ width <= 3840 &&
163
+ height >= 100 &&
164
+ height <= 3840 &&
165
+ zoom >= 25 &&
166
+ zoom <= 300);
167
+ }
168
+ const SCREENSHOT_AREA_HINT = "WIDTHxHEIGHT from 100 to 3840 pixels with an optional -ZOOM from 25 to 300, such as 1280x800 or 1920x1080-75";
169
+ /** Scrape HTML screenshot: false, full, top, or a custom viewport. */
170
+ function screenshotCapture(value) {
171
+ if (value === false || isScreenshotArea(value))
172
+ return value;
173
+ throw new TypeError(`screenshot must be false, full, top, or ${SCREENSHOT_AREA_HINT}`);
174
+ }
175
+ /** Get screenshot area: full, top, or a custom viewport. */
176
+ function screenshotArea(value) {
177
+ if (isScreenshotArea(value))
178
+ return value;
179
+ throw new TypeError(`screenshot must be full, top, or ${SCREENSHOT_AREA_HINT}`);
180
+ }
181
+ /** Drop omitted fields; explicit false and 0 are sent. */
182
+ function compact(fields) {
183
+ const params = {};
184
+ for (const [key, value] of Object.entries(fields))
185
+ if (value !== undefined)
186
+ params[key] = value;
187
+ return params;
188
+ }
189
+ function pageFields(url, options) {
190
+ const { timeout = 300, waitForSelector, geoCode, maxAge = 0, maxRetries, } = options;
191
+ return {
142
192
  url: pageUrl(url),
143
- timeout: integer("timeout", timeout, 1, 300),
144
- geoCode: country("geoCode", geoCode),
145
- proxyCountry: country("proxyCountry", proxyCountry),
146
- super: boolean("super", superRouting),
147
- waitUntil,
148
- saveResult: boolean("saveResult", saveResult),
193
+ timeout: integer("timeout", timeout, 1, MAX_TIMEOUT_SECONDS),
194
+ waitForSelector: selector(waitForSelector),
195
+ geoCode: geoCode === undefined ? undefined : country("geoCode", geoCode),
196
+ maxAge: integer("maxAge", maxAge, 0, MAX_CACHE_AGE_MS),
197
+ maxRetries: maxRetries === undefined
198
+ ? undefined
199
+ : integer("maxRetries", maxRetries, 0),
149
200
  };
150
- if (proxy !== undefined)
151
- params.proxy = text("proxy", proxy);
152
- if (maxRetries !== undefined)
153
- params.maxRetries = integer("maxRetries", maxRetries, 0);
154
- return params;
155
201
  }
156
- function loadingParams(options) {
157
- const params = {
202
+ function loadingFields(options) {
203
+ return {
204
+ browserRendering: options.browserRendering === undefined
205
+ ? undefined
206
+ : boolean("browserRendering", options.browserRendering),
207
+ warmStart: boolean("warmStart", options.warmStart ?? false),
158
208
  blockResources: boolean("blockResources", options.blockResources ?? false),
159
- returnCookie: boolean("returnCookie", options.returnCookie ?? false),
160
209
  };
161
- if (options.waitForSelector !== undefined)
162
- params.waitForSelector = text("waitForSelector", options.waitForSelector);
163
- return params;
210
+ }
211
+ /** Shared page and loading fields in the documented request order. */
212
+ function sharedFields(page, loading = {}) {
213
+ return {
214
+ browserRendering: loading.browserRendering,
215
+ timeout: page.timeout,
216
+ warmStart: loading.warmStart,
217
+ blockResources: loading.blockResources,
218
+ waitForSelector: page.waitForSelector,
219
+ geoCode: page.geoCode,
220
+ // Results are always saved to the dashboard; saveResult is not an option.
221
+ saveResult: true,
222
+ maxAge: page.maxAge,
223
+ maxRetries: page.maxRetries,
224
+ };
164
225
  }
165
226
  function endpoint(params) {
166
227
  const result = new URL(process.env.MRSCRAPER_FETCH_BASE_URL || "https://api.mrscraper.com");
@@ -177,52 +238,50 @@ async function get(params, options, timeout) {
177
238
  * @param options Service options and authentication.
178
239
  */
179
240
  export async function scrapeHtml(url, options = {}) {
180
- const params = {
181
- ...pageParams(url, options),
182
- ...loadingParams(options),
183
- browserRendering: boolean("browserRendering", options.browserRendering ?? false),
184
- warmStart: boolean("warmStart", options.warmStart ?? false),
241
+ const page = pageFields(url, options);
242
+ const loading = loadingFields(options);
243
+ const screenshot = screenshotCapture(options.screenshot ?? false);
244
+ // A screenshot needs a rendered page, so it always sends browserRendering=true.
245
+ if (screenshot !== false)
246
+ loading.browserRendering = true;
247
+ const params = compact({
248
+ url: page.url,
185
249
  html: true,
186
250
  markdown: false,
187
- screenshot: false,
188
- };
189
- return get(params, options, Number(params.timeout) + 30);
251
+ ...sharedFields(page, loading),
252
+ screenshot,
253
+ });
254
+ return get(params, options, page.timeout + 30);
190
255
  }
191
- /** Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON.
256
+ /** Retrieve a page as clean Markdown. Browser rendering is optional.
192
257
  * @param url Absolute HTTP or HTTPS URL of the page to process.
193
258
  * @param options Service options and authentication.
194
259
  */
195
260
  export async function scrapeMarkdown(url, options = {}) {
196
- const html = boolean("html", options.html ?? false);
197
- const browserRendering = boolean("browserRendering", options.browserRendering ?? false);
198
- const params = {
199
- ...pageParams(url, options),
200
- ...loadingParams(options),
201
- browserRendering: html || browserRendering,
202
- warmStart: boolean("warmStart", options.warmStart ?? false),
203
- html,
261
+ const page = pageFields(url, options);
262
+ const params = compact({
263
+ url: page.url,
204
264
  markdown: true,
265
+ html: false,
205
266
  screenshot: false,
206
- };
207
- return get(params, options, Number(params.timeout) + 30);
267
+ ...sharedFields(page, loadingFields(options)),
268
+ });
269
+ return get(params, options, page.timeout + 30);
208
270
  }
209
- /** Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled.
271
+ /** Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
210
272
  * @param url Absolute HTTP or HTTPS URL of the page to process.
211
273
  * @param options Service options and authentication.
212
274
  */
213
275
  export async function getScreenshot(url, options = {}) {
214
- const screenshot = options.screenshot ?? "full";
215
- if (!["full", "top"].includes(screenshot))
216
- throw new TypeError("screenshot must be full or top");
217
- const params = {
218
- ...pageParams(url, options),
219
- ...loadingParams(options),
220
- browserRendering: true,
221
- screenshot,
222
- html: boolean("html", options.html ?? true),
223
- markdown: boolean("markdown", options.markdown ?? false),
224
- };
225
- return get(params, options, Number(params.timeout) + 30);
276
+ const page = pageFields(url, options);
277
+ const params = compact({
278
+ url: page.url,
279
+ screenshot: screenshotArea(options.screenshot === undefined ? "full" : options.screenshot),
280
+ html: false,
281
+ markdown: false,
282
+ ...sharedFields(page, { browserRendering: true }),
283
+ });
284
+ return get(params, options, page.timeout + 30);
226
285
  }
227
286
  /** Extract structured JSON from a page using a natural-language prompt. Append Json Schema: and a JSON schema to shape the output.
228
287
  * @param url Absolute HTTP or HTTPS URL of the page to process.
@@ -231,16 +290,19 @@ export async function getScreenshot(url, options = {}) {
231
290
  export async function scrapeJson(url, options = {}) {
232
291
  const prompt = options.prompt ?? DEFAULT_JSON_PROMPT;
233
292
  text("prompt", prompt);
234
- const params = {
235
- ...pageParams(url, options),
236
- browserRendering: boolean("browserRendering", options.browserRendering ?? false),
237
- html: boolean("html", options.html ?? false),
238
- screenshot: boolean("screenshot", options.screenshot ?? false),
239
- agent: "general",
293
+ const html = boolean("html", options.html ?? true);
294
+ const screenshot = boolean("screenshot", options.screenshot ?? false);
295
+ const page = pageFields(url, options);
296
+ const params = compact({
297
+ url: page.url,
240
298
  prompt,
241
- };
299
+ agent: "general",
300
+ html,
301
+ ...sharedFields(page, loadingFields(options)),
302
+ screenshot,
303
+ });
242
304
  const token = requireToken(options.token);
243
- const timeout = Number(params.timeout) + 30;
305
+ const timeout = page.timeout + 30;
244
306
  const getUrl = endpoint(params);
245
307
  if (getUrl.length <= 8000)
246
308
  return request("GET", getUrl, undefined, authHeaders(token), timeout, token);
@@ -262,11 +324,13 @@ export async function webSearch(query, options = {}) {
262
324
  const value = text("query", query);
263
325
  if ([...value].length > 1000)
264
326
  throw new RangeError("query must be 1 to 1000 characters");
265
- return get({
327
+ return get(compact({
266
328
  action: "websearch",
267
329
  query: value,
268
- country: country("country", options.country ?? "us"),
330
+ country: options.country === undefined
331
+ ? undefined
332
+ : country("country", options.country),
269
333
  numResults: integer("numResults", options.numResults ?? 10, 10, 100),
270
- }, options, 120);
334
+ }), options, 120);
271
335
  }
272
336
  //# sourceMappingURL=api.js.map
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,MAAM,CAAqB;IAEpC,YAAY,OAAe,EAAE,MAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAuGD,MAAM,CAAC,MAAM,mBAAmB,GAAG,2CAA2C,CAAC;AAC/E,0EAA0E;AAC1E,0DAA0D;AAE1D,MAAM,UAAU,YAAY,CAAC,aAAsB;IACjD,MAAM,KAAK,GACT,aAAa;QACb,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC/B,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,EAAE,CAAC;IACL,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,cAAc,CACtB,0HAA0H,CAC3H,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO;QACL,cAAc,EAAE,kBAAkB;QAClC,MAAM,EAAE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C/D,OAAO,EACP,GAAG,CACJ,CAAC;AACJ,CAAC;AACD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAa,EACb,UAA4B,EAAE;IAE9B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI;QAC1B,MAAM,IAAI,UAAU,CAAC,oCAAoC,CAAC,CAAC;IAC7D,OAAO,GAAG,CACR,OAAO,CAAC;QACN,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,KAAK;QACZ,OAAO,EACL,OAAO,CAAC,OAAO,KAAK,SAAS;YAC3B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC;QACzC,UAAU,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;KACrE,CAAC,EACF,OAAO,EACP,GAAG,CACJ,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { MrScraperError, status, scrapeHtml, scrapeMarkdown, getScreenshot, scrapeBrand, scrapeJson, webSearch, } from "./api.js";
2
- export type { StatusOptions, PageOptions, LoadingOptions, HtmlOptions, MarkdownOptions, ScreenshotOptions, JsonOptions, BrandOptions, PageData, WaitUntil, WebSearchOptions, WebSearchResult, WebSearchResponse, MrScraperResponse, } from "./api.js";
2
+ export type { StatusOptions, PageOptions, LoadingOptions, HtmlOptions, MarkdownOptions, ScreenshotOptions, JsonOptions, BrandOptions, PageData, ScreenshotArea, ScreenshotCapture, WebSearchOptions, WebSearchResult, WebSearchResponse, MrScraperResponse, } from "./api.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrscraper/sdk",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Official MrScraper SDK: status, HTML, Markdown, screenshots, brand, JSON extraction, and web search.",
5
5
  "license": "MIT",
6
6
  "type": "module",