Skip to content

Getting started

The API has three calls. All answers are JSON. The base address is https://api.tools-directory.workers.dev.

1. List the tools

curl https://api.tools-directory.workers.dev/v1/tools

Each entry has the tool’s slug, name, web page url and a one-line description.

2. Read a tool’s inputs

curl https://api.tools-directory.workers.dev/v1/tools/ascii-art-generator

inputs is a JSON Schema: each property is one field of the tool, with its type, limits, allowed values and the default the page uses. Fields you leave out take that default. outputs lists the values the tool returns. A tool with several modes (for example “by weight” and “by volume”) has a mode field and a modes list that says which fields each mode reads.

3. Run it

curl -X POST https://api.tools-directory.workers.dev/v1/tools/ascii-art-generator \
  -H 'Content-Type: application/json' \
  -d '{"inputs":{"mode":"text","text":"HI","fill":"#"}}'
const res = await fetch('https://api.tools-directory.workers.dev/v1/tools/ascii-art-generator', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"inputs":{"mode":"text","text":"HI","fill":"#"}}),
});
const out = await res.json();
if (!out.ok) throw new Error(out.error.message);
console.log(out.result.stats.primary.display);
import requests

r = requests.post(
    'https://api.tools-directory.workers.dev/v1/tools/ascii-art-generator',
    json={"inputs":{"mode":"text","text":"HI","fill":"#"}},
    timeout=10,
)
out = r.json()
print(out['result']['stats']['primary']['display'] if out['ok'] else out['error'])

The API sends Access-Control-Allow-Origin: *, so the JavaScript works from a web page too.

The answer:

{
  "ok": true,
  "tool": "ascii-art-generator",
  "result": {
    "stats": {
      "primary": { "value": …, "display": "…", "label": "…" }
    },
    "text": "…",
    "steps": [ "…" ],
    "warnings": []
  },
  "data": null
}
  • result.stats.primary is the main answer. value is the raw value; display is formatted the way the page shows it.
  • Other keys in stats are the secondary results listed in outputs.
  • table is the table the page shows, when the tool has one: columns (key and label) and up to 500 rows, each keyed by column key. Otherwise it is null.
  • steps is the working, warnings are notes the page would show (for example “rates are more than a week old”).
  • data is set when the tool used a data feed.