Skip to content

Getting Started with PageWitness

Welcome to PageWitness! This guide will help you get up and running with our Screenshot API so you can start capturing screenshots in a matter of minutes.

Overview

PageWitness is a powerful screenshot service that lets you capture:

  • Full-page and viewport-sized screenshots
  • Mobile and desktop emulations
  • Screenshots of private, logged-in pages (with authentication tokens)
  • Various file formats (JPEG, PNG, PDF)
  • ...and more!

By using our RESTful API, you can easily integrate PageWitness into your existing infrastructure, CI/CD pipelines, or any custom application.

Prerequisites

  • A PageWitness account. If you don’t have one, sign up to get started.
  • A unique API key associated with your account.
  • Familiarity with making HTTP requests (using tools such as curl, fetch, or any HTTP client library).

Getting Your API Key

To use the PageWitness Screenshot API, you’ll need an API key:

  1. Sign in to your PageWitness account.
  2. Go to the API Keys section of the dashboard.
  3. Create or copy an existing key to use in your API requests.

Keep your API key private; it should be treated like a password.

Basic Usage

Once you have your API key, you can start making requests. Below is an example using curl. The request will capture a screenshot of the specified URL and return the image.

Example Request

bash
curl "https://api.pagewitness.com/v1/screenshot?url=https://example.com" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -o example.png

Result:

Screenshot of example.com

PageWitness - Additional Features & Troubleshooting

Parameters

ParameterDescriptionRequiredDefault
urlThe URL of the webpage to capture.Yes
widthThe width of the browser’s viewport (in pixels).No1280
heightThe height of the browser’s viewport (in pixels).No800
formatThe output file format. Accepts png, jpeg, or pdf.Nopng
delayThe delay (in milliseconds) before capturing the screenshot.No0
deviceSpecify a device preset (e.g., iPhone 12), overriding width, height, and UA.Nodesktop

Tip: You can pass these parameters via query string or, depending on your client, as a JSON body. Refer to our API Reference for all available parameters and usage details.


Advanced Features

Full-Page Screenshots

To capture the full length of a webpage, you can add the full_page=true parameter (when using the REST API) or set fullPage: true (when using the SDK):

bash
curl "https://api.pagewitness.com/v1/screenshot?url=https://example.com&full_page=true" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -o fullpage.png