Multi-Step Screenshots
With the PagePixels Multi-Step screenshot functionality you can complete forms, navigate to different pages, click links and buttons, and login to websites prior to taking your screenshot.
To use the Multi-Step functionality, simply pass an array of actions using the multi_step_actions key.
Actions are completed in the order they are provided in the array.
Available Actions
| Action | Example |
|---|---|
| Click | |
| Hover | |
| Change Notification
Learn More |
{"type": "change", "selector": "#your-selector", "send_to": "webhook", url: "https://example.com/webhook-url"} |
| Goto URL | |
| Run Javascript | |
| Evaluate Javascript | |
| Insert CSS | |
| Text Field Input | |
| Dropdown Field Selection | |
| Checkbox Field Input | |
| Press Enter (to submit hidden forms) | |
| Wait X milliseconds | |
| Wait For Selector | |
Below is an example of the Multi-Step functionality using the Create Endpoint.
This example goes to https://wikipedia.org, fills in the search field with 'Perseverance Rover', and clicks the submit button before taking a screenshot.
/screenshot_configs
bash
curl -X POST "https://api.pagepixels.com/screenshot_configs" \
-d url="https://wikipedia.org/" \
-d multi_step_actions='[{"type": "text_field", "selector": "#searchInput", "value": "perseverance rover"}, {"type": "click", "selector": "#search-form button"}]' \
-d access_token="your-api-key"
{
"success": true,
"screenshot_configuration_id":"screenshot_configuration_id",
"embed_url":"https://pagepixels.com/app/screenshots/:screenshot_configuration_id/embed",
"job_id": "job_id"
}
Change Notifications
Keep track of changes all across the web. For example, change notifications can alert you to when a competitor's prices have changed, or when new team members are added to their 'about us' page.
Notifications can be sent to any URL location as a POST request in JSON format. For example, you can process change notifications through Zapier and populate your favorite dashboards and backend systems with the latest information.
Below is an example screenshot with a change notification configured using the Create Endpoint.
This example goes to the Ingenuity Helicopter's wikipedia page every 10 minutes and sends a Change Notification to a webhook URL every time a change is detected on the total number of flights the helicopter has taken.
/screenshot_configs
bash
curl -X POST "https://api.pagepixels.com/screenshot_configs" \
-d url="https://en.wikipedia.org/wiki/Ingenuity_(helicopter)" \
-d scheduled_screenshot=true \
-d scheduled_every=10 \
-d scheduled_interval="minutes" \
-d multi_step_actions='[{"type": "change", "selector": "#mw-content-text > div.mw-parser-output > table.infobox > tbody > tr:nth-child(24) > td", "send_to": "webhook", "url": "https://example.com/webhook"}]' \
-d access_token="your-api-key"
{
"success": true,
"screenshot_configuration_id":"screenshot_configuration_id",
"embed_url":"https://pagepixels.com/app/screenshots/:screenshot_configuration_id/embed",
"job_id": "job_id"
}
List Change Notifications
/screenshot_configs/:screenshot_configuration_id/change_notifications
This endpoint provides an array of all Change Notifications for a specific screenshot configuration.
By default, the API will return 1000 records per request.
Paging Parameters
| Key | Description |
|---|---|
| page | The page you would like to retrieve. Default: 1. |
| limit | The total number of records you would like to retrieve. Minimum: 1, Maximum: 1000, Default: 1000 |
| after | A unix timestamp (with or without milliseconds). Only records created after this time will be returned in the request. Default: none |
| before | A unix timestamp (with or without milliseconds). Only records created before this time will be returned in the request. Default: none |
| order | Can be either 'ASC' or 'DESC'. Default: 'DESC'. Records returned in DESC (descending) order will return the most recent records first to the oldest records. Records returned in ASC (ascending) order will return the oldest records first to the newest records. |
Here is a quick example of this functionality.
/screenshot_configs/:screenshot_configuration_id/change_notifications
http
https://api.pagepixels.com/screenshot_configs/:screenshot_configuration_id/change_notifications?access_token=your-api-key&page=1
{
"success": true,
"change_notifications": [
{
"id": "da4b9237bacccdf19c0760cab7aec4a8359010b0",
"screenshot_configuration_id": "827b7f5d-da55-44aa-a2d5-236b75cb1a14",
"previous_value": "18",
"retrieved_value": "19",
"config": {
"type": "change",
"selector": "#some-selector",
"send_to": "webhook",
"url": "http://example.com/webhook"
},
"sent_at": "1632624177263"
},
{
"id": "356a192b7913b04c54574d18c28d46e6395428ab",
"screenshot_configuration_id": "827b7f5d-da55-44aa-a2d5-236b75cb1a14",
"previous_value": "17",
"retrieved_value": "18",
"config": {
"type": "change",
"selector": "#some-selector",
"send_to": "webhook",
"url": "http://example.com/webhook"
},
"sent_at": "1632624048330"
}
]
}
List All Change Notifications
/change_notifications
This endpoint provides an array of all Change Notifications found on your account, for all screenshot configurations.
By default, the API will return 1000 records per request.
Paging Parameters
| Key | Description |
|---|---|
| page | The page you would like to retrieve. Default: 1. |
| limit | The total number of records you would like to retrieve. Minimum: 1, Maximum: 1000, Default: 1000 |
| after | A unix timestamp (with or without milliseconds). Only records created after this time will be returned in the request. Default: none |
| before | A unix timestamp (with or without milliseconds). Only records created before this time will be returned in the request. Default: none |
| order | Can be either 'ASC' or 'DESC'. Default: 'DESC'. Records returned in DESC (descending) order will return the most recent records first to the oldest records. Records returned in ASC (ascending) order will return the oldest records first to the newest records. |
Here is a quick example of this functionality.
/change_notifications
http
https://api.pagepixels.com/change_notifications?access_token=your-api-key&page=1
{
"success": true,
"change_notifications": [
{
"id": "da4b9237bacccdf19c0760cab7aec4a8359010b0",
"screenshot_configuration_id": "e2ac54a0-5332-451a-a63e-4ccdb3e3db32",
"previous_value": "18",
"retrieved_value": "19",
"config": {
"type": "change",
"selector": "#some-selector",
"send_to": "webhook",
"url": "http://example.com/webhook"
},
"sent_at": "1632624177263"
},
{
"id": "356a192b7913b04c54574d18c28d46e6395428ab",
"screenshot_configuration_id": "827b7f5d-da55-44aa-a2d5-236b75cb1a14",
"previous_value": "17",
"retrieved_value": "18",
"config": {
"type": "change",
"selector": "#some-selector",
"send_to": "webhook",
"url": "http://example.com/webhook"
},
"sent_at": "1632624048330"
}
]
}
Support
Questions? Contact us anytime by email:
support-tickets@pagepixels.com
Or send us a message through our Support page.