← Product Listing Generator
Your token

Product Listing Generator API

Reading your product export or list, checking it and writing the listing HTML, the CSS, the head tags with JSON-LD and Markdown all run free in the browser and need no API. The API is for the one metered step: send your store's name, description, categories and product list and get back, as JSON, a short description for the top of the listing, up to three picks with a reason each, a category for each product that has none, and a search title and meta description. The page checks every suggestion and refuses any that adds a number, a name or a claim your list does not contain.

The task field

This app has one task. Always send "task": "refine".

taskWhat it doesReply
refineWrites the description under the heading, picks up to three products (never a sold-out one) with a reason from each product's own words, puts each uncategorised product in an existing or new category, and writes a search title (with the store name) and a meta description.One JSON object

Input fields

All values are strings. task and products are required.

FieldMeaning
task"refine"
storeYour store's name, or "".
headingYour page heading, or "".
introYour own description line, or "".
categoriesThe categories your products use, separated by ; , or "".
productsJSON text: [{n, name, category, price, description}] in page order, n starting at 1. category is "" for a product without one; price reads like "$28.00", "from $24.00", "$34.00 (was $42.00)" or ends in ", sold out". The page sends at most 60 products (the first 40 and the last 20) and clips long text in the middle, keeping both ends.
items_noteEmpty, or a sentence saying what was left out.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence) with four keys: intro, a string; picks, a list of {n, why}; categories, a list of {n, category}; and seo, {title, description}. Before using it, check that no text adds a number, name or claim, that each n is a product you sent, that a category goes only to a product without one, that no pick is sold out, that the title is at most 60 characters and names the store, and that the description is at most 160; the page does all of this and lists what it refused. If the balance ran low, truncated is true and the object may stop early; the page keeps every part that arrived whole.

Worked example

Input (input.json), the Shopify export sample on the page:

{
  "task": "refine",
  "store": "Fernhill Pottery",
  "heading": "",
  "intro": "",
  "categories": "Mugs; Cups; Plates; Bowls; Serveware; Vases; Gift cards",
  "products": "[{\"n\":1,\"name\":\"Stoneware mug, moss glaze\",\"category\":\"Mugs\",\"price\":\"from $28.00\",\"description\":\"Wheel-thrown stoneware mug in a soft green glaze. Holds 350 ml; dishwasher safe.\"},{\"n\":2,\"name\":\"Espresso cups, set of two\",\"category\":\"Cups\",\"price\":\"$34.00 (was $42.00)\",\"description\":\"Two 90 ml cups without handles, glazed inside, raw clay outside.\"},{\"n\":3,\"name\":\"Dinner plate, ash glaze\",\"category\":\"Plates\",\"price\":\"$38.00\",\"description\":\"27 cm plate with a matte grey glaze and a thin rolled rim.\"},{\"n\":4,\"name\":\"Side plate, ash glaze\",\"category\":\"Plates\",\"price\":\"$26.00\",\"description\":\"20 cm side plate to match the dinner plate.\"},{\"n\":5,\"name\":\"Pasta bowl, moss glaze\",\"category\":\"Bowls\",\"price\":\"$36.00\",\"description\":\"Wide, shallow bowl for pasta and salads, 22 cm across.\"},{\"n\":6,\"name\":\"Breakfast bowl\",\"category\":\"Bowls\",\"price\":\"$24.00 (was $30.00)\",\"description\":\"Deep 14 cm bowl for cereal, yoghurt and soup.\"},{\"n\":7,\"name\":\"Bud vase trio\",\"category\":\"Vases\",\"price\":\"$45.00\",\"description\":\"Three small vases in oat, moss and ash, for single stems.\"},{\"n\":8,\"name\":\"Planter with saucer\",\"category\":\"\",\"price\":\"$42.00\",\"description\":\"16 cm planter with a drainage hole and a matching saucer.\"},{\"n\":9,\"name\":\"Fernhill gift card\",\"category\":\"Gift cards\",\"price\":\"from $25.00\",\"description\":\"Sent by email; spend it on anything in the shop.\"},{\"n\":10,\"name\":\"Stoneware mug, oat glaze\",\"category\":\"Mugs\",\"price\":\"$28.00, sold out\",\"description\":\"The same wheel-thrown mug in a speckled oat glaze. Holds 350 ml.\"},{\"n\":11,\"name\":\"Oval serving platter\",\"category\":\"Serveware\",\"price\":\"$88.00, sold out\",\"description\":\"40 cm oval platter for a roast or a cheese board. Hand wash.\"}]",
  "items_note": ""
}

Reply:

{
  "intro": "Wheel-thrown stoneware mugs, cups, plates, bowls and vases from Fernhill Pottery, plus serveware and gift cards.",
  "picks": [
    {"n": 1, "why": "A wheel-thrown stoneware mug in a soft green glaze that holds 350 ml and is dishwasher safe."},
    {"n": 2, "why": "You get two 90 ml espresso cups without handles, glazed inside, raw clay outside."},
    {"n": 7, "why": "Three small vases in oat, moss and ash, for single stems."}
  ],
  "categories": [
    {"n": 8, "category": "Planter"}
  ],
  "seo": {
    "title": "Stoneware mugs, plates and bowls | Fernhill Pottery",
    "description": "Wheel-thrown stoneware mugs, cups, plates, bowls and vases, plus serveware and gift cards, from Fernhill Pottery. Browse by category."
  }
}

On the page, the planter gets a category of its own, the moss mug, the espresso cups and the vase trio appear as picks with their reasons, and the page title becomes “Stoneware mugs, plates and bowls | Fernhill Pottery”.

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.
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://product-listing-generator.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":"product-listing-generator"}' | 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": "refine", "store": "Fernhill Pottery", "heading": "", "intro": "", "categories": "Mugs; Plates", "products": "[...]", "items_note": ""}
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="product-listing-generator:refine:$(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: intro, picks, categories, seo
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: product-listing-generator:refine:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json