Compare stored screenshots
curl --request POST \
--url https://api.scrinly.com/render/diff \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"before": {
"media": {
"url": "https://storage.example.com/before.jpg"
}
},
"after": {
"media": {
"url": "https://storage.example.com/after.jpg"
}
},
"mode": "perceptual",
"visualization": "overlay"
}
'import requests
url = "https://api.scrinly.com/render/diff"
payload = {
"before": { "media": { "url": "https://storage.example.com/before.jpg" } },
"after": { "media": { "url": "https://storage.example.com/after.jpg" } },
"mode": "perceptual",
"visualization": "overlay"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
before: {media: {url: 'https://storage.example.com/before.jpg'}},
after: {media: {url: 'https://storage.example.com/after.jpg'}},
mode: 'perceptual',
visualization: 'overlay'
})
};
fetch('https://api.scrinly.com/render/diff', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrinly.com/render/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'before' => [
'media' => [
'url' => 'https://storage.example.com/before.jpg'
]
],
'after' => [
'media' => [
'url' => 'https://storage.example.com/after.jpg'
]
],
'mode' => 'perceptual',
'visualization' => 'overlay'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrinly.com/render/diff"
payload := strings.NewReader("{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrinly.com/render/diff")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrinly.com/render/diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"type": "diff",
"before": {
"width": 123,
"height": 123,
"contentType": "<string>",
"sha256": "<string>"
},
"after": {
"width": 123,
"height": 123,
"contentType": "<string>",
"sha256": "<string>"
},
"diff": {
"version": "screenshot-diff-v2",
"mode": "pixel",
"visualization": "overlay",
"changed": true,
"changedPixels": 123,
"comparedPixels": 123,
"differenceRatio": 123,
"similarity": 123,
"comparisonCoverage": 123,
"changedBounds": [
{
"x": 1,
"y": 1,
"width": 2,
"height": 2,
"status": "changed",
"coordinateSpace": "before"
}
],
"boundsTruncated": true,
"omittedBounds": 123,
"regionMatching": {
"status": "available"
},
"regions": [
{
"status": "unchanged",
"kind": "<string>",
"beforeId": "<string>",
"afterId": "<string>",
"differenceRatio": 123,
"similarity": 123,
"positionChanged": true,
"sizeChanged": true,
"bounds": {
"x": 1,
"y": 1,
"width": 2,
"height": 2
}
}
]
},
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
},
"media": {
"stored": true,
"url": "<string>",
"contentType": "image/jpeg",
"key": "<string>",
"location": "<string>",
"width": 123,
"height": 123,
"bytes": 123,
"sha256": "<string>"
}
}{
"success": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statusUrl": "<string>",
"type": "screenshot",
"message": "<string>",
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}Diffs
Compare stored screenshots
POST
/
render
/
diff
Compare stored screenshots
curl --request POST \
--url https://api.scrinly.com/render/diff \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"before": {
"media": {
"url": "https://storage.example.com/before.jpg"
}
},
"after": {
"media": {
"url": "https://storage.example.com/after.jpg"
}
},
"mode": "perceptual",
"visualization": "overlay"
}
'import requests
url = "https://api.scrinly.com/render/diff"
payload = {
"before": { "media": { "url": "https://storage.example.com/before.jpg" } },
"after": { "media": { "url": "https://storage.example.com/after.jpg" } },
"mode": "perceptual",
"visualization": "overlay"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
before: {media: {url: 'https://storage.example.com/before.jpg'}},
after: {media: {url: 'https://storage.example.com/after.jpg'}},
mode: 'perceptual',
visualization: 'overlay'
})
};
fetch('https://api.scrinly.com/render/diff', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrinly.com/render/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'before' => [
'media' => [
'url' => 'https://storage.example.com/before.jpg'
]
],
'after' => [
'media' => [
'url' => 'https://storage.example.com/after.jpg'
]
],
'mode' => 'perceptual',
'visualization' => 'overlay'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrinly.com/render/diff"
payload := strings.NewReader("{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrinly.com/render/diff")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrinly.com/render/diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"before\": {\n \"media\": {\n \"url\": \"https://storage.example.com/before.jpg\"\n }\n },\n \"after\": {\n \"media\": {\n \"url\": \"https://storage.example.com/after.jpg\"\n }\n },\n \"mode\": \"perceptual\",\n \"visualization\": \"overlay\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"type": "diff",
"before": {
"width": 123,
"height": 123,
"contentType": "<string>",
"sha256": "<string>"
},
"after": {
"width": 123,
"height": 123,
"contentType": "<string>",
"sha256": "<string>"
},
"diff": {
"version": "screenshot-diff-v2",
"mode": "pixel",
"visualization": "overlay",
"changed": true,
"changedPixels": 123,
"comparedPixels": 123,
"differenceRatio": 123,
"similarity": 123,
"comparisonCoverage": 123,
"changedBounds": [
{
"x": 1,
"y": 1,
"width": 2,
"height": 2,
"status": "changed",
"coordinateSpace": "before"
}
],
"boundsTruncated": true,
"omittedBounds": 123,
"regionMatching": {
"status": "available"
},
"regions": [
{
"status": "unchanged",
"kind": "<string>",
"beforeId": "<string>",
"afterId": "<string>",
"differenceRatio": 123,
"similarity": 123,
"positionChanged": true,
"sizeChanged": true,
"bounds": {
"x": 1,
"y": 1,
"width": 2,
"height": 2
}
}
]
},
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
},
"media": {
"stored": true,
"url": "<string>",
"contentType": "image/jpeg",
"key": "<string>",
"location": "<string>",
"width": 123,
"height": 123,
"bytes": 123,
"sha256": "<string>"
}
}{
"success": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statusUrl": "<string>",
"type": "screenshot",
"message": "<string>",
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}{
"success": false,
"error": "<string>",
"type": "<string>",
"code": "<string>",
"retryable": true,
"fields": [
{
"field": "<string>",
"message": "<string>"
}
],
"credits": {
"charged": 1,
"refunded": 1,
"net": 1
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
pixel, perceptual Available options:
overlay, heatmap, mask, none Available options:
b2, s3, r2 ⌘I