The following page describes common website screenshot design patterns and provides a high-level architecture overview of each core component.
Given a website URL and an API key, a single page request creates a real-time website screenshot. There are no queues or polling required. Screen capturing starts immediately, returning a response with the screenshot while you wait using a synchronous or asynchronous connection.
Add Screenshots does not throttle or limit the number of concurrent requests a client can make. The service scales across multiple cloud providers to provide a fast, scalable, and reliable solution.
Hotlinking using fresh, real-time website screenshots is also supported. For additional performance gains, consider using screenshot caching.
For additional performance gains, consider using screenshot caching.
Pattern 1 involves taking a single real-time screenshot of a webpage in response to a single-page request using an API key, without the need for background processing or queuing, and with support for synchronous or asynchronous connections.
The high-level screenshot architecture is shown below.
Example request to take a screenshot with the Screenshot API using the default options:
// Line breaks added for readability https://api.addscreenshots.com/screenshots?apikey=YOUR_API_KEY
&url=https://www.youtube.com
Your API key can be found on the API Keys page. Need an API Key? Sign up to get started.
For internal applications, replace YOUR_API_KEY with your own unique API Key.
For public facing websites or hotlinks, generate a signed URL.
The cached website screenshot pattern is similar to pattern 1, but the screenshot is cached based on a specified time-to-live duration. This pattern is ideal for public websites with multiple users who require the same screenshot without re-capturing every time.
Refer to the screenshot caching page for more information.
A screenshot request can include information such as automation steps to interact with the website (e.g., login or search for a flight) before capturing a screenshot. See the website screenshot automation page for more information and request examples.
Background screenshots allow you to take large volumes of screenshots in bulk using a single request that can contain multiple web pages, a sitemap, or a domain name. The screenshot images will be uploaded to a cloud storage drive that you manage, such as an AWS S3 Bucket or Azure Blob Storage Account.
A background request must:
Unlike real-time screenshots, which require the user to wait for completion, background requests work in a "fire-and-forget" manner, returning a success response immediately while the bulk website screenshots are processed in the background.
Monitor your cloud storage account for screenshot images to show up. The background worker pool processes screenshots, allowing you to capture more than a thousand websites per minute (depending on page load speed, required interaction, and website load handling).
Use this pattern to take screenshots of multiple pages from a single domain. It can be combined with storage account templates to save the screenshots to a cloud storage account.
The following example demonstrates how to capture multiple page screenshots with a single POST request. The screenshot images will be uploaded to an Azure Blob store using a Shared Access Token. The screenshots will be organized in the "{domain}" folder (pattern) and named according to the "{filepath}" pattern (pattern).
POST https://api.addscreenshots.com/screenshots/bulk/multi?apikey=YOUR_API_KEY { "urls": [ "google.com", "youtube.com", "apple.com" ], "azure": "https://screenshots.blob.core.windows.net/screenshotdemo?st=2020-08-10T07%...fEWvNz6fbdeUenY%3D", "file": "{filepath}", "folder": "{domain}" }
The API response will include the number of screenshots as shown below:
{ "message": "The screenshots are being processed.", "jobId": "536b69dbefa240d493330ae5de1c0d46", "screenshots": 3 }
Take multiple screenshots by overriding various properties per screenshot, such as the file name, as shown below.
POST https://api.addscreenshots.com/screenshots/bulk/multi?apikey=YOUR_API_KEY { "urls": [ { "url": "google.com", "file": "hey-google" }, { "url": "apple.com", "file": "hello-apple", "fullpage": true }, { "url": "youtube.com" } ], "azure": "https://screenshots.blob.core.windows.net/screenshotdemo?st=2020-08-10T07%...fEWvNz6fbdeUenY%3D", "file": "{filepath}", "folder": "{domain}", "fullpage": false }
Note that a full-page screenshot will be taken of apple.com since the default full-page property was overridden for that URL.
Specify a sitemap.xml file to capture all of the URLs contained in the sitemap. For example, https://www.addscreenshots.com/sitemap.xml
You can also specify a text file (e.g., websites.txt) that contains a list of website URLs to take screenshots of. Note that each website URL must start on a new line.
The response will include the number of URLs read from the sitemap and website list. If the request times out, verify that the sitemap or list is hosted on a fast server or that the list is not too large (e.g., > 5000 websites), which may cause a read timeout.
The example below shows how to take screenshots using multiple sitemaps in a single POST request. The screenshot images will be uploaded to an Azure Blob store using a Shared Access Token. The screenshots will be stored in the folder "{domain}" (pattern) with the filename "{filepath}" (pattern).
POST https://api.addscreenshots.com/screenshots/bulk/sitemap?apikey=YOUR_API_KEY { "urls": [ "https://www.apple.com/sitemap.xml", "https://www.cloudflare.com/sitemap.xml" ], "azure": "https://screenshots.blob.core.windows.net/screenshotdemo?st=2020-08-10T07%...fEWvNz6fbdeUenY%3D", "file": "{filepath}", "folder": "{domain}" }
The API response will include the number of screenshots as shown below:
{ "message": "The sitemap screenshots are being processed.", "jobId": "7b07194f706e47a7af868bb9b2ff12d7", "screenshots": 1366 }
Scrape and crawl an entire domain to take screenshots. This approach works well for small, fast websites that can be processed within a couple of minutes.
Use a sitemap or list for websites with many pages.
The example below shows how to take screenshots of an entire domain using a single POST request. The screenshot images will be uploaded to an Azure Blob store using a Shared Access Token. The screenshots will be stored in the folder "apple" using the filename "{filepath}" (pattern).
POST https://api.addscreenshots.com/screenshots/bulk/domain?apikey=YOUR_API_KEY { "url": "https://www.apple.com", "azure": "https://screenshots.blob.core.windows.net/screenshotdemo?st=2020-08-10T07%...fEWvNz6fbdeUenY%3D", "file": "{filepath}", "folder": "apple" }
The API response will include the number of screenshots as shown below:
{ "message": "The domain screenshots are being processed.", "jobId": "233b69dbefa240d493330ae5de1c0d38" }
The domain request above took less than a minute to process, capture, and upload over 1,000 screenshots.
Use scheduling to capture screenshots at regular intervals such as weekly, daily, hourly, or based on a custom interval (using a CRON notation).
Scheduling is shown below:
Only WRITE access to the cloud storage account is required for this pattern.
Add Screenshots uses Cloudy Scheduler to automate the scheduling of website screenshots.
To extend the scheduling pattern, it is also possible to compare the current screenshot with the previous screenshot to determine if a notable change (based on a configurable % difference) was detected.
Track changes can save a copy of the old screenshot, save the new screenshot, and save a diff image to highlight what has changed.
You can also configure an email notification to alert clients when a change is detected. For example, notify me when my competitor updates the pricing page on their website.
READ and WRITE access to the cloud storage account is required for this pattern.