ApiFlash is a simple yet powerful screenshot API that any modern company can easily use to make pixel perfect website screenshots at scale. An up to date version of Chrome is used to ensure that all modern web features are fully supported and that rendering is exactly as you would expect. It's also built over AWS Lambda to make sure that it truly scales and keeps being stable under heavy workloads.
We're one of the most cost efficient screenshot API out there and we are dedicated to provide an awesome service to all companies, big or small.
Content-Type
and Content-Length
headers.
If the response_type parameter is set to json
, then the response
contains a JSON document with links to the resulting screenshot.
Parameter | Default | Description |
---|---|---|
required in pixels in seconds in meters |
defaults to
|
Please try again with a different search query.
screenshot.jpeg
file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | using System.Net;
public class ApiFlashExample
{
private const string ApiFlashEndpoint = "https://api.apiflash.com/v1/urltoimage";
public static void Main ()
{
using(var webClient = new WebClient())
{
// The System.Web assembly reference is required.
var parameters = System.Web.HttpUtility.ParseQueryString(string.Empty);
parameters["access_key"] = "YOUR_ACCESS_KEY";
parameters["url"] = "https://example.com";
webClient.DownloadFile(ApiFlashEndpoint + "?" + parameters, "screenshot.jpeg");
}
}
}
|
1 2 3 4 5 | endpoint="https://api.apiflash.com/v1/urltoimage"
access_key="YOUR_ACCESS_KEY"
url="https://example.com"
curl --request GET --url "${endpoint}?access_key=${access_key}&url=${url}" > screenshot.jpeg
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | package main
import (
"io"
"net/http"
"os"
)
func main() {
apiFlashEndpoint := "https://api.apiflash.com/v1/urltoimage"
request, _ := http.NewRequest("GET", apiFlashEndpoint, nil)
query := request.URL.Query()
query.Add("access_key", "YOUR_ACCESS_KEY")
query.Add("url", "https://example.com")
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)
image.Close()
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
public class Main {
private static String ACCESS_KEY = "YOUR_ACCESS_KEY";
private static String APIFLASH_ENDPOINT = "https://api.apiflash.com/v1/urltoimage";
public static void main(String[] args) throws Exception {
String params = String.format("?access_key=%s&url=https://example.com", ACCESS_KEY);
URL apiCallUrl = new URL(APIFLASH_ENDPOINT + params);
InputStream inputStream = apiCallUrl.openStream();
OutputStream outputStream = new FileOutputStream("screenshot.jpeg");
byte[] b = new byte[2048];
int length;
while ((length = inputStream.read(b)) != -1) {
outputStream.write(b, 0, length);
}
inputStream.close();
outputStream.close();
}
}
|
1 2 3 4 5 6 7 8 9 | const https = require('https');
const fs = require('fs');
https.get("https://api.apiflash.com/v1/urltoimage?" + new URLSearchParams({
access_key: "YOUR_ACCESS_KEY",
url: "https://example.com"
}).toString(), (response) => {
response.pipe(fs.createWriteStream('screenshot.jpeg'));
});
|
1 2 3 4 5 6 7 8 9 10 11 | <?php
$params = http_build_query(array(
"access_key" => "YOUR_ACCESS_KEY",
"url" => "https://example.com",
));
$image_data = file_get_contents("https://api.apiflash.com/v1/urltoimage?" . $params);
file_put_contents("screenshot.jpeg", $image_data);
?>;
|
1 2 3 4 5 6 | from urllib.parse import urlencode
from urllib.request import urlretrieve
params = urlencode(dict(access_key="YOUR_ACCESS_KEY",
url="https://example.com"))
urlretrieve("https://api.apiflash.com/v1/urltoimage?" + params, "screenshot.jpeg")
|
1 2 3 4 5 6 7 | require "open-uri"
File.open('screenshot.jpeg', 'wb') do |fo|
params = URI.encode_www_form("access_key" => "YOUR_ACCESS_KEY",
"url" => "https://example.com")
fo.write open("https://api.apiflash.com/v1/urltoimage?" + params).read
end
|
429
.
Header Name | Description |
---|---|
X-Quota-Limit |
The maximum number of API calls you can make per billing period. |
X-Quota-Remaining |
The number of API calls remaining for the current billing period. |
X-Quota-Reset |
The time, in UTC epoch seconds, at which the current billing period ends and the remaining number of API calls resets. |
1 2 3 4 5 | {
"limit": 10000,
"remaining": 5400,
"reset": 1584549777
}
|
Status Code | Description |
---|---|
400
Bad Request
|
Either the API call contains invalid parameters or the target URL cannot be captured. |
401
Unauthorized
|
The access key used to make this API call has been revoked or is invalid. |
402
Payment Required
|
The monthly screenshot quota has been exceeded for the user's current plan. |
403
Forbidden
|
The current plan does not support some of the features requested through API parameters. |
429
Too Many Requests
|
Too many API calls have been made. The specific reason is included in the response body. |
500
Internal Server Error
|
The screenshot capture failed because our API failed to handle the encountered situation. |
400
, it also provides a meaningful
error message to help you understand the root cause of the error.
If the response_type parameter is set to json
, an error type as well as
additional information might also be returned depending on the type of error.