← Awesome List Generator
Your token

Awesome List Generator API

Reading the links, removing duplicates, writing the README.md and contributing.md and checking the list all run free in the browser and need no API. The API is for the one metered step: send the links of a list and get back sections for the unsorted links, tighter descriptions and, when the list has none, a one-line intro.

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

Send "task" first. This app has one job:

taskWhat it doesReply
tidyPuts links with no section into an existing or a new section, rewrites descriptions that are long, rambling or salesy into one short sentence, and writes the intro when facts.intro_needed is true. It never writes a description for a link that has none.{"task":"tidy","new_sections":[...],"placements":[{"id","section"}],"descriptions":[{"id","text"}],"intro","summary"}

Input fields

FieldTypeMeaning
taskstring"tidy". Required.
titlestringThe list's title, e.g. "Awesome Python Testing". Required.
topicstringOptional: who the list is for, at most 200 characters. May be empty.
sectionsstringJSON text: the list's section names in order. May be []. Required.
itemsstringJSON text: a list of {id, name, url, desc, section}. id is "i1", "i2"...; section is "" for an unsorted link. The page sends up to 200. Required.
factsstringJSON text: links_total, links_sent, unsorted, with_description, sections, intro_needed. Required.

The reply

job.output.output is JSON text in the shape above. The page uses an answer only when its id was sent and answered once, a placement is for an unsorted link and names a listed or new section, a description replaces one the visitor wrote, and no number, praise word or link is added that is not in the visitor's words. If the balance ran low, truncated is true and the object may stop early; the answers that arrived whole are kept.

Worked examples

task: tidy - eleven bare links with no sections

Input (input.json):

{
  "task": "tidy",
  "title": "Awesome Python Testing",
  "topic": "Python developers choosing test tools",
  "sections": "[]",
  "items": "[{\"id\":\"i1\",\"name\":\"pytest\",\"url\":\"https://docs.pytest.org\",\"desc\":\"Framework that makes it easy to write small, readable tests, and scales to complex functional testing.\",\"section\":\"\"},{\"id\":\"i2\",\"name\":\"hypothesis\",\"url\":\"https://github.com/HypothesisWorks/hypothesis\",\"desc\":\"Property-based testing library that generates test cases for you.\",\"section\":\"\"},{\"id\":\"i3\",\"name\":\"pytest-cov\",\"url\":\"https://github.com/pytest-dev/pytest-cov\",\"desc\":\"Coverage plugin for pytest.\",\"section\":\"\"},{\"id\":\"i4\",\"name\":\"pytest-xdist\",\"url\":\"https://github.com/pytest-dev/pytest-xdist\",\"desc\":\"Pytest plugin to run your tests in parallel across several CPUs.\",\"section\":\"\"},{\"id\":\"i5\",\"name\":\"Tox\",\"url\":\"https://tox.wiki\",\"desc\":\"Automate and standardize testing across several Python environments from one config file.\",\"section\":\"\"},{\"id\":\"i6\",\"name\":\"Nox\",\"url\":\"https://nox.thea.codes\",\"desc\":\"Flexible test automation where the sessions are configured in a Python file.\",\"section\":\"\"},{\"id\":\"i7\",\"name\":\"freezegun\",\"url\":\"https://github.com/spulec/freezegun\",\"desc\":\"Lets your tests travel through time by mocking the datetime module.\",\"section\":\"\"},{\"id\":\"i8\",\"name\":\"responses\",\"url\":\"https://github.com/getsentry/responses\",\"desc\":\"Utility for mocking out the requests library in your tests.\",\"section\":\"\"},{\"id\":\"i9\",\"name\":\"Coverage\",\"url\":\"https://coverage.readthedocs.io\",\"desc\":\"Measures code coverage of Python programs and shows which lines ran.\",\"section\":\"\"},{\"id\":\"i10\",\"name\":\"faker\",\"url\":\"https://github.com/joke2k/faker\",\"desc\":\"Generates fake data such as names, addresses and dates for your tests.\",\"section\":\"\"},{\"id\":\"i11\",\"name\":\"Factoryboy\",\"url\":\"https://factoryboy.readthedocs.io\",\"desc\":\"Fixtures replacement that builds test objects from factories.\",\"section\":\"\"}]",
  "facts": "{\"links_total\":11,\"links_sent\":11,\"unsorted\":11,\"with_description\":11,\"sections\":0,\"intro_needed\":true}"
}

Reply:

{
  "task": "tidy",
  "new_sections": [
    "Frameworks and libraries",
    "Coverage tools",
    "Test automation",
    "Mocking tools",
    "Test data"
  ],
  "placements": [
    {
      "id": "i1",
      "section": "Frameworks and libraries"
    },
    {
      "id": "i2",
      "section": "Frameworks and libraries"
    },
    {
      "id": "i3",
      "section": "Coverage tools"
    },
    {
      "id": "i9",
      "section": "Coverage tools"
    },
    {
      "id": "i4",
      "section": "Test automation"
    },
    {
      "id": "i5",
      "section": "Test automation"
    },
    {
      "id": "i6",
      "section": "Test automation"
    },
    {
      "id": "i7",
      "section": "Mocking tools"
    },
    {
      "id": "i8",
      "section": "Mocking tools"
    },
    {
      "id": "i10",
      "section": "Test data"
    },
    {
      "id": "i11",
      "section": "Test data"
    }
  ],
  "descriptions": [
    {
      "id": "i1",
      "text": "Framework for writing small, readable tests that scales to complex functional testing."
    }
  ],
  "intro": "A curated list of Python testing frameworks, coverage, automation, mocking tools and test data for choosing test tools.",
  "summary": "Sorted the links into testing sections and shortened the pytest description."
}

task: tidy - a sorted list that only needs an intro

Input:

{
  "task": "tidy",
  "title": "Awesome Static Site Generators",
  "topic": "",
  "sections": "[\"Generators\",\"Themes\",\"Hosting\"]",
  "items": "[{\"id\":\"i1\",\"name\":\"Hugo\",\"url\":\"https://gohugo.io/\",\"desc\":\"Static site generator written in Go, known for very fast builds.\",\"section\":\"Generators\"},{\"id\":\"i2\",\"name\":\"Jekyll\",\"url\":\"https://jekyllrb.com\",\"desc\":\"Blog-aware static site generator in Ruby, used by GitHub Pages.\",\"section\":\"Generators\"},{\"id\":\"i3\",\"name\":\"Eleventy\",\"url\":\"https://www.11ty.dev\",\"desc\":\"A simpler static site generator written in JavaScript.\",\"section\":\"Generators\"},{\"id\":\"i4\",\"name\":\"Astro\",\"url\":\"https://astro.build\",\"desc\":\"Web framework for content-driven websites that ships less JavaScript to the browser.\",\"section\":\"Generators\"},{\"id\":\"i5\",\"name\":\"Zola\",\"url\":\"https://www.getzola.org/\",\"desc\":\"Single binary static site engine written in Rust.\",\"section\":\"Generators\"},{\"id\":\"i6\",\"name\":\"Hugo Themes\",\"url\":\"https://themes.gohugo.io/\",\"desc\":\"Themes made for Hugo sites, searchable by feature.\",\"section\":\"Themes\"},{\"id\":\"i7\",\"name\":\"Jekyll Themes\",\"url\":\"http://jekyllthemes.io/\",\"desc\":\"Free and premium themes for Jekyll.\",\"section\":\"Themes\"},{\"id\":\"i8\",\"name\":\"GitHub Pages\",\"url\":\"https://pages.github.com\",\"desc\":\"Host a website straight from a GitHub repository.\",\"section\":\"Hosting\"},{\"id\":\"i9\",\"name\":\"Netlify\",\"url\":\"https://www.netlify.com/\",\"desc\":\"Deploys static sites from git with previews for every pull request.\",\"section\":\"Hosting\"},{\"id\":\"i10\",\"name\":\"Cloudflare Pages\",\"url\":\"https://pages.cloudflare.com\",\"desc\":\"Deploy static sites to Cloudflare's network from git.\",\"section\":\"Hosting\"}]",
  "facts": "{\"links_total\":10,\"links_sent\":10,\"unsorted\":0,\"with_description\":10,\"sections\":3,\"intro_needed\":true}"
}

Reply:

{
  "task": "tidy",
  "new_sections": [],
  "placements": [],
  "descriptions": [],
  "intro": "A curated list of static site generators, themes and hosting for building websites.",
  "summary": "No links needed sorting and descriptions were already short, so only an intro was added."
}

On the page, the accepted answers are written into your list and the README is made again; Undo puts it back.

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://awesome-list-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":"awesome-list-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": "tidy", "title": "Awesome Python Testing", "topic": "", "sections": "[...]", "items": "[...]", "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="awesome-list-generator:tidy:$(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, new_sections, placements, descriptions, intro, summary
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: awesome-list-generator:tidy:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json