← Breadcrumb Generator
Your token

Breadcrumb Generator API

Reading addresses, building trails, the checks and all the code (HTML, JSON-LD, microdata, CSS) run free in the browser and need no API. The API is for the one metered step: send pages with their crumbs and get back, as JSON, a readable name for each crumb and which middle crumbs to leave out. The page checks every name against the crumb's folder name (or the page title for the current page) and keeps its own name where a suggestion fails; 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": "name".

taskWhat it doesReply
nameNames every crumb of every trail from the address's own words (capitals, possessives, joined words, plain abbreviations), marks middle crumbs that are only codes or technical folders as keep: false, and adds a note per trail where something needs checking.One JSON object

Input fields

FieldTypeMeaning
taskstring"name"
pagesstringJSON text: a list of {i, url, title, crumbs, left_out}. crumbs is the trail in order, each {key, folder, label} (key is "home" or the folder's position as text). The page sends at most 25 pages, titles cut at 160 characters.
home_labelstringThe name of the home crumb, usually "Home".
case_stylestring"title", "sentence" or "asis".
clipped_notestringEmpty, or a sentence saying pages were left out or titles cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): pages, a list of {i, crumbs: [{key, label, keep, why}], note} in the order sent, and notes (0 to 3 strings). Before using a name, check each of its words is in that crumb's folder name (or, for the last crumb, the title); the page drops any it cannot back, and never drops the home or current crumb. If the balance ran low, truncated is true and the object may stop early; the page keeps every page that arrived whole.

Worked example

Input (input.json):

{
  "task": "name",
  "pages": "[{\"i\":1,\"url\":\"https://store.northpeak.example/c/mens/t-shirts/graphic-tees-wolf-moon-55102\",\"title\":\"\",\"crumbs\":[{\"key\":\"home\",\"folder\":\"\",\"label\":\"Home\"},{\"key\":\"0\",\"folder\":\"c\",\"label\":\"C\"},{\"key\":\"1\",\"folder\":\"mens\",\"label\":\"Men's\"},{\"key\":\"2\",\"folder\":\"t-shirts\",\"label\":\"T Shirts\"},{\"key\":\"3\",\"folder\":\"graphic-tees-wolf-moon-55102\",\"label\":\"Graphic Tees Wolf Moon\"}],\"left_out\":[]},{\"i\":2,\"url\":\"https://store.northpeak.example/c/acc/usb-c-cables/braided-usb-c-cable-2m\",\"title\":\"\",\"crumbs\":[{\"key\":\"home\",\"folder\":\"\",\"label\":\"Home\"},{\"key\":\"0\",\"folder\":\"c\",\"label\":\"C\"},{\"key\":\"1\",\"folder\":\"acc\",\"label\":\"Acc\"},{\"key\":\"2\",\"folder\":\"usb-c-cables\",\"label\":\"USB C Cables\"},{\"key\":\"3\",\"folder\":\"braided-usb-c-cable-2m\",\"label\":\"Braided USB C Cable 2m\"}],\"left_out\":[]},{\"i\":3,\"url\":\"https://store.northpeak.example/c/womens/rain-jackets/\",\"title\":\"Women's Rain Jackets\",\"crumbs\":[{\"key\":\"home\",\"folder\":\"\",\"label\":\"Home\"},{\"key\":\"0\",\"folder\":\"c\",\"label\":\"C\"},{\"key\":\"1\",\"folder\":\"womens\",\"label\":\"Women's\"},{\"key\":\"2\",\"folder\":\"rain-jackets\",\"label\":\"Women's Rain Jackets\"}],\"left_out\":[]}]",
  "home_label": "Home",
  "case_style": "title",
  "clipped_note": ""
}

Reply:

{"pages":[{"i":1,"crumbs":[{"key":"home","label":"Home","keep":true,"why":""},{"key":"0","label":"C","keep":false,"why":"The folder c is only a code, not a place a visitor could go."},{"key":"1","label":"Men's","keep":true,"why":""},{"key":"2","label":"T-Shirts","keep":true,"why":"Joined the two words of the folder name, as shops spell it."},{"key":"3","label":"Graphic Tees Wolf Moon","keep":true,"why":""}],"note":""},{"i":2,"crumbs":[{"key":"home","label":"Home","keep":true,"why":""},{"key":"0","label":"C","keep":false,"why":"The folder c is only a code, not a place a visitor could go."},{"key":"1","label":"Accessories","keep":true,"why":"Spelled out the short folder name acc."},{"key":"2","label":"USB-C Cables","keep":true,"why":"Fixed the capitals and joined USB-C."},{"key":"3","label":"Braided USB-C Cable 2m","keep":true,"why":"Joined USB-C."}],"note":""},{"i":3,"crumbs":[{"key":"home","label":"Home","keep":true,"why":""},{"key":"0","label":"C","keep":false,"why":"The folder c is only a code, not a place a visitor could go."},{"key":"1","label":"Women's","keep":true,"why":""},{"key":"2","label":"Women's Rain Jackets","keep":true,"why":""}],"note":""}],"notes":[]}

On the page, this reply turns Home › C › Men's › T Shirts › Graphic Tees Wolf Moon into Home › Men's › T-Shirts › Graphic Tees Wolf Moon and Acc into Accessories, with every word found in the 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://breadcrumb-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":"breadcrumb-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": "name", "pages": "[{\"i\":1,\"url\":\"https://example.com/c/mens/t-shirts/\",\"title\":\"\",\"crumbs\":[{\"key\":\"home\",\"folder\":\"\",\"label\":\"Home\"},{\"key\":\"0\",\"folder\":\"c\",\"label\":\"C\"},{\"key\":\"1\",\"folder\":\"mens\",\"label\":\"Men's\"},{\"key\":\"2\",\"folder\":\"t-shirts\",\"label\":\"T Shirts\"}],\"left_out\":[]}]", "home_label": "Home", "case_style": "title", "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="breadcrumb-generator:name:$(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: pages, 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: breadcrumb-generator:name:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json