Authentication

You'll need to authenticate your requests to access any of the endpoints in the Screenshot API. In this guide, we'll look at how authentication works. The Screenshot API uses a simple access key mechanism for authentication.

Access key authentication

To authenticate with the Screenshot API, you need to include your access key with each request. You can specify the access key in three ways:

  1. As a query parameter (access_key).
  2. In the JSON body for POST requests.
  3. As a request header (X-Access-Key).

Example Request with Access Key as Query Parameter

GET https://api.capturescreenshotapi.com/take?url=https://apple.com&access_key=<access_key>

Example Request with Access Key in Header

curl https://api.capturescreenshotapi.com/take \
  -H "X-Access-Key: <access_key>" \
  -d url=https://apple.com

Make sure to keep your access key secure, and do not share it publicly or commit it to version control systems like GitHub.

Using an SDK

If you use a third-party HTTP client library, you can pass the access key in the request configuration. Simply include it as a query parameter, JSON body key, or header, depending on the type of request.

What's next?

Now that you know how to authenticate with the Screenshot API, you can explore the available endpoints and make requests. Here are a few links that might be handy as you venture further into using the API:

Was this page helpful?