Advertisement

API Reference

API Reference

A REST API over a handful of the tools on this site, for calling programmatically instead of through the browser.

Authentication

Generate a key from My Dashboard → API Keys — this requires an active Starter or Pro subscription. Send it as a bearer token on every request:

Authorization: Bearer mct_live_<your key>

Every endpoint is a POST with a JSON body, at https://mycodetips.com/api/v1/{path}, and always returns JSON. On error, the response is {"error": "..."} with a matching 4xx/5xx status.

Rate limits & credits

Each key gets a daily quota on a rolling 24-hour window, set by your plan (Starter/Pro — check current limits). Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-Credits-Remaining headers.

Once the daily quota is used up, calls don't just stop — a purchased credit is spent instead (1 credit per call over quota) so real usage keeps working. Only once both the quota and your credit balance are exhausted does a call return 429. Credits never expire.

Quick example

curl -X POST https://mycodetips.com/api/v1/uuid \
  -H "Authorization: Bearer mct_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"count": 3}'

Endpoints

POST https://mycodetips.com/api/v1/jwt/decode

Decode a JWT's header and payload. Pass "secret" to also verify an HS256/HS384/HS512 signature (RS/ES/PS algorithms aren't supported and are reported as unverified).

Request body
{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMifQ.dGVzdA",
  "secret": "optional-hmac-secret"
}
Response
{
  "header": { "alg": "HS256", "typ": "JWT" },
  "payload": { "sub": "123" },
  "signature_verified": false
}
POST https://mycodetips.com/api/v1/hash

Hash a string with one or more algorithms (md5, sha1, sha256, sha512). Omit "algorithms" to get all four.

Request body
{
  "input": "hello world",
  "algorithms": ["sha256", "md5"]
}
Response
{
  "input": "hello world",
  "hashes": {
    "sha256": "b94d27b9...",
    "md5": "5eb63bbb..."
  }
}
POST https://mycodetips.com/api/v1/base64/encode

Base64-encode a string.

Request body
{ "input": "hello" }
Response
{ "input": "hello", "output": "aGVsbG8=" }
POST https://mycodetips.com/api/v1/base64/decode

Base64-decode a string. Returns 400 if "input" isn't valid base64.

Request body
{ "input": "aGVsbG8=" }
Response
{ "input": "aGVsbG8=", "output": "hello" }
POST https://mycodetips.com/api/v1/url/encode

Percent-encode a string (RFC 3986, via PHP's rawurlencode).

Request body
{ "input": "a b/c" }
Response
{ "input": "a b/c", "output": "a%20b%2Fc" }
POST https://mycodetips.com/api/v1/url/decode

Percent-decode a string.

Request body
{ "input": "a%20b%2Fc" }
Response
{ "input": "a%20b%2Fc", "output": "a b/c" }
POST https://mycodetips.com/api/v1/uuid

Generate one or more random UUID v4s (cryptographically random, via random_bytes). "count" defaults to 1, capped at 100.

Request body
{ "count": 3 }
Response
{
  "count": 3,
  "uuids": ["9b1d...", "2f4a...", "c8e7..."]
}
POST https://mycodetips.com/api/v1/timestamp/convert

"input" can be a Unix timestamp (seconds or milliseconds — 13+ digits are treated as milliseconds) or any date string PHP's DateTime constructor accepts (ISO 8601, RFC 2822, "next monday", etc).

Request body
{ "input": "1700000000" }
Response
{
  "input": "1700000000",
  "unix_seconds": 1700000000,
  "unix_millis": 1700000000000,
  "iso8601": "2023-11-14T22:13:20Z",
  "rfc2822": "Tue, 14 Nov 2023 22:13:20 +0000"
}
POST https://mycodetips.com/api/v1/color/convert

"input" auto-detects as hex (#rrggbb / #rgb), rgb(r,g,b), or hsl(h,s%,l%). "to" is the target format: hex, rgb, or hsl.

Request body
{ "input": "#1e90ff", "to": "hsl" }
Response
{
  "input": "#1e90ff",
  "rgb": { "r": 30, "g": 144, "b": 255 },
  "output": "hsl(210, 100%, 56%)",
  "hsl": { "h": 210, "s": 100, "l": 55.9 }
}
POST https://mycodetips.com/api/v1/base32/encode

Base32-encode a string (RFC 4648 standard alphabet).

Request body
{ "input": "Hello, World!" }
Response
{
  "input": "Hello, World!",
  "output": "JBSWY3DPFQQFO33SNRSCC==="
}
POST https://mycodetips.com/api/v1/base32/decode

Base32-decode a string. Returns 400 if it isn't valid Base32 or doesn't decode to valid UTF-8 text.

Request body
{ "input": "JBSWY3DPFQQFO33SNRSCC===" }
Response
{
  "input": "JBSWY3DPFQQFO33SNRSCC===",
  "output": "Hello, World!"
}
POST https://mycodetips.com/api/v1/duration/convert

"input" auto-detects: a number (or numeric string) is treated as seconds, a colon-separated string as HH:MM:SS / MM:SS / SS.

Request body
{ "input": 3725 }
Response
{
  "input": 3725,
  "seconds": 3725,
  "hms": "01:02:05",
  "human": "1h 2m 5s"
}
POST https://mycodetips.com/api/v1/ipv4/convert

"input" auto-detects as a dotted IPv4 address or its 32-bit decimal integer form; returns both plus hex and the IPv4-mapped IPv6 form.

Request body
{ "input": "192.168.1.1" }
Response
{
  "input": "192.168.1.1",
  "ipv4": "192.168.1.1",
  "decimal": 3232235777,
  "hex": "0xC0A80101",
  "ipv6_mapped": "::ffff:192.168.1.1",
  "ipv6_mapped_hex": "::ffff:c0a8:0101"
}
POST https://mycodetips.com/api/v1/querystring/parse

Parses a URL query string into a JSON object. Repeated keys (a=1&a=2) and array-style keys (a[]=1&a[]=2) become a JSON array.

Request body
{ "input": "q=hello+world&tag=a&tag=b" }
Response
{
  "input": "q=hello+world&tag=a&tag=b",
  "output": { "q": "hello world", "tag": ["a", "b"] }
}
POST https://mycodetips.com/api/v1/querystring/build

Builds a URL query string from a flat JSON object — array values become repeated keys. Nested objects/arrays aren't supported.

Request body
{ "input": { "q": "hello world", "tag": ["a", "b"] } }
Response
{
  "input": { "q": "hello world", "tag": ["a", "b"] },
  "output": "q=hello+world&tag=a&tag=b"
}

Want a tool added to the API that isn't here yet? Let us know.

Advertisement