oslew docs
Console
Menu

PlacesaddressoperationId timezone

GET/v1/timezone

The time zone at a point and its offsets at a timestamp.

Send Authorization: Bearer sk_live_…. The key's plan must include theaddress product; which plans do.

Explained in Time zones and Enriching a coordinate.

Example

The zone and its offsets at an instant.

curl
curl -G "https://api.oslew.com/v1/timezone" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'at=19.4326,-99.1332' \
  --data-urlencode 'timestamp=1790175600'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.timezone("19.4326,-99.1332", timestamp=1790175600)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.timezone("19.4326,-99.1332", { timestamp: 1790175600 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 291
ratelimit-reset: 1

{
  "at": [
    19.4326,
    -99.1332
  ],
  "timestamp": 1790175600,
  "tzid": "America/Mexico_City",
  "utc_offset_s": -21600,
  "raw_offset_s": -21600,
  "dst_offset_s": 0,
  "abbreviation": "CST",
  "via": "interior",
  "provenance": {
    "name": "timezone-boundary-builder",
    "release": "2026d",
    "license": "ODbL-1.0"
  },
  "took_us": 144
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Query

NameTypeDescription
at
queryrequired
string
lat,lon.
timestamp
query
integer
Unix seconds; now when absent.

Responses

200 — Zone and offsets; every field null when no zone holds the point.

  • abbreviationstring | nullrequired
  • atnumber[]required
  • dst_offset_sinteger | nullrequired
  • provenanceSource | nullrequired
    The zone polygons' source, release and licence code. Terms: https://www.oslew.com/licensing
    • licensestringrequired
    • namestringrequired
    • releasestringrequired
  • raw_offset_sinteger | nullrequired
  • timestampintegerrequired
  • took_usintegerrequired
  • tzidstring | nullrequired
    IANA zone id.
  • utc_offset_sinteger | nullrequired
    Seconds to add to UTC: raw plus DST.
  • viastring | nullrequired
    interior | boundary

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

400Bad request.
401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

More examples

A zone that keeps daylight saving time
curl
curl -G "https://api.oslew.com/v1/timezone" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'at=37.7929,-122.3971' \
  --data-urlencode 'timestamp=1787756400'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.timezone("37.7929,-122.3971", timestamp=1787756400)
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.timezone("37.7929,-122.3971", { timestamp: 1787756400 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 290
ratelimit-reset: 1

{
  "at": [
    37.7929,
    -122.3971
  ],
  "timestamp": 1787756400,
  "tzid": "America/Los_Angeles",
  "utc_offset_s": -25200,
  "raw_offset_s": -28800,
  "dst_offset_s": 3600,
  "abbreviation": "PDT",
  "via": "interior",
  "provenance": {
    "name": "timezone-boundary-builder",
    "release": "2026d",
    "license": "ODbL-1.0"
  },
  "took_us": 7482
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.