Quickstart Guide
All registered users, whether on a free or paid plan, can use our Quickstart Guide to explore the full range of API functionalities with just one click.
- Existing users: Access the Quickstart Guide below.
- New users: Create an account and get started immediately.
Get onboarded with the Screenshotlayer API and start retrieving stock market data in just a few minutes!
Step 1: Get your API Key
Sign up for a free Mediastack account at screenshotlayer.com and obtain your personal API Access Key.
This key authenticates your requests and ensures that you have access to the API features provided by your subscription plan.
Step 2: Base URL
Capturing a snapshot using the screenshotlayer API is simple. Each API request is based on the following URL:
Step 3: Required Parameters
In order to make any API request, two required parameters - your personal access_key and the target website's URL - have to be specified:
| Parameter | Description |
|---|---|
| access_key | your personal password used to authenticate with the API - located in your Account Dashboard. |
| url | the full URL (including its respective HTTP Protocol) of the website you want to request a snapshot from, e.g. http://abc.com |
Important: If your target website's URL contains the special character &, please make sure to pass a URL encoded version of it into the API's url parameter. Read more »
Step 4:Optional Parameters
Based on how you wish to configure your screenshot, you can choose from a number of optional parameters:
| Parameter | Description | Default |
|---|---|---|
| fullpage | set to "1" if you want to capture the full height of the target website | - |
| width | specify your preferred thumbnail width in pixels | 1:1 |
| viewport | specify your preferred viewport dimensions in pixels | 1440x900 |
| format | set your preferred image output format | PNG |
| secret_key | your secret key, an md5 hash of the target URL and your secret word. (See URL Encryption) | - |
| css_url | attach a URL containing a custom CSS stylesheet | - |
| delay | specify a delay before screenshot is captured (in seconds) | - |
| ttl | define the time (in seconds) your snapshot should be cached | 2592000 (30 days) |
| force | set to "1" if you want to force the API to capture a fresh screenshot | - |
| placeholder | attach a URL containing a custom placeholder image or set to "1" to use default placeholder | - |
| user_agent | specify a custom User-Agent HTTP header to send with your request | - |
| accept_lang | specify a custom Accept-Language HTTP header to send with your request | - |
| export | export snapshot via custom ftp path or using your AWS S3 user details | - |
Example Query:
The following query requests a full-height screenshot of apple.com
URL Encoding
Strictly speaking, it is always safer to URL-encode your target website's URL before passing it to the API's URL parameter. However, URL encoding is required in case your target website's URL contains special characters. or &.
Example URLs:
Find below two website URL versions that must be URL-encoded to be processed correctly.
Example query:
This is how the first example URL would be passed into an API request:
Not sure about URL encoding? Have a look at this reference page »