Places & time zones
Place by id
GET/v1/places/{id}
One place by the id from place search.
Request
No request body.
Example
curl -X GET "https://api.bestastroapi.in/v1/places/1270927" \
-H "x-api-key: $BESTASTRO_KEY"Response
[]is a list.{key}is a key that varies.
| Field | Type | Meaning |
|---|---|---|
| place | Place | The place |
Objects used above
Place A city, town or village.
| Field | Type | Meaning |
|---|---|---|
| id | integer | Stable id. Send it as place_id to any calculation |
| name | string | Name |
| district | string or null | District or county |
| state | string or null | State or province |
| country | string | Country |
| country_code | string | Two-letter country code |
| label | string | Ready to show: name, district for smaller places, state, country |
| lat | numberdegrees | Latitude |
| lon | numberdegrees | Longitude |
| tz | string | IANA time zone |
| population | integer or null | Population. Null when not known, which is usual for villages |
| match | string | Why it is listed. Only in place search optionalexact | starts_with | contains | other_name | similar |
| utc_offset | string | UTC offset at datetime. Only in place search with datetime optional |
Raw sample
200 application/json
{
"place": {
"country": "India",
"country_code": "IN",
"district": "Gorakhpur",
"id": 1270927,
"label": "Gorakhpur, Uttar Pradesh, India",
"lat": 26.76628,
"lon": 83.36889,
"name": "Gorakhpur",
"population": 674246,
"state": "Uttar Pradesh",
"tz": "Asia/Kolkata"
}
}Real output for the example request above.
Errors use one format. See error codes. Also in openapi.json.