← Amazon Main Image Checker
Your token

Amazon Main Image Checker API

Measuring the photo, the checks, the white-background fix and every download run free in the browser and need no API. The API is for the one metered step: send the measurements and a few words about the product, get back the reshoot fixes and a plan for the other images. The photo itself is never sent.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

The app has one task. Always send "task": "plan".

taskWhat it doesReply
planWrites one fix for each main image check that failed or is close (background, fill, zoom, detail...), then plans 4 to 7 images after the main one - detail, scale, infographic, lifestyle, in use, what's included, packaging, comparison, variants - each with the shopper question it answers, how to shoot it, on-image text taken only from your facts, what it needs and what could make it misleading. Ends with a production route, open questions and a pre-upload checklist.One JSON object

Input fields

FieldTypeMeaning
taskstring"plan" (required).
productstringWhat the product is, in your words (required, up to 200 characters).
includedstringWhat the buyer receives (may be empty). Longer than 300 characters keeps its start and end with a [... N characters left out ...] marker.
pointsstringFeatures and claims you can back up (may be empty, up to 600 characters the same way). Numbers and claims on the planned images must come from here, product or included.
marketplacestringThe Amazon store, e.g. amazon.com, amazon.co.uk.
budgetstringdiy, small, pro or unsure.
factsstringJSON text of the page's measurements: image {width, height, format}, backdrop {rgb, uniform, transparent, cast}, product {fill_pct, longest_px, brightness, off_centre_pct}, checks [{id, status, value}] with ids background, fill, zoom, max_size, format, whole_product, centred, detail, exposure, colour_cast and status pass / warn / fail / skip, and export {size, fill_pct}. Build it in node with PhotoCheck.facts() from photocheck.js.

The reply

job.output.output is JSON text: {"task": "plan", "summary", "main_fixes": [{"check", "problem", "fix"}], "images": [{"slot", "type", "question", "direction", "callouts", "needs", "risk"}], "route": {"pick", "why"}, "unknowns", "final_qa"}. route.pick is diy, ai, pro or hybrid. The page keeps a fix only for a check it flagged, lists flagged checks the reply skipped, renumbers images from slot 2, and marks any callout whose number or claim word (certified, waterproof, BPA-free...) is not in your text. If the balance ran low, truncated is true and the object may stop early; the parts that arrived whole are kept.

Worked examples

A mug shot on grey paper - three checks fail

Input:

{
 "task": "plan",
 "product": "12 oz ceramic coffee mug, teal glaze, with handle",
 "included": "One mug",
 "points": "Holds 12 oz (355 ml). Stoneware. Dishwasher safe. 3.5 in tall, 3.2 in wide without the handle. Comes in teal, white and black.",
 "marketplace": "amazon.com",
 "budget": "diy",
 "facts": "{\"image\": {\"width\": 1600, \"height\": 1200, \"format\": \"JPEG\"}, \"backdrop\": {\"rgb\": [197, 198, 202], \"uniform\": true, \"transparent\": false, \"cast\": 5}, \"product\": {\"fill_pct\": 57.2, \"longest_px\": 697, \"brightness\": 95, \"off_centre_pct\": 1.8}, \"checks\": [{\"id\": \"background\", \"status\": \"fail\", \"value\": \"rgb(197, 198, 202)\"}, {\"id\": \"fill\", \"status\": \"fail\", \"value\": \"57.2%\"}, {\"id\": \"zoom\", \"status\": \"pass\", \"value\": \"1,600 px\"}, \"... 7 more checks\"], \"export\": {\"size\": 2000, \"fill_pct\": 88}}"
}

Reply:

{
 "task": "plan",
 "summary": "The mug photo has a grey backdrop, the mug fills only 57.2% of the frame and has just 697 px of its own detail, so the plan is to reshoot it closer on white and then use images 2 to 6 to show size, material and colours.",
 "main_fixes": [
  {
   "check": "background",
   "problem": "The backdrop measured rgb(197, 198, 202), a light grey, not pure white 255,255,255.",
   "fix": "The page's download turns a plain backdrop like this into pure white, so you can use it for now. At the next shoot, put the mug on a sheet of white paper that curves up behind it, light it from both sides with two lamps, and raise exposure compensation by about 1 stop until the paper looks white on the camera screen."
  },
  {
   "check": "fill",
   "problem": "The mug fills 57.2% of the frame; Amazon wants 85% or more.",
   "fix": "The page's download crops to the mug and brings the fill to 88%, so the export already fixes this. At the next shoot, move the camera closer or zoom in until the mug nearly touches the frame edges with a small even margin, and keep the whole mug, handle included, in view."
  },
  {
   "check": "detail",
   "problem": "The mug itself is only 697 px long in the photo, under the 1,400 px needed for a sharp zoom.",
   "fix": "The page can only enlarge it, which does not add real sharpness. Reshoot with the mug filling the frame, at your camera's full resolution, with the camera on a tripod or a stack of books, at the lowest ISO, and a 2-second timer to avoid shake. Do not crop a wide shot afterwards."
  }
 ],
 "images": [
  {
   "slot": 2,
   "type": "detail",
   "question": "What does the glaze and the handle look like up close?",
   "direction": "Shoot from slightly above at a 45 degree angle, cropped tight on the handle join and the rim, on white paper with soft light from the side so the teal glaze shows its depth without glare.",
   "callouts": [
    "Teal glaze",
    "Stoneware"
   ],
   "needs": "The mug, white paper, a window or lamp for side light.",
   "risk": "Strong reflections can wash out the glaze colour, so check that the teal matches the real mug."
  },
  {
   "slot": 3,
   "type": "scale",
   "question": "How big is this mug?",
   "direction": "Photograph the mug straight on beside a hand holding the handle, or beside a common object such as a pen, on a plain light background, with the camera level and the whole mug in frame.",
   "callouts": [
    "3.5 in tall",
    "3.2 in wide without handle"
   ],
   "needs": "The mug, a hand or a common object, and a ruler to confirm the measurements.",
   "risk": "Perspective can make the mug look larger or smaller, so keep the camera at mug height and the same distance for every shot."
  },
  "... 3 more images"
 ],
 "route": {
  "pick": "diy",
  "why": "Your budget is DIY and every image here needs only the mug, white paper, a window or lamp, and a hand, so there is no need for a studio or models."
 },
 "unknowns": [
  "Is the mug microwave safe as well as dishwasher safe?",
  "Do you have all three colours in stock to photograph for the colour image?",
  "What is the mug's weight?"
 ],
 "final_qa": [
  "Check the main image is pure white 255,255,255 at the edges with the free page.",
  "Check the mug fills at least 85% of the frame and the handle is fully inside.",
  "Check the mug's own length is at least 1,400 px before enlarging.",
  "Check the teal on screen matches the real glaze.",
  "Check every number on the images matches 12 oz, 355 ml, 3.5 in and 3.2 in.",
  "Check the main image has no text, props or shadows that look like borders."
 ]
}

A bottle that already passes

Input:

{
 "task": "plan",
 "product": "Insulated stainless steel water bottle, 750 ml, blue",
 "included": "Bottle and screw cap",
 "points": "Keeps drinks cold for 24 hours. 750 ml. Powder-coated steel. Fits most car cup holders.",
 "marketplace": "amazon.co.uk",
 "budget": "small",
 "facts": "{\"image\": {\"width\": 2000, \"height\": 2000, \"format\": \"JPEG\"}, \"backdrop\": {\"rgb\": [255, 255, 255], \"uniform\": true, \"transparent\": false, \"cast\": 0}, \"product\": {\"fill_pct\": 88.1, \"longest_px\": 1761, \"brightness\": 123, \"off_centre_pct\": 0}, \"checks\": [{\"id\": \"background\", \"status\": \"pass\", \"value\": \"99.5% pure white\"}, {\"id\": \"fill\", \"status\": \"pass\", \"value\": \"88.1%\"}, {\"id\": \"zoom\", \"status\": \"pass\", \"value\": \"2,000 px\"}, \"... 7 more checks\"], \"export\": {\"size\": 2000, \"fill_pct\": 88}}"
}

Reply:

{
 "task": "plan",
 "summary": "The main image passes every check, so keep it as it is and spend the effort on five supporting images that show size, cold-keeping, the finish, the box contents and the car cup holder fit.",
 "main_fixes": [],
 "images": [
  {
   "slot": 2,
   "type": "scale",
   "question": "How big is the 750 ml bottle in real life?",
   "direction": "Shoot straight on at chest height with the blue bottle held in one hand beside a common object such as a hand or a laptop, plain light background, soft window light from the left.",
   "callouts": [
    "750 ml capacity"
   ],
   "needs": "The bottle, a hand model or familiar object, and a measured height and diameter if you want to state them.",
   "risk": "Do not print a height or width on the image unless you have measured it with a ruler."
  },
  {
   "slot": 3,
   "type": "infographic",
   "question": "What are the key benefits at a glance?",
   "direction": "Bottle shot slightly from the front at eye level on a clean light grey background, with two or three short text lines placed around it and thin lines pointing to the body and the cap. Keep the text large enough to read on a phone.",
   "callouts": [
    "Keeps drinks cold for 24 hours",
    "Insulated stainless steel",
    "Powder-coated finish"
   ],
   "needs": "The bottle and the seller's wording for the cold-keeping claim, ideally with the test conditions written down.",
   "risk": "The 24 hours claim must hold for the conditions you tested, so note the starting temperature and the room temperature before printing it."
  },
  "... 3 more images"
 ],
 "route": {
  "pick": "diy",
  "why": "Your main photo already passes, and these five images need only the bottle, a window or lamp, a phone or camera and a car, so a small budget is best spent on a cheap light box or white card rather than a studio."
 },
 "unknowns": [
  "What are the bottle's height and diameter in millimetres?",
  "Under what conditions was the 24 hours cold-keeping tested?",
  "Does the bottle come in other colours or sizes?",
  "Is the cap leak-proof, and can you back that up?"
 ],
 "final_qa": [
  "Check that the blue in every photo matches the real bottle on a phone screen.",
  "Check that every callout is large enough to read at thumbnail size.",
  "Check that no text or badge appears on the main image.",
  "Check that the 24 hours and 750 ml text matches your product page and packaging.",
  "Check that the cup holder photo does not claim a fit beyond what you tested."
 ]
}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or facts is not a string.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://amazon-white-background.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"amazon-white-background"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "plan", "product": "12 oz ceramic coffee mug, teal glaze, with handle", "included": "One mug", "points": "...", "marketplace": "amazon.com", "budget": "diy", "facts": "{...}"}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="amazon-white-background:plan:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: task, steps, verdict, verdict_why, recap, next_drill
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: amazon-white-background:plan:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json