80trust / 100

Timezone

by geoprimitives in Weather & location

x402 APIPassing, checked 24 min ago

Give it a longitude and latitude and it answers with the IANA timezone identifier (America/New_York), the UTC offset in force there right now, whether daylight saving is currently in effect and by how much, the local wall-clock time, and the zone's standard offset. Pass an optional ISO 8601 `at` instant to ask about any moment between 1900 and 2100 instead of now, which is what you want when scheduling something months out across a DST boundary. Parameters go in the query string: this is a GET, there is no body. Two halves, with different vintages, and the difference matters. The offset and the DST rules come from the runtime's own timezone database and are current: a rule change reaches this endpoint when Cloudflare updates ICU, with no redeploy here. The *boundaries* come from tz_world (efele.net), CC0 1.0 and derived from VMAP0, a public-domain US government product. That map was frozen at tzdb 2016d in May 2016, and this catalog sells public-domain and permissively-licensed data only, which is why it is used rather than the current OpenStreetMap-derived alternative. What the vintage costs, measured against IANA's own coordinates for all 312 zones in zone1970.tab rather than estimated: 293 agree. Of the 19 that do not, 7 are Antarctic research stations, which this map does not cover at all and which fall back to the open-water rule; 7 more return a different identifier for the identical offset and DST all year (Australia/Brisbane for Australia/Lindeman, America/Regina for America/Swift_Current, and five like them), so the time is right and only the name is old. That leaves four regions where the answer is up to one hour wrong because the zone was split after 2016: Chilean Magallanes and Aysen (answered as America/Santiago rather than America/Punta_Arenas or America/Coyhaique), the Mexican border municipalities around Ciudad Juarez, Saratov Oblast in Russia, and the weeks each spring when Asia/Hebron and Asia/Jerusalem change on different dates. If you query insid

GET https://api.geoprimitives.dev/v1/timezone

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
735 ms typical, 847 ms slowest 5%
Last check
24 min ago
Next check
in 6 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://api.geoprimitives.dev/v1/timezone?at=2026-07-04T16%3A00%3A00Z&lat=40.7128&lon=-74.006"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.geoprimitives.dev%2Fv1%2Ftimezone
const res = await pay("https://api.geoprimitives.dev/v1/timezone?at=2026-07-04T16%3A00%3A00Z&lat=40.7128&lon=-74.006");
console.log(await res.json());

Example input

{
  "at": "2026-07-04T16:00:00Z",
  "lat": 40.7128,
  "lon": -74.006
}

Example output

{
  "abbreviation": "EDT",
  "at": "2026-07-04T16:00:00.000Z",
  "boundaries": {
    "accuracyMetres": 1600,
    "dataset": "tz_world_mp",
    "h3Resolution": 6,
    "license": "CC0-1.0",
    "tzdbVintage": "2016d"
  },
  "cell": "862a1072fffffff",
  "dstOffsetMinutes": 60,
  "isDST": true,
  "localTime": "2026-07-04T12:00:00-04:00",
  "notes": [],
  "query": {
    "lat": 40.7128,
    "lon": -74.006
  },
  "source": "boundary",
  "standardUtcOffset": "-05:00",
  "standardUtcOffsetMinutes": -300,
  "timezone": "America/New_York",
  "utcOffset": "-04:00",
  "utcOffsetMinutes": -240
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
24 min agoPassed402800 ms$0.005
4 h agoPassed402847 ms$0.005
8 h agoPassed40246 ms$0.005
11 h agoPassed402735 ms$0.005
16 h agoPassed402685 ms$0.005
19 h agoPassed402788 ms$0.005
22 h agoPassed402721 ms$0.005
27 h agoPassed402873 ms$0.005