Call the free timestamp api endpoint
Ask for the time. The server answers with a number.
curl https://aisenseapi.com/services/v1/timestamp{"timestamp":1787171289}That is the whole response. Ten digits, no separators, no timezone suffix and no wrapper object to unpack. The value stays ten digits long until November 2286.
There are no query parameters and no headers to set. Every reading is UTC, so nothing has to be offset and no zone can be got wrong.
Two neighbours cover the other shapes of the same instant. The Microtimestamp API Endpoint adds a microsecond fraction, and the Datetime API Endpoint returns an ISO 8601 string with an explicit offset.
Response field
| Field | Type | Description |
|---|---|---|
| timestamp | integer | Whole seconds since the Unix epoch, UTC. Ten digits until November 2286. |
One field, one type, one meaning. Nothing else comes back from the free timestamp api endpoint. A caller reads timestamp and is finished. No status envelope needs checking first, and no optional key may or may not turn up.
Why a neutral server clock earns its round trip
Every machine already has a clock, so an endpoint that returns the time looks redundant. It stops looking redundant the first time two clocks disagree.
- Clocks drift
A cheap oscillator gains or loses a few seconds a week. A virtual machine that was suspended and resumed can wake up badly off. NTP fixes this while it is running and reachable, which on containers, embedded boards, CI runners and locked-down networks it often is not.
- Drift breaks time windows
While building this project we hit a machine over a minute out of step. A minute is nothing to a person and fatal to software. Signed requests carry a timestamp and get rejected outside a tolerance of a few seconds. One-time codes expire early. Any service that enforces a freshness window reads a valid call as a replay, or as arriving from the future. The symptom looks like a bad secret rather than a bad clock, which is what makes it expensive to find.
- A neutral reading settles it
When both sides read the same third clock, the argument about whose machine is right disappears. Call the endpoint before you sign. Or compare it against the local clock at startup and refuse to run when the gap is too wide.
That is the job the free timestamp api endpoint does. It turns a silent, intermittent failure into a number you can assert on in a test.
The reading crosses a network, so treat it as accurate to roughly the round trip rather than to the microsecond. It is a shared reference point and a sanity check, not a replacement for NTP on a host that needs real synchronisation.
When whole seconds are the right shape
Whole seconds are what most systems mean by a timestamp. Use them for expiry checks, created-at columns, cache keys and log fields.
The plain integer keeps winning because it is the cheapest way to move a moment between systems. It fits in a URL, a query string, a filename, an environment variable, a signed header or a 32-bit column, and it survives every serialisation format unchanged. An ISO 8601 string reads better and costs a machine more work to agree on.
UTC only takes a whole class of bugs off the table. No hour happens twice in autumn and no hour goes missing in spring, so arithmetic on these values is just arithmetic. Convert to a local zone at the last moment, for display.
A second is too coarse when two events land inside it and their order still matters. Reach for the microsecond reading there instead. To translate a value you already hold, the Timestamp Converter API Endpoint takes either a Unix timestamp or a date string and returns the same instant in several formats. For named zones rather than fixed offsets, see the Timezones API Endpoint. All of the clock endpoints sit together on the Time APIs hub.
Common uses
Signing requests
Read the server clock immediately before building an HMAC signature, so the timestamp inside it lands within the receiver's tolerance window.
Drift checks
Have a startup probe or a CI step compare the local clock against this reading and fail loudly when the gap passes a few seconds.
Shared expiry
Compute cache TTLs and token lifetimes from one clock, so every node agrees on the exact second an entry dies.
Thin clients
Give a shell script, a browser page or an embedded board a correct time without shipping a date library or trusting a battery-backed clock.
Deterministic keys
Stamp a batch or a build with one integer, then pass it around unchanged as a filename, a cache key or a short identifier.
Privacy and limits
The request carries no input at all, so there is nothing about the caller to store. The response depends only on the server clock.
Responses are the current time by definition. Keep them out of any cache or CDN rule that would serve a stale value.
The free timestamp api endpoint shares the service limit of 5000 requests per IP per 24 hours. That is generous for signing and drift checks, and it is not meant to carry a polling loop.