Skip to main content

PagePixels Screenshots for Python

PagePixels is an API and web interface that provides automated screenshot capturing and change notifications for your web pages. With PagePixels, you can easily capture immediate screenshots, schedule recurring screenshots, set up change notifications, and use multi-step screenshotting functionality to complete forms, click links, and login to websites prior to taking screenshots.

Getting Started

To use PagePixels, sign up for a free account and obtain your API key. No payment information is required. You can sign up and create an API key by visiting the PagePixels website https://pagepixels.com.

Once you have your API key, you can start making requests to the API.

Installation

To install the screenshots_pagepixels package, you can use the following command:

pip install screenshots-pagepixels

Once the package is installed, you can import it in your Python code:

from screenshots_pagepixels import ScreenshotsPagepixels

Usage

The screenshots_pagepixels Python package provides a simple and intuitive way to interface with the PagePixels API. The ScreenshotsPagepixels class provides the following methods.

Learn more about configuring your screenshot options here:

https://pagepixels.com/app/documentation#api-options

snap(options = {})

Captures a screenshot of a web page immediately.

client = ScreenshotsPagepixels('your-api-key')
options = {'url': 'https://www.example.com'}
client.snap(options)

create_screenshot_config(options = {})

Creates a new screenshot configuration, which can include an automatically recurring schedule, multi-step configurations, and more.

Learn more about multi-step (click links, complete forms, login to websites, etc) functionality here:

https://pagepixels.com/app/documentation#multi-step-screenshots

Learn more about configuring scheduled screenshots here:

https://pagepixels.com/app/documentation#scheduled-screenshots

client = ScreenshotsPagepixels('your-api-key')
options = {'url': 'https://www.example.com', 'scheduled_screenshot': True, 'scheduled_every': 1, 'scheduled_interval': 'days'}
client.create_screenshot_config(options)

screenshot_configs(options = {})

Allows you to retrieve your screenshot configurations.

client = ScreenshotsPagepixels('your-api-key')
client.screenshot_configs()

get_screenshot_config(id)

Gets a specific screenshot configuration.

client = ScreenshotsPagepixels('your-api-key')
client.get_screenshot_config('your-screenshot-config-id')

update_screenshot_config(id, options = {})

Updates a specific screenshot configuration.

client = ScreenshotsPagepixels('your-api-key')
options = {'scheduled_every': 2}
client.update_screenshot_config('your-screenshot-config-id', options)

delete_screenshot_config(id)

Deletes a specific screenshot configuration.

client = ScreenshotsPagepixels('your-api-key')
client.delete_screenshot_config('your-screenshot-config-id')

screenshot_config_screenshots(id, options = {})

Retrieves a list of screenshots that were taken with a specific screenshot configuration.

client = ScreenshotsPagepixels('your-api-key')
client.screenshot_config_screenshots('your-screenshot-config-id')

screenshot_config_change_notifications(id, options = {})

Provides an array of all Change Notifications for a specific screenshot configuration.

Learn more about configuring change notifications for your screenshots here:

https://pagepixels.com/app/documentation#screenshot-change-notifications

client = ScreenshotsPagepixels('your-api-key')
client.screenshot_config_change_notifications('your-screenshot-config-id')

job_status(job_id)

Retrieves the status of a specific screenshot job associated with a screenshot configuration.

client = ScreenshotsPagepixels('your-api-key')
client.job_status('your-job-id')

capture_screenshot(id)

Immediately captures a screenshot using a specific screenshot configuration. This bypasses all scheduling to take a screenshot immediately.

client = ScreenshotsPagepixels('your-api-key')
client.capture_screenshot('your-screenshot-config-id')

screenshots(options = {})

Retrieves a list of all screenshots taken with your PagePixels account.

client = ScreenshotsPagepixels('your-api-key')
client.screenshots()

change_notifications(options = {})

Provides an array of all Change Notifications for all screenshot configurations.

client = ScreenshotsPagepixels('your-api-key')
client.change_notifications()

Some additional helpful information.

Scheduling

With PagePixels, you can schedule recurring screenshots of your web pages. You can schedule screenshots through the user interface as well if needed.

The following options are available for scheduling:

Option Expected Value
scheduled_screenshot true or false
scheduled_every Integer greater than 1
scheduled_interval Any of: minutes, hours, days, weeks, months, years

Multi-Step Screenshots

PagePixels also provides the ability to use multi-step functionality to complete forms, navigate to different pages, click links and buttons, and login to your favorite websites prior to taking your screenshot.

Learn more about how to configure multi-step actions for your screenshots here:

https://pagepixels.com/app/documentation#multi-step-screenshots

The following actions are available for use with the multi-step functionality:

Action Example
Click {"type": "click", "selector": "#your-selector"}
Hover {"type": "hover", "selector": "#your-selector"}
Change Notification {"type": "change", "selector": "#your-selector", "send_to": "webhook", "url": "https://example.com/webhook-url"}
Goto URL {"type": "redirect", "value": "https://example.com"}
Run Javascript {"type": "javascript", "value": "console.log('my javascript');"}
Insert CSS {"type": "css", "value": "#selector{ color: red }"}
Text Field Input {"type": "text_field", "selector": "#the-text-field", "value": "your-value"}
Dropdown Field Selection {"type": "select", "selector": "#the-dropdown-field", "value": "selected value"}
Checkbox Field Input {"type": "checkbox", "selector": "#the-checkbox-field", "value": true}
Press Enter (to submit hidden forms) {"type": "submit"}
Wait X milliseconds {"type": "wait", "value": "5000"}
Wait for Selector {"type": "wait_for_selector", "selector": "#your-selector"}

To use these actions with the Python client, simply provide them as a list of dictionaries in the options parameter when creating or updating a screenshot configuration. For example:

client = ScreenshotsPagepixels('your-api-key')
options = {
    "url": "https://www.example.com",
    "multi_step_actions": [
        {"type": "click", "selector": "#your-selector"},
        {"type": "wait", "value": "5000"}
    ]
}
client.create_screenshot_config(options)

Metadata

Release files for screenshots-pagepixels 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for screenshots-pagepixels 1.0.4
File Size Uploaded
screenshots_pagepixels-1.0.4.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for screenshots-pagepixels 1.0.4
File Interpreter ABI Platform
screenshots_pagepixels-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / screenshots_pagepixels-1.0.4.tar.gz

Download URL screenshots_pagepixels-1.0.4.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e41c5f2f08e946d526c4e5dc1b4c3b0bde7f322c3c9e5b0cf750ead2fb35602
BLAKE2b-256 checksum
How to use checksums
bb82d0cb620719e6c7d9eef3ac9bf8d26e7a57b4218416a0b2b4e02621e69924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / screenshots_pagepixels-1.0.4-py3-none-any.whl

Download URL screenshots_pagepixels-1.0.4-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
992fce5f1e937123258808e7ad41d6da1dc83a1375258a29975b9de5d40f4d4f
BLAKE2b-256 checksum
How to use checksums
3bd4e5a553cb2c9ec6a8e441b949469c2e9e9396c28025b90e7f7cc288399206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page