Skip to content
ToolsOnDuty - free online tools
ToolsOnDuty / docs
Browse documentation

Reference / Developer

Developer API

26 endpoints for developer workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/base641 credit / call

Base64 encode / decode

Encode text to Base64 or decode Base64 back to text (Unicode-safe).

ParameterTypeRequiredDescription
textstringYesText (or Base64) to convert.
modestringNoencode | decode. Default: encode.

Request

curl -X POST https://toolsonduty.com/api/v1/base64 \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"hello","mode":"encode"}'

Response

{
  "ok": true,
  "data": {
    "result": "aGVsbG8="
  }
}
POST/v1/url-encode1 credit / call

URL encode / decode

Percent-encode text for safe use in URLs, or decode a percent-encoded string.

ParameterTypeRequiredDescription
textstringYesText to convert.
modestringNoencode | decode. Default: encode.

Request

curl -X POST https://toolsonduty.com/api/v1/url-encode \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"a b","mode":"encode"}'

Response

{
  "ok": true,
  "data": {
    "result": "a%20b"
  }
}
POST/v1/slug1 credit / call

Slug generator

Convert text into a URL-friendly slug.

ParameterTypeRequiredDescription
textstringYesText to slugify.
separatorstringNo- or _. Default: -.
lowercasebooleanNoLowercase the result. Default: true.

Request

curl -X POST https://toolsonduty.com/api/v1/slug \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"10 Best Practices"}'

Response

{
  "ok": true,
  "data": {
    "slug": "10-best-practices"
  }
}
POST/v1/case1 credit / call

Case converter

Convert text to upper, lower, title or sentence case.

ParameterTypeRequiredDescription
textstringYesText to convert.
modestringYesupper | lower | title | sentence.

Request

curl -X POST https://toolsonduty.com/api/v1/case \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"hello world","mode":"title"}'

Response

{
  "ok": true,
  "data": {
    "result": "Hello World"
  }
}
POST/v1/json/format1 credit / call

JSON format / minify

Pretty-print or minify a JSON document. Returns a 400 with the parser error for invalid JSON.

ParameterTypeRequiredDescription
jsonstringYesRaw JSON text.
modestringNoformat | minify. Default: format.

Request

curl -X POST https://toolsonduty.com/api/v1/json/format \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"a\":1}","mode":"format"}'

Response

{
  "ok": true,
  "data": {
    "result": "{\n  \"a\": 1\n}"
  }
}
POST/v1/jwt/decode1 credit / call

JWT decoder

Decode a JWT's header and payload. Does not verify the signature.

ParameterTypeRequiredDescription
tokenstringYesThe JWT to decode.

Request

curl -X POST https://toolsonduty.com/api/v1/jwt/decode \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"token":"eyJhbGciOi..."}'

Response

{
  "ok": true,
  "data": {
    "header": {
      "alg": "HS256",
      "typ": "JWT"
    },
    "payload": {
      "sub": "123"
    },
    "signature": "..."
  }
}
POST/v1/regex/test1 credit / call

Regex tester

Run a regular expression against text and return every match with its capture groups.

ParameterTypeRequiredDescription
patternstringYesRegular expression pattern (without slashes).
flagsstringNoRegex flags, e.g. "gi". Default: .
textstringYesText to search.

Request

curl -X POST https://toolsonduty.com/api/v1/regex/test \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"pattern":"\\d+","text":"a1 b22"}'

Response

{
  "ok": true,
  "data": {
    "matches": [
      {
        "match": "1",
        "index": 1,
        "groups": []
      }
    ]
  }
}
POST/v1/dev/http-headers1 credit / call

HTTP header parser

Parse a raw HTTP request/response block into its start line and name/value headers.

ParameterTypeRequiredDescription
rawstringYesRaw HTTP headers text.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/http-headers \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"raw":"GET / HTTP/1.1\nHost: example.com"}'

Response

{
  "ok": true,
  "data": {
    "startLine": "GET / HTTP/1.1",
    "headers": [
      {
        "name": "Host",
        "value": "example.com"
      }
    ]
  }
}
POST/v1/dev/user-agent1 credit / call

User-Agent parser

Parse a User-Agent string into browser, engine, OS and device.

ParameterTypeRequiredDescription
userAgentstringYesUser-Agent string.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/user-agent \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0 Safari/537.36"}'

Response

{
  "ok": true,
  "data": {
    "browser": "Chrome",
    "os": "Windows"
  }
}
POST/v1/dev/curl-to-code1 credit / call

curl to code

Convert a curl command into equivalent fetch (JS), axios (JS) or requests (Python) code.

ParameterTypeRequiredDescription
curlstringYesThe curl command.
targetstringNofetch | axios | python. Default: fetch.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/curl-to-code \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"curl":"curl https://api.example.com"}'

Response

{
  "ok": true,
  "data": {
    "result": "const res = await fetch(\"https://api.example.com\", {\n  method: \"GET\"\n});\nconst data = await res.json();"
  }
}
POST/v1/dev/json-escape1 credit / call

JSON string escape / unescape

Escape a string for embedding inside a JSON document, or unescape a JSON-escaped string body.

ParameterTypeRequiredDescription
textstringYesText to convert.
modestringNoescape | unescape. Default: escape.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/json-escape \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"line1\nline2"}'

Response

{
  "ok": true,
  "data": {
    "result": "line1\\nline2"
  }
}
POST/v1/dev/bitwise1 credit / call

Bitwise calculator

Compute AND, OR, XOR, NOT, left-shift or right-shift on two 32-bit unsigned integers.

ParameterTypeRequiredDescription
anumberYesFirst operand.
bnumberNoSecond operand (ignored for NOT). Default: 0.
opstringYesAND | OR | XOR | NOT | LSHIFT | RSHIFT.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/bitwise \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"a":12,"b":10,"op":"AND"}'

Response

{
  "ok": true,
  "data": {
    "result": 8
  }
}
POST/v1/dev/contrast1 credit / call

WCAG contrast checker

Compute the WCAG contrast ratio between two hex colors and whether it passes AA/AAA.

ParameterTypeRequiredDescription
foregroundstringYesForeground hex color, e.g. #000000.
backgroundstringYesBackground hex color, e.g. #ffffff.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/contrast \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"foreground":"#000000","background":"#ffffff"}'

Response

{
  "ok": true,
  "data": {
    "ratio": 21,
    "aaNormal": true,
    "aaaNormal": true
  }
}
POST/v1/dev/env-json1 credit / call

.env <-> JSON

Convert a .env file to a JSON object, or a JSON object of key/value pairs to .env format.

ParameterTypeRequiredDescription
textstringYesmode=to-json: .env text. mode=to-env: JSON text.
modestringNoto-json | to-env. Default: to-json.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/env-json \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"API_KEY=abc123","mode":"to-json"}'

Response

{
  "ok": true,
  "data": {
    "result": {
      "API_KEY": "abc123"
    }
  }
}
POST/v1/dev/jsonpath1 credit / call

JSONPath evaluator

Evaluate a dot/bracket-notation path (e.g. $.a.b[0]) against a JSON document.

ParameterTypeRequiredDescription
jsonstringYesJSON text.
pathstringYesPath expression, e.g. $.items[0].name.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/jsonpath \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"items\":[{\"name\":\"a\"}]}","path":"$.items[0].name"}'

Response

{
  "ok": true,
  "data": {
    "result": "a"
  }
}
POST/v1/dev/parse-url1 credit / call

URL parser

Break a URL into protocol, hostname, port, path, query parameters and hash.

ParameterTypeRequiredDescription
urlstringYesThe URL to parse.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/parse-url \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/path?a=1#top"}'

Response

{
  "ok": true,
  "data": {
    "protocol": "https:",
    "hostname": "example.com"
  }
}
POST/v1/dev/parse-query-string1 credit / call

Query string parser

Parse a query string (or a full URL) into key/value pairs.

ParameterTypeRequiredDescription
textstringYesQuery string or full URL.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/parse-query-string \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"?a=1&b=2"}'

Response

{
  "ok": true,
  "data": {
    "params": [
      [
        "a",
        "1"
      ],
      [
        "b",
        "2"
      ]
    ]
  }
}
POST/v1/dev/meta-tags1 credit / call

Meta tag / Open Graph generator

Generate title, description, Open Graph and Twitter card meta tags for a page.

ParameterTypeRequiredDescription
titlestringNoPage title. Default: .
descriptionstringNoPage description. Default: .
urlstringNoCanonical page URL. Default: .
imagestringNoSocial preview image URL. Default: .
siteNamestringNoSite name. Default: .
twitterCardstringNosummary | summary_large_image. Default: summary_large_image.
twitterSitestringNoTwitter @handle for the site. Default: .

Request

curl -X POST https://toolsonduty.com/api/v1/dev/meta-tags \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"title":"My Page","description":"A great page"}'

Response

{
  "ok": true,
  "data": {
    "result": "<title>My Page</title>..."
  }
}
POST/v1/dev/cron-next-runs1 credit / call

Cron next-run calculator

Compute the next run times for a 5-field cron expression (minute hour day month weekday).

ParameterTypeRequiredDescription
expressionstringYesCron expression, e.g. "0 9 * * 1-5".
countnumberNoHow many upcoming runs to return (1-50). Default: 5.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/cron-next-runs \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"expression":"0 9 * * 1-5"}'

Response

{
  "ok": true,
  "data": {
    "runs": [
      "Mon 2026-01-05 09:00"
    ]
  }
}
POST/v1/dev/http-status1 credit / call

HTTP status code reference

Look up the name, category and description of an HTTP status code. Omit the code to list all known statuses.

ParameterTypeRequiredDescription
codenumberNoHTTP status code, e.g. 404.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/http-status \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"code":404}'

Response

{
  "ok": true,
  "data": {
    "code": 404,
    "name": "Not Found",
    "category": "4xx Client Error"
  }
}
POST/v1/dev/html-entities1 credit / call

HTML entity encode / decode

Escape special HTML characters, or decode named and numeric HTML entities back to characters.

ParameterTypeRequiredDescription
textstringYesText to convert.
modestringNoencode | decode. Default: encode.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/html-entities \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"text":"<b>Hi & bye</b>"}'

Response

{
  "ok": true,
  "data": {
    "result": "&lt;b&gt;Hi &amp; bye&lt;/b&gt;"
  }
}
POST/v1/dev/query-string-builder1 credit / call

Query string builder

Build URL-encoded query parameters from a JSON object.

ParameterTypeRequiredDescription
jsonstringYesJSON object containing parameter values.
includeQuestionMarkbooleanNoPrefix non-empty output with ?. Default: true.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/query-string-builder \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"q\":\"online tools\",\"page\":2}"}'

Response

{
  "ok": true,
  "data": {
    "result": "?q=online+tools&page=2"
  }
}
POST/v1/dev/variable-name1 credit / call

Variable name converter

Convert a phrase or identifier to a common programming naming convention.

ParameterTypeRequiredDescription
valuestringYesPhrase or existing identifier.
targetstringNocamel | pascal | snake | kebab | constant | title. Default: camel.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/variable-name \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"value":"public API response","target":"camel"}'

Response

{
  "ok": true,
  "data": {
    "result": "publicApiResponse"
  }
}
POST/v1/dev/mime-type1 credit / call

MIME type lookup

Find a built-in common MIME type from an extension or reverse lookup its extensions.

ParameterTypeRequiredDescription
valuestringYesFilename, extension or MIME type.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/mime-type \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"value":".json"}'

Response

{
  "ok": true,
  "data": {
    "extension": "json",
    "mimeType": "application/json",
    "found": true
  }
}
POST/v1/dev/json-schema1 credit / call

JSON Schema generator

Infer a draft 2020-12 JSON Schema from representative JSON.

ParameterTypeRequiredDescription
jsonstringYesValid representative JSON.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/json-schema \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"id\":1,\"name\":\"Ada\"}"}'

Response

{
  "ok": true,
  "data": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object"
  }
}
POST/v1/dev/cron-parse1 credit / call

Cron expression parser

Validate and describe a five-field cron expression and calculate its next five runs.

ParameterTypeRequiredDescription
expressionstringYesFive-field cron expression.
fromstringNoOptional ISO date used as the schedule origin.

Request

curl -X POST https://toolsonduty.com/api/v1/dev/cron-parse \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"expression":"*/15 9-17 * * 1-5"}'

Response

{
  "ok": true,
  "data": {
    "valid": true,
    "fields": {
      "minute": "*/15",
      "hour": "9-17"
    }
  }
}