Skip to main content
All Screenshotly API requests require authentication via an API key.

Getting your API key

  1. Sign in to your dashboard
  2. Navigate to API settings
  3. Copy your API key

Using your API key

Pass your API key using either the X-API-Key header or the api_key query parameter.

Query parameter authentication

You can also pass the API key as a query parameter:
Query parameter authentication exposes your API key in URLs and server logs. Use header authentication whenever possible.

Environment variables

Store your API key in an environment variable to avoid hardcoding it:
Then reference it in your code:

Authentication errors

If your API key is missing, the API returns a 401 response:
If your API key is invalid or has been revoked:

Security best practices

  • Never expose keys in client-side code — only use API keys in server-side applications
  • Don’t commit keys to version control — use .env files and add them to .gitignore
  • Use separate keys for environments — generate different keys for development, staging, and production
  • Rotate keys regularly — revoke old keys and generate new ones from the dashboard
  • Revoke compromised keys immediately — if a key is exposed, revoke it in API settings