← Footer Generator
Your token

Footer Generator API

Reading links, grouping them, the checks and all the code (HTML, CSS, React) run free in the browser and need no API. The API is for the one metered step: send your links and get back, as JSON, footer columns with short headings, which links belong in the legal row, and clearer names for vague links. The page uses only the links it sent, puts back any link the reply left out, and keeps a new name only when each of its words is in that link's old name or address; do the same with the reply.

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

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

taskWhat it doesReply
groupSorts the links into 2 to 5 columns (never more than 6) with 1 to 3 word headings, lists legal and policy links for the bottom row, suggests clearer names for vague or oddly written links (only from the link's own words or address), and adds up to 3 notes for the visitor.One JSON object

Input fields

FieldTypeMeaning
taskstring"group"
site_namestringThe site's name.
linksstringJSON text: a list of {id, label, href}, ids "l1", "l2", ... The page sends at most 60 links; social profiles and contact details are not sent.
currentstringJSON text: the page's grouping, {columns: [{heading, ids}], legal: [ids]}, including any headings the visitor typed.
clipped_notestringEmpty, or a sentence saying links were left out before sending.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): columns, a list of {heading, ids, why} in reading order; legal, a list of ids; labels, a list of {id, label, why}; and notes (0 to 3 strings). Before using it, check every id is one you sent and appears once; put back any you sent that is missing. Keep a new label only when each of its words is in that link's old label or its address. If the balance ran low, truncated is true and the object may stop early; the page keeps every column that arrived whole.

Worked example

Input (input.json):

{
  "task": "group",
  "site_name": "Northpeak Outfitters",
  "links": "[{\"id\":\"l1\",\"label\":\"Men's\",\"href\":\"/collections/mens\"},{\"id\":\"l2\",\"label\":\"Women's\",\"href\":\"/collections/womens\"},{\"id\":\"l3\",\"label\":\"Kids\",\"href\":\"/collections/kids\"},{\"id\":\"l4\",\"label\":\"Click here\",\"href\":\"/gift-cards\"},{\"id\":\"l5\",\"label\":\"FAQ's\",\"href\":\"/help/faq\"},{\"id\":\"l6\",\"label\":\"info\",\"href\":\"/about-us\"},{\"id\":\"l7\",\"label\":\"ABOUT\",\"href\":\"/our-story\"},{\"id\":\"l8\",\"label\":\"more\",\"href\":\"/journal\"},{\"id\":\"l9\",\"label\":\"store locator\",\"href\":\"/stores\"},{\"id\":\"l10\",\"label\":\"Track my order\",\"href\":\"/orders/track\"},{\"id\":\"l11\",\"label\":\"Shipping & returns\",\"href\":\"/help/shipping-returns\"},{\"id\":\"l12\",\"label\":\"Size guide\",\"href\":\"/help/size-guide\"},{\"id\":\"l13\",\"label\":\"Careers\",\"href\":\"/careers\"},{\"id\":\"l14\",\"label\":\"privacy\",\"href\":\"/privacy\"},{\"id\":\"l15\",\"label\":\"Terms\",\"href\":\"/terms\"},{\"id\":\"l16\",\"label\":\"Cookie settings\",\"href\":\"/cookies\"}]",
  "current": "{\"columns\":[{\"heading\":\"Explore\",\"ids\":[\"l1\",\"l2\",\"l3\",\"l8\"]},{\"heading\":\"Support\",\"ids\":[\"l4\",\"l5\",\"l10\",\"l11\",\"l12\"]},{\"heading\":\"Company\",\"ids\":[\"l6\",\"l7\",\"l9\",\"l13\"]}],\"legal\":[\"l14\",\"l15\",\"l16\"]}",
  "clipped_note": ""
}

Reply:

{"columns":[{"heading":"Shop","ids":["l1","l2","l3","l4"],"why":"Moved the gift cards link in with the collections, since shoppers browse them together."},{"heading":"Support","ids":["l10","l11","l5","l12"],"why":""},{"heading":"Company","ids":["l7","l6","l9","l8","l13"],"why":""}],"legal":["l14","l15","l16"],"labels":[{"id":"l4","label":"Gift cards","why":"\"Click here\" did not say where it goes; the address is /gift-cards."},{"id":"l5","label":"FAQ","why":"The label was spelled with a stray apostrophe."},{"id":"l6","label":"About us","why":"\"info\" is vague; the address is /about-us."},{"id":"l7","label":"Our story","why":"\"ABOUT\" is all capitals and the address is /our-story."},{"id":"l8","label":"Journal","why":"\"more\" did not say where it goes; the address is /journal."},{"id":"l9","label":"Store locator","why":"Capitalised to match the other labels."},{"id":"l14","label":"Privacy","why":"Capitalised to match the other legal labels."}],"notes":["\"About us\" and \"Our story\" may lead to similar pages; consider whether both are needed."]}

On the page, this reply moves the gift cards link (named "Click here") into a Shop column as "Gift cards", renames "FAQ's" to "FAQ" and "info" to "About us", and puts privacy, terms and cookie settings in the legal row, with every name backed by the link's own words or address.

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://footer-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":"footer-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": "group", "site_name": "Northpeak", "links": "[{\"id\":\"l1\",\"label\":\"Click here\",\"href\":\"/gift-cards\"},{\"id\":\"l2\",\"label\":\"FAQ's\",\"href\":\"/help/faq\"},{\"id\":\"l3\",\"label\":\"privacy\",\"href\":\"/privacy\"}]", "current": "{\"columns\":[{\"heading\":\"Support\",\"ids\":[\"l1\",\"l2\"]}],\"legal\":[\"l3\"]}", "clipped_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="footer-generator:group:$(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: columns, legal, labels, notes
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: footer-generator:group:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json