# API Parameters

Parameters are being used to customize each request to the API. Understanding how to use these parameters will allow you to reach the full potential of the BrowserAPI and better interact with the targeted URL.

{% hint style="warning" %}
Because BrowserAPI offers high-level customization it will no longer have complete control over the scraping performance, so using this feature means charging 100% of the requests (both successful and failed).
{% endhint %}

Below is a list of all the parameters available in our API:

### #1: Required Parameters

<table><thead><tr><th width="232">Parameter</th><th width="107" align="center">Type</th><th width="294">Description</th><th width="114" align="center">More</th></tr></thead><tbody><tr><td><code>api_key</code><br><mark style="color:red;background-color:red;">Required</mark></td><td align="center"><code>string</code></td><td>Used for authentication</td><td align="center"><a href="../authentication#the-api-key">learn</a></td></tr><tr><td><code>url</code><br><mark style="color:red;background-color:red;">Required</mark></td><td align="center"><code>string</code></td><td><p>Specify the URL of the web page you would like to scrape.</p><p><br><strong>IMPORTANT:</strong> <strong>Please make sure you URL encode the value of this parameter!</strong></p></td><td align="center"><a href="../../basic-api-requests#the-url-parameter">learn</a></td></tr></tbody></table>

### #2: Optional Parameters

<table><thead><tr><th width="232">Parameter</th><th width="109" align="center">Type</th><th width="299">Description</th><th width="114" align="center">More</th></tr></thead><tbody><tr><td><code>country</code></td><td align="center"><code>string</code></td><td>Specify the 2-letter code of the country you would like to use as a proxy geolocation for your scraping API request. Please refer to the Geolocation section for details.</td><td align="center"><a href="../advanced-api-features/geolocation">learn</a></td></tr><tr><td><code>timeout</code></td><td align="center"><code>int</code></td><td><p>Specify the maximum timeout in milliseconds you would like to use for your scraping API request. In order to force a timeout, you can specify a number such as <code>1000</code>.</p><p>This will abort the request after 1000ms and throw an error. The maximum (and default) value for this parameter is <code>120000</code>.</p></td><td align="center"><a href="../advanced-api-features/forcing-timeouts">learn</a></td></tr><tr><td><code>device</code></td><td align="center"><code>string</code></td><td>Set <code>desktop</code> (default), <code>mobile</code> or <code>tablet</code>, depending on whether the device type you want to your for your scraping request.</td><td align="center"><a href="../advanced-api-features/device-type">learn</a></td></tr><tr><td><code>wait_until</code></td><td align="center"><code>string</code></td><td>Specify the option you would like to use as conditional for your scraping API request. Possible values are <code>domcontentloaded</code> (default), <code>load</code>, <code>networkidle0</code> and <code>networkidle2</code>.</td><td align="center"><a href="../../advanced-api-features/awaiting#the-wait_until-parameter">learn</a></td></tr><tr><td><code>wait_for</code></td><td align="center"><code>int</code></td><td><p>Some websites may use JavaScript frameworks that may require a few extra seconds to load their content.</p><p>This parameters specifies the time in milliseconds to wait for the website. Possible values for this parameter are in the range [100, 60000].</p></td><td align="center"><a href="../../advanced-api-features/awaiting#the-wait_for-parameter">learn</a></td></tr><tr><td><code>wait_for_css</code></td><td align="center"><code>string</code></td><td>Specify a CSS selector and the API will wait <code>timeout</code> seconds until the selector appears. The default value of the <code>timeout</code> is 120000.</td><td align="center"><a href="../../advanced-api-features/awaiting#the-wait_for_css-parameter">learn</a></td></tr><tr><td><code>window_width</code></td><td align="center"><code>int</code></td><td>Adjust the width of the web browser's Viewport.</td><td align="center"><a href="../../advanced-api-features/viewport-sizing#the-window_width-parameter">learn</a></td></tr><tr><td><code>window_height</code></td><td align="center"><code>int</code></td><td>Adjust the height of the web browser's Viewport.</td><td align="center"><a href="../../advanced-api-features/viewport-sizing#the-window_height-parameter">learn</a></td></tr><tr><td><code>screenshot</code></td><td align="center"><code>boolean</code></td><td>Set to <code>1</code> to get the scraped website as a screenshot.</td><td align="center"><a href="../advanced-api-features/screenshot">learn</a></td></tr><tr><td><code>screenshot_options</code></td><td align="center"><code>object</code></td><td><p>Of type <code>object</code> , this parameter is used to set the screenshot to return custom window sizing, full page or single CSS selector.</p><p><br>*Can only be used when the parameter <code>screenshot=1</code> is activated</p></td><td align="center"><a href="../advanced-api-features/screenshot-options">learn</a></td></tr><tr><td><code>extract_rules</code></td><td align="center"><code>object</code></td><td>Get the scraped website based on various extraction rules.</td><td align="center"><a href="../advanced-api-features/extraction-rules">learn</a></td></tr><tr><td><code>json_response</code></td><td align="center"><code>boolean</code></td><td>Have the API return an JSON object instead of the plain HTML scraped from the URL.</td><td align="center"><a href="../advanced-api-features/full-json-response">learn</a></td></tr><tr><td><code>json_dom</code></td><td align="center"><code>boolean</code></td><td>Get the scraped website in JSON format. It can be set to <code>0</code> (default) or <code>1</code>.</td><td align="center"><a href="../advanced-api-features/json-dom-response">learn</a></td></tr><tr><td><code>js_instructions</code></td><td align="center"><code>object</code></td><td>Perform JavaScript instructions before obtaining the scraped website.</td><td align="center"><a href="../advanced-api-features/javascript-instructions">learn</a></td></tr><tr><td><code>block_resources</code></td><td align="center"><code>string</code></td><td>Block web browser's resources (i.e. <code>block_resources=media,js</code>)</td><td align="center"><a href="../advanced-api-features/block-resources">learn</a></td></tr><tr><td><code>session</code></td><td align="center"><code>int</code></td><td>Set depending on whether or not to use the same proxy address to your request.</td><td align="center"><a href="../advanced-api-features/sessions">learn</a></td></tr><tr><td><code>cookies</code></td><td align="center"><code>object</code></td><td>Add custom cookies to your request.</td><td align="center"><a href="../advanced-api-features/custom-cookies">learn</a></td></tr><tr><td><code>auto_solve</code></td><td align="center"><code>boolean</code></td><td>Enables the automatic Captcha solving.</td><td align="center"><a href="../advanced-api-features/captcha-solving">learn</a></td></tr></tbody></table>

{% hint style="info" %}
For boolean parameters, you can provide values in multiple formats. If the parameter is set to `'0'` or `'false'`, it will be treated as `false`, meaning the feature will be disabled or set to off. If you send `'1'` or `'true'`, the parameter will be interpreted as `true`, enabling or turning on the feature. The system recognizes both numeric and string representations of boolean values for flexibility in different use cases.
{% endhint %}
