REST API ยท v1

Use the FileToolz text tools from your own code.

Word and character counting, case conversion, and CSV conversion over plain HTTP. Keys are issued only to signed-in accounts, so every call runs as a real user.

Every endpoint requires an API key. Keys belong to a FileToolz account and are created while signed in on the API keys page. Requests without a valid key get 401 invalid_api_key.

Quick start

Three steps, no SDK required.

  1. Sign in or create a FileToolz account.
  2. Open API keys and create a key. It is shown once โ€” store it somewhere safe.
  3. Send it on every request as Authorization: Bearer <key>.
curl https://api.filetoolz.online/v1/word-count \
  -H "Authorization: Bearer ftz_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text":"Count the words in this sentence."}'
{
  "ok": true,
  "data": {
    "characters": 33,
    "charactersWithoutSpaces": 27,
    "words": 6,
    "lines": 1,
    "paragraphs": 1
  }
}

Authentication

Send the key either way; both are accepted.

HeaderExample
AuthorizationAuthorization: Bearer ftz_โ€ฆ
x-api-keyx-api-key: ftz_โ€ฆ
Keys are stored hashed. Only a SHA-256 hash is kept in the database, so a key cannot be read back or recovered โ€” if you lose one, revoke it and create another. Revoking takes effect on the next request.

Endpoints

Base URL https://api.filetoolz.online/v1. All responses are JSON with an ok flag; everything is POST apart from the health check. POST bodies accept JSON, or raw text/plain for the single-field endpoints.

GET /v1/health

Confirms a key works and returns the account it belongs to. Nothing is stored or changed.

curl https://api.filetoolz.online/v1/health \
  -H "Authorization: Bearer ftz_your_key_here"
POST /v1/word-count

Counts characters, characters without spaces, words, lines and paragraphs. Words are split on whitespace; blank lines count as paragraphs separators, not paragraphs.

curl https://api.filetoolz.online/v1/word-count \
  -H "Authorization: Bearer ftz_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello there."}'
POST /v1/case-convert

Converts text to another case. Modes: upper, lower, title, sentence, slug. Defaults to upper.

curl https://api.filetoolz.online/v1/case-convert \
  -H "Authorization: Bearer ftz_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text":"hello world","case":"title"}'
POST /v1/text-to-csv

Turns plain text into CSV. One line becomes one row; fields split on whitespace by default, or on the single character you pass as inputSeparator. Fields containing the output separator, quotes or newlines are quoted per RFC 4180.

curl https://api.filetoolz.online/v1/text-to-csv \
  -H "Authorization: Bearer ftz_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text":"a b c\nd e f","columns":["one","two","three"]}'
POST /v1/csv-to-text

Parses CSV (quoted fields, doubled quotes, CRLF, newlines inside quotes) into tab-separated text, or into records with "format":"json".

curl https://api.filetoolz.online/v1/csv-to-text \
  -H "Authorization: Bearer ftz_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text":"name,role\n\"Doe, Jane\",\"writer\"","format":"json","header":true}'

Parameters

EndpointFieldMeaning
word-counttextRequired. Up to 200,000 characters.
case-converttext, caseRequired text; optional mode, default upper.
text-to-csvinputSeparatorwhitespace (default), tab, or a single character.
text-to-csvseparatorOutput column separator, default a comma.
text-to-csvcolumnsOptional array of header names.
text-to-csveolRow ending, \r\n (default) or \n.
csv-to-textdelimiterInput delimiter, default a comma.
csv-to-textoutputSeparatortab (default) or a single character.
csv-to-textformat, headertext (default) or json; header uses row 1 as keys.

Errors

Failures use the same envelope, with ok: false and a machine-readable code.

{
  "ok": false,
  "error": {
    "code": "invalid_api_key",
    "message": "That API key is not valid or has been revoked."
  }
}
StatusCodeWhen
400missing_field / invalid_fieldA required field is missing or has the wrong type.
400invalid_jsonThe JSON body could not be parsed.
400empty_textCSV input contained no data.
401missing_api_keyNo key was sent.
401invalid_api_keyThe key is unknown or has been revoked.
405method_not_allowedWrong HTTP method for the endpoint.
413payload_too_large / text_too_largeBody over 1 MB, or text over 200,000 characters.
502auth_upstream_errorKey verification was temporarily unavailable.

Need a tool that is not here yet? The file conversions (PDF, Word, images) still run in the browser at simtools.filetoolz.online.