API reference › Places & time

Historical Timezone API

IANA zone and UTC offset at a moment and place

POST/v1/timezone

1 credit · Secret key (test or live) · getTimezone

POST because a birth moment plus place is personal data — it never goes in a URL.

Request body

  • latitude number required

    ≥ -90 · ≤ 90

  • longitude number required

    ≥ -180 · ≤ 180

  • datetime string (date-time) required

No other fields are accepted.

Response

JSON { data, meta, warnings }, where data is:

  • name string required
  • utc_offset string required
  • offset_minutes integer required
  • ambiguous boolean required

    True when the local time falls in a daylight-saving change and the offset had to be refined.

Errors: 400, 401, 403, 404, 422, 429, 500. See error codes.

Example request

curl -X POST 'https://api.astrologics.in/v1/timezone' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"latitude":28.6139,"longitude":77.209,"datetime":"1990-08-13T01:00:00Z"}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/timezone", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "latitude": 28.6139,
    "longitude": 77.209,
    "datetime": "1990-08-13T01:00:00Z"
  }),
});
console.log(JSON.stringify(await res.json(), null, 2));
Python
import json
import urllib.error
import urllib.request

body = {
    "latitude": 28.6139,
    "longitude": 77.209,
    "datetime": "1990-08-13T01:00:00Z",
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/timezone",
    method="POST",
    headers={"Authorization": "Bearer al_test_YOUR_KEY", "Content-Type": "application/json"},
    data=json.dumps(body).encode(),
)
try:
    with urllib.request.urlopen(req) as res:
        print(json.dumps(json.load(res), indent=2, ensure_ascii=False))
except urllib.error.HTTPError as err:
    print(err.code, err.read().decode())
PHP
<?php
$ch = curl_init('https://api.astrologics.in/v1/timezone');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"latitude":28.6139,"longitude":77.209,"datetime":"1990-08-13T01:00:00Z"}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

200 OK · 299 characters
{
  "data": {
    "name": "Asia/Kolkata",
    "utc_offset": "+05:30",
    "offset_minutes": 330,
    "ambiguous": false
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 1
  },
  "warnings": []
}
Try it

Leave empty to use the shared demo key (limited). Test keys only: never charged. Kept in this browser tab and sent through this site to the API. Create one

More in Places & time

Get a free API key Places & time product page