# API Reference

Source: https://docs.screenshotlens.com/docs/api
Summary: The two ScreenshotLens capture endpoints, how they are authorized, and how their responses and errors are shaped.

The public API is two capture endpoints plus a small set of key-management routes. Both capture endpoints are `GET` requests, take their parameters in the query string, and return either the media itself or a JSON body pointing at the stored asset.

## Endpoints

| Endpoint                 | Captures                                                       | Cost                      | Reference                                    |
| ------------------------ | -------------------------------------------------------------- | ------------------------- | -------------------------------------------- |
| `GET /v1/screenshots`    | A viewport screenshot, or the whole page with `full_page=true` | 1 credit, 2 for full page | [Screenshot API](https://docs.screenshotlens.com/docs/api/screenshots)      |
| `GET /v1/videos/rolling` | An MP4 or GIF of the page scrolling, up to 30 seconds          | 5 credits                 | [Rolling Video API](https://docs.screenshotlens.com/docs/api/rolling-video) |

Base URL: `https://api.screenshotlens.com`

## What every capture request shares

* `url` is required, must be absolute, and must use `http` or `https`.
* `api_key` authorizes the request unless it carries a dashboard session. See [Authentication](https://docs.screenshotlens.com/docs/api/authentication).
* `response_type` is `binary` by default and `json` while you are integrating.
* Viewports run from 1×1 up to 7680×4320, and `wait_until` picks the lifecycle event to capture on.
* Ad and cookie-banner blocking are on by default and can be turned off per request.

## Reading the result

[Responses and Errors](https://docs.screenshotlens.com/docs/api/responses-errors) covers the success bodies, the five status codes the API returns, and the difference between an API failure and a target page that itself answered an error. Two rules are worth knowing up front:

* A capture that fails costs zero credits.
* A `402` means the wallet cannot cover the request, so retrying will not clear it.

## In this section

* [Authentication](https://docs.screenshotlens.com/docs/api/authentication): passing an API key, the key-management routes, and key hygiene
* [Screenshot API](https://docs.screenshotlens.com/docs/api/screenshots): every parameter, default, and limit for still captures
* [Rolling Video API](https://docs.screenshotlens.com/docs/api/rolling-video): recording, scroll timing, and output formats
* [Responses and Errors](https://docs.screenshotlens.com/docs/api/responses-errors): status codes, error bodies, and idempotency
