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
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).
{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMifQ.dGVzdA",
"secret": "optional-hmac-secret"
}
{
"header": { "alg": "HS256", "typ": "JWT" },
"payload": { "sub": "123" },
"signature_verified": false
}
https://mycodetips.com/api/v1/hash
Hash a string with one or more algorithms (md5, sha1, sha256, sha512). Omit "algorithms" to get all four.
{
"input": "hello world",
"algorithms": ["sha256", "md5"]
}
{
"input": "hello world",
"hashes": {
"sha256": "b94d27b9...",
"md5": "5eb63bbb..."
}
}
https://mycodetips.com/api/v1/base64/encode
Base64-encode a string.
{ "input": "hello" }
{ "input": "hello", "output": "aGVsbG8=" }
https://mycodetips.com/api/v1/base64/decode
Base64-decode a string. Returns 400 if "input" isn't valid base64.
{ "input": "aGVsbG8=" }
{ "input": "aGVsbG8=", "output": "hello" }
https://mycodetips.com/api/v1/url/encode
Percent-encode a string (RFC 3986, via PHP's rawurlencode).
{ "input": "a b/c" }
{ "input": "a b/c", "output": "a%20b%2Fc" }
https://mycodetips.com/api/v1/url/decode
Percent-decode a string.
{ "input": "a%20b%2Fc" }
{ "input": "a%20b%2Fc", "output": "a b/c" }
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.
{ "count": 3 }
{
"count": 3,
"uuids": ["9b1d...", "2f4a...", "c8e7..."]
}
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).
{ "input": "1700000000" }
{
"input": "1700000000",
"unix_seconds": 1700000000,
"unix_millis": 1700000000000,
"iso8601": "2023-11-14T22:13:20Z",
"rfc2822": "Tue, 14 Nov 2023 22:13:20 +0000"
}
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.
{ "input": "#1e90ff", "to": "hsl" }
{
"input": "#1e90ff",
"rgb": { "r": 30, "g": 144, "b": 255 },
"output": "hsl(210, 100%, 56%)",
"hsl": { "h": 210, "s": 100, "l": 55.9 }
}
https://mycodetips.com/api/v1/base32/encode
Base32-encode a string (RFC 4648 standard alphabet).
{ "input": "Hello, World!" }
{
"input": "Hello, World!",
"output": "JBSWY3DPFQQFO33SNRSCC==="
}
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.
{ "input": "JBSWY3DPFQQFO33SNRSCC===" }
{
"input": "JBSWY3DPFQQFO33SNRSCC===",
"output": "Hello, World!"
}
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.
{ "input": 3725 }
{
"input": 3725,
"seconds": 3725,
"hms": "01:02:05",
"human": "1h 2m 5s"
}
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.
{ "input": "192.168.1.1" }
{
"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"
}
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.
{ "input": "q=hello+world&tag=a&tag=b" }
{
"input": "q=hello+world&tag=a&tag=b",
"output": { "q": "hello world", "tag": ["a", "b"] }
}
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.
{ "input": { "q": "hello world", "tag": ["a", "b"] } }
{
"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.