Developer Portal & API

A free, keyless HTTP API for computing Discord <t:UNIX:FORMAT> codes — the same engine behind the interactive generator, callable from a script, a bot, or an agent.

No API key required

Every endpoint below is public and read-only. There's no sign-up, no API key, and no OAuth flow — send a request and get a response back.

Writing a Discord bot in JavaScript or Python rather than making an HTTP call? Check out our Discord Timestamp Bot & Embed Guide for native discord.js v14 and discord.py snippets.

OpenAPI specification

The full machine-readable spec — operation IDs, typed parameters, and response/error schemas — is published at /openapi.json. Point any OpenAPI-aware tool, codegen client, or LLM function-calling setup at it directly.

Quickstart

Compute a single format code for a specific moment:

curl "https://discordtimestampgen.com/api/timestamp?datetime=2025-12-25T09:00:00-05:00&format=F"

Omit format to get all 7 codes for that moment at once:

curl "https://discordtimestampgen.com/api/timestamp?datetime=2025-12-25T09:00:00-05:00"

Already have a Unix timestamp — from your own database, a bot, or another API — instead of an ISO datetime? Pass unix instead of datetime (seconds or milliseconds, detected automatically):

curl "https://discordtimestampgen.com/api/timestamp?unix=1766671200&format=F"

Look up the reference table of format codes:

curl "https://discordtimestampgen.com/api/formats"

Errors

Every error response is JSON, on the matching HTTP status code, with a machine-readable code, a human-readable message, and a hint describing how to fix the request:

{
  "error": {
    "code": "invalid_datetime",
    "message": "\"12/25/2025\" is not a valid ISO 8601 datetime with a UTC offset.",
    "hint": "Use the form YYYY-MM-DDTHH:MM:SS±HH:MM or end with \"Z\" for UTC, e.g. 2025-12-25T09:00:00-05:00 or 2025-12-25T14:00:00Z."
  }
}

Markdown content negotiation

Every page on this site — including this one — also serves a Markdown rendition to any client that sends Accept: text/markdown. It's built from the live page content, so it never drifts out of sync with what a browser sees.

curl -H "Accept: text/markdown" https://discordtimestampgen.com/developers

Try it now

Runs entirely in your browser — it calls the live API and shows the raw JSON response.

Response will appear here.

Further reading

For the underlying syntax and use cases rather than the API itself, see the format code reference and using timestamps in bots, embeds and webhooks. Want the unix conversion in a browser instead of curl? The Unix timestamp converter does the same lookup interactively.

Frequently asked questions

Do I need an API key?

No. The API is free, public, and read-only — there is no account, no API key, and no OAuth step. Send a request and get a response.

Is there a rate limit?

There's no published hard limit, but this is a small, single-operator site — use it for real integrations and testing, not high-volume bulk scraping. If you need guaranteed throughput, the underlying calculation is simple enough to run entirely on your own side; see the format reference for the exact algorithm.

Why does the API require a UTC offset in the datetime?

The API is stateless and has no concept of "your local timezone" the way a browser does. An ISO 8601 datetime with an explicit offset (or a trailing Z for UTC) removes that ambiguity entirely, so the same request always produces the same Unix timestamp regardless of where the server that handles it happens to run.

Can I pass a Unix timestamp instead of an ISO datetime?

Yes — pass unix instead of datetime, e.g. ?unix=1766671200&format=F. Both seconds and milliseconds are accepted; the API detects which one you sent and converts automatically, the same way the Unix timestamp converter does in the browser.

Is there an official CLI or SDK?

Not yet as a published package — the API is a plain HTTP/JSON endpoint, so any HTTP client (curl, fetch, requests, etc.) works without a dedicated library. See the OpenAPI spec if you want to generate a typed client automatically.