HTTP API
Free, no key, CORS enabled, cacheable. Base URL https://capstring.netlify.app/api. Text up to 10,000 characters (about 8 KB per GET URL; use POST /api/batch beyond that). Full reference with try-it-out at /api (OpenAPI 3.1, openapi.json). Library and CLI docs at /docs.
| Endpoint | Returns |
|---|---|
GET /api/:style/:text | { input, style, output } |
GET /api/all/:text | every style at once |
POST /api/batch | body { "style": "kebab", "texts": ["a", "b"] } (max 1,000) |
GET /api/spell/:text | spell-corrected text and a list of corrections, optional ?style= (max 500 chars, 50 corrections) |
GET /api/count/:text | words, characters, characters without spaces |
GET /api/lorem/:count | lorem ipsum, 1 to 1000 words, optional ?style= |
GET /api/badge/:style/:text | shields-style SVG badge for your README, ?label= to override |
GET /api/styles | style names and categories |
Output formats
JSON by default. Pick another with a file extension (/api/title/hello.txt), a query (?format=txt), or an Accept header. The extension wins when more than one is given. Formats: json, txt, html, xml, yaml, csv, jsonp (?callback=), svg and png (the result as an image).
curl https://capstring.netlify.app/api/title/hello%20world
curl https://capstring.netlify.app/api/sponge/hello%20world.txt
curl -o hello.png https://capstring.netlify.app/api/flip/hello%20world.png
curl -H "Accept: text/csv" https://capstring.netlify.app/api/all/hello%20world
curl https://capstring.netlify.app/api/title/hello%20world.yaml
curl -X POST https://capstring.netlify.app/api/batch \
-H "Content-Type: application/json" \
-d '{"style":"slug","texts":["Crème Brûlée","Hello World"]}'
curl "https://capstring.netlify.app/api/spell/helo%20wrld?style=title"
curl https://capstring.netlify.app/api/count/hello%20world.txt
curl https://capstring.netlify.app/api/lorem/10.txt
curl -o badge.svg https://capstring.netlify.app/api/badge/sponge/hello%20world
Errors come back in the requested format as { "error": { "code": "unknown_style", "message": "..." } } with a matching status. Use ?text= instead of the path when your text contains slashes or ends in an extension. Add ?pretty=1 for indented JSON.