# Screenshot

## Capture Screenshot

## Capture screenshot

<mark style="color:blue;">`GET`</mark> `https://api.microshot.io/v1/screenshot`

Captures a new screenshot

#### Query Parameters

| Name                                  | Type    | Description                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark> | string  | The URL of the website for which you want to capture a screenshot. It should be URL encoded and must include the protocol (`http://` or `https://`) to be processed correctly.                                                                                                                                                                                        |
| format                                | string  | <p>Defines the image format to be used. One of <code>png</code>, <code>jpeg</code>, <code>webp</code><em>.</em> </p><p></p><p>Defaults to <code>jpeg</code></p>                                                                                                                                                                                                       |
| quality                               | integer | <p>The quality of the image between <code>0</code> and <code>100</code>. Works only with the <code>jpeg</code> and <code>webp</code> formats. </p><p></p><p>Defaults to <code>80</code></p>                                                                                                                                                                           |
| disable\_ads                          | bool    | <p>Prevent ads from being displayed on the captured screenshot. Block requests from popular ad-networks.</p><p></p><p>Defaults to <code>false</code></p>                                                                                                                                                                                                              |
| full\_page                            | bool    | <p>It captures a full scrollable page screenshot.</p><p></p><p>Defaults to <code>false</code></p>                                                                                                                                                                                                                                                                     |
| response\_type                        | bool    | <p>The type of response to return. Can be either <code>image</code> or <code>json</code>.</p><p></p><p>When the <code>json</code> type is used, the JSON response with the link to the screenshot hosted on our CDN is returned.</p><p></p><p>When the <code>image</code> type is used, the binary image is returned.</p><p></p><p>Defaults to <code>image</code></p> |
| width                                 | integer | <p>The width of the viewport to use (in pixels).</p><p></p><p>Defaults to <code>1920</code></p>                                                                                                                                                                                                                                                                       |
| height                                | integer | <p>The height of the viewport to use (in pixels).</p><p></p><p>Defaults to <code>1080</code></p>                                                                                                                                                                                                                                                                      |
| hide\_cookie\_banners                 | bool    | <p>Prevent cookie banners and popups from being displayed.</p><p></p><p>Defaults to <code>false</code></p>                                                                                                                                                                                                                                                            |
| animations                            | bool    | <p>Enables/disables CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation">animations</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transition">transitions</a>.</p><p></p><p>Defaults to <code>true</code></p>                                                                                                                 |

{% tabs %}
{% tab title="500: Internal Server Error Unable to capture the screenshot." %}

```javascript
{
    message: "Unreachable host."
}
```

{% endtab %}

{% tab title="429: Too Many Requests Too many requests hit the API too quickly. We recommend an exponential backoff of your requests" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Invalid arguments" %}

<pre class="language-json"><code class="lang-json">{
    message: "Invalid arguments",
<strong>    errors: {
</strong>        url: [
            "The URL should be provided."
        ]
    }
}
</code></pre>

{% endtab %}

{% tab title="200: OK Screenshot successfully captured" %}

```json
{
    url: "https://cdn.microshot.io/XC31L2VqiGPO3SGGBSjJ-mgqa9SDX8fiWm0Wmyi5MrYFtuW5ubyl0vPxGD11m2lHusOGJEZOIc5xmk-w.jpeg"
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid or revoked API key" %}

```json
{
    type: "https://tools.ietf.org/html/rfc2616#section-10",
    title: "An error occurred",
    status: 401,
    detail: "Unauthorized"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.microshot.io/endpoints/screenshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
