Return the IANA timezone for a given coordinate pair
Get IANA timezone for a coordinate pair. Fully offline — no external API call. Accepts ?latitude=&longitude= and/or ?lat=&lon= (any pair that supplies both coordinates). Examples: ?latitude=19.055&longitude=72.869 (Mumbai), ?lat=19.055&lon=72.869
Endpoint
GET /v1/utils/timezone
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| latitude | number | null | No | Latitude (alias: lat) |
| longitude | number | null | No | Longitude (alias: lon) |
| lat | number | null | No | Alias for latitude |
| lon | number | null | No | Alias for longitude |
Example request
- curl
- Python
- TypeScript
curl -X GET "https://api.asterwise.com/v1/utils/timezone?latitude=19.076&longitude=72.8777" \
-H "Authorization: Bearer YOUR_API_KEY"
import asterwise
from asterwise.api.utilities_api import UtilitiesApi
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
with asterwise.ApiClient(configuration) as client:
api = UtilitiesApi(client)
result = api.timezone(latitude=19.076,
longitude=72.8777)
print(result)
import { createClient, createConfig, timezone } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const result = await timezone({
client,
query: {
"latitude": 19.076,
"longitude": 72.8777
},
});
console.log(result.data);
Example response
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | True if the request succeeded |
| message | string | Human-readable status message |
| data | object | |
| data.latitude | number | Input latitude. |
| data.longitude | number | Input longitude. |
| data.timezone | string | IANA timezone identifier. |
Errors
| Code | Description | Reference |
|---|---|---|
| authentication_failed | Missing or invalid API key. | authentication_failed |
| ephemeris_unavailable | Upstream ephemeris service error. | ephemeris_unavailable |
| insufficient_tier | API key tier does not include this endpoint. | insufficient_tier |
| internal_error | Unexpected server error. | internal_error |
| ip_rate_limit_exceeded | Too many requests in a short window. | ip_rate_limit_exceeded |
| payload_too_large | Request body exceeds the size limit. | payload_too_large |
| resource_not_found | Referenced resource was not found. | resource_not_found |
| validation_error | Request body failed schema validation. | validation_error |