Endpointpost /v3/scanImage
Parameters
data string, required |
The complete image in base64-encoded format. |
spec_id int, optional |
The ID of an ad specification set against which you want to validate the creative. Defaults to 0 (IAB guidelines). |
workspace_id int, optional |
The ID of the workspace in which you want to store the results. |
name string, optional |
The file name of the image. Will be added to the JSON result, allowing you to keep track of which image you scanned. |
Response200 400 401 429
image array |
The original image that was scanned. The url points to the location where you can download the image.
|
info array |
An array with data points collected from the image. See the response object for more details.
aspect_ratio - the ratio between the width/height of the image.
bit_depts - the number of bits used per single pixel.
dimensions - an object with width/height information.
file_extension - the file extension of the original file.
file_size - the size in bytes of the image.
has_border - if the ad has a high-contrasting border.
mime_type - the mime-type used when sending over HTTP.
optimized - shows if the image was optimized by lossless crunching.
|
job_id string |
A unique ID assigned to the scan.
|
meta array |
Meta-data about the scan, like the CPU used, the time it took to complete the scan, the server location, etc.
|
name string |
The name of the creative (copied from the payload).
|
tips_and_updatesscan_results object |
An object containing the full scan results, including the number of passed/failed tests.
The tests array contains the result of each test performed.
|
screenshot array |
A screenshot of the image, in both high-res and thumbnail format. The url points to the location where the screenshot can be found.
|
|
cURL
curl "https://{your_name}.api.advalify.io/v3/scanImage"
-H "X-ApiKey: TCm2Hd_rT4pRNvSZ2cGYCJ6... (example)"
-X POST
-d '{ "data": "dGhpcyBpcyBzb21lIGltYWdlIGRhdGE..." }'
Example Response
{
"image": {
"bytes": 130555,
"mime_type": "image/png",
"url": "https://try.cdn.advalify.io/img/9k30d-79707058-e44f08d5-9k30d-40dad-d7e3a-6vdtxwhb.png" },
"info": {
"aspect_ratio": "3:2",
"bit_depth": 8,
"dimensions": {
"height": 200,
"text": "300x200",
"width": 300 },
"file_extension": "png",
"file_size": 130555,
"has_border": true,
"mime_type": "image/png",
"optimized": {
"perc_savings": 56,
"result": false } },
"job_id": "c2450-81e0a-ae2fa",
"meta": {
"api_version": "v3",
"cpu": "AMD 16-Core EPYC 7302P",
"creative_type": "image",
"ram": "128GB",
"scan_duration": "1.010519",
"server_location": "ams",
"timestamp": 1652869385,
"duration": "1.207079" },
"name": "creative.png",
"scan_results": {
"failed": 2,
"passed": 19,
"report_url": "https://share.advalify.io/c2450-f8e87-71c8a-bf12f",
"tests": {
"aspect_ratio": {
"actual": "379:188",
"data_type": "string",
"expected": "",
"expected_text": "",
"name": "Image Aspect Ratio",
"operator": "",
"result": "ignored",
"unit": "" }, }, },
"screenshot": {
"highres": {
"bytes": 518981,
"color": "#66725d",
"mime_type": "image/png",
"url": "https://try.cdn.advalify.io/img/9k30d-79707058-e44f08d5-9k30d-40dad-d7e3a-q3w76zjk.jpg" },
"thumbnail": {
"bytes": 1634,
"color": "#27292d",
"mime_type": "image/jpg",
"url": "https://try.cdn.advalify.io/img/9k30d-79707058-54ad6e51-c2450-81e0a-ae2fa-5csfh9m4.jpg" } } }
|