ApiFlash is easy to use and can capture near pixel perfect screenshots of web pages.
It relies on the Chrome rendering engine to ensure fast and accurate rendering.
As a result, modern HTML, CSS, and JS features are fully supported. ( FlexBox, Advanced Selectors, Webfonts, Box Sizing, Media Queries, ... )
Make HTTP requests to one of the following endpoints:
Both HTTP POST and GET methods can be used.
Parameters can be passed in the query string
or as form data, in the case of an HTTP POST.
The response will contain the image data with the corresponding Content-Type and Content-Length headers.
/v1/urltoimage GET POST
Parameter Default Description
access_key required Your personal access key to use the API. You can find it in your dashboard.
url required The URL of the website you want to request a snapshot from. The protocol (http:// or https://) must be specified for the URL to be valid.
ttl in seconds defaults to 86400 The number of seconds the screenshot should be kept in cache. When a screenshot is served from cache, the API call doesn't count in your monthly credit. From 0 to 2592000 (30 days) seconds.
fresh defaults to False Return a fresh new screenshot instead of the eventually cached one.
full_page defaults to False Set this to true if you want to capture the full height of the target website.
scroll_page defaults to False Set this to true if you want the page to be scrolled through to trigger animations or lazy loaded elements.
width in pixels defaults to 1920 Width of the viewport to use.
height in pixels defaults to 1080 Height of the viewport to use. This will be ignored if full_page is set to true.
delay in seconds defaults to 0 Delay, after the pageload event is fired, to wait before taking the screenshot. From 0 to 10 seconds. Most websites are fully loaded after the pageload event so this parameter is not needed most of the time.
wait_for Wait until the provided CSS selector matches an element present in the page before capturing a screenshot. The process times out after 40 seconds.
format defaults to jpeg The format of the returned screenshot. One of jpeg and png.
response_type defaults to image The type of response to return. Can be either image or json.
  • If the response type is image, the binary data of the screenshot is returned with the appropriate Content-Type and Content-Length headers.
  • If the response type is json, the response is a json document. formatted as follows:
        "url": "https://url_of_screenshot_image...", 
        "extracted_html": "https://url_of_extracted_html_here..." 
quality defaults to 80 The quality of the image between 0 and 100. This only works with the jpeg format.
transparent defaults to False Hides the default background and allows capturing screenshots with transparency. This only works with the png format.
css An additional CSS string to be injected into the page before capturing. The CSS string might need to be URL encoded to be processed correctly.
js Additional JavaScript code to be injected into the page before capturing. For security reasons, this feature is disabled by default for all accounts. If you need it, please let us know. The JS string might need to be URL encoded to be processed correctly.
extract_html defaults to False Extract the HTML of the page at the same time the screenshot is made. This only works when the response_type parameter is set to json. When this parameter is set to true, an extracted_html attribute is added to the returned json document.
accept_language Sets an Accept-Language header on requests to the target URL allowing you to make screenshots of a website with a specific language.
user_agent Sets the User-Agent header to emulate a particular client when making screenshots.
location A country location to use when emulating geo-location. ISO alpha-2 and ISO alpha-3 country codes are supported.
latitude The latitude to use when emulating geo-location between -90 and 90.
longitude The longitude to use when emulating geo-location between -180 and 180.
accuracy in meters defaults to 0 Accuracy value to use when emulating geo-location.
fail_on_status A comma separated list of HTTP status codes that should make the API call fail instead of returning a screenshot. Hyphen separated HTTP status codes can be used to define ranges. For example 400,404,500-511 would make the API call fail if the URL returns 400, 404 or any status code between 500 and 511.
The following examples make a HTTP request to the API and save the screenshot to a screenshot.jpeg file.
using System.Net;

public class Api
    private const string ApiUrl = "";

    public static void Main ()
        using(var client = new WebClient())
            // This requires the System.Web assembly reference.
            var queryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
            queryString["url"] = "";
            queryString["access_key"] = "YOUR_ACCESS_KEY";

            client.DownloadFile(ApiUrl + "?" + queryString, "screenshot.jpeg");

curl --request GET --url "${api_url}?access_key=${access_key}&url=${url}" > screenshot.jpeg
package main

import (

func main() {

	apiUrl := ""
	request, _ := http.NewRequest("GET", apiUrl, nil)
	query := request.URL.Query()
	query.Add("url", "")
	query.Add("access_key", "YOUR_ACCESS_KEY")
	request.URL.RawQuery = query.Encode()

	client := &http.Client{}
	response, _ := client.Do(request)
	defer response.Body.Close()

	image, _ := os.Create("screenshot.jpeg")
	io.Copy(image, response.Body)


public class Main {

    public static void main(String[] args) throws Exception {

        String accessKey = "YOUR_ACCESS_KEY";
        String apiUrl = "";
        URL url = new URL(String.format("%s?access_key=%s&url=", apiUrl, accessKey));
        InputStream inputStream = url.openStream();
        OutputStream outputStream = new FileOutputStream("screenshot.jpeg");

        byte[] b = new byte[2048];
        int length;

        while ((length = != -1) {
            outputStream.write(b, 0, length);

var fs = require('fs'),
    request = require('request');

    url: "",
    encoding: "binary",
    qs: {
        url: "",
        access_key: "YOUR_ACCESS_KEY"
}, function (error, response, body) {
    fs.writeFile("screenshot.jpeg", body, "binary", function (err) {

$params = http_build_query(array(
    "url" => "",
    "access_key" => "YOUR_ACCESS_KEY"

$image_data = file_get_contents("" . $params);
file_put_contents("screenshot.jpeg", $image_data);

from urllib.parse import urlencode
from urllib.request import urlretrieve

params = urlencode({"url": "", "access_key": "YOUR_ACCESS_KEY"})
urlretrieve("" + params, "screenshot.jpeg")
require "open-uri"'screenshot.jpeg', 'wb') do |fo|
  params = URI.encode_www_form("url" => "",
                               "access_key" => "YOUR_ACCESS_KEY")
  fo.write open("" + params).read
When ApiFlash is enable to make a screenshot, the API respond with specific HTTP status codes.
The cause of the error can be determined from the following table.
Status Code Description
400 Bad Request Some api parameters are not valid.
401 Unauthorized No access key was provided or the provided access key is invalid or revoked.
402 Payment Required Monthly API request allowance has been exceeded for the current plan.
403 Forbidden The api feature is not available for the current plan.