☰ DiAstrologer API Docs

Location

6 endpoint(s).

Endpoint Method Summary Auth
/api/v1/location/city GET Get exact city by name
/api/v1/location/indian-cities GET List Indian cities
/api/v1/location/reverse GET Reverse geocode coordinates
/api/v1/location/search GET Search locations by name
/api/v1/location/timezone GET Get timezone from coordinates
/api/v1/location/timezones GET Get common timezones

GET /api/v1/location/city

Get exact city by name

Lookup a specific city by exact name match.

Param In Type Required Description
name query string yes City name
country query any no 2-letter country code (e.g., IN, US)

Response 200LocationResponse

Example

curl -X GET 'https://api.example.com/api/v1/location/city' \
  -H 'Authorization: Bearer <API_KEY>'

GET /api/v1/location/indian-cities

List Indian cities

Get list of Indian cities, optionally filtered by state.

Param In Type Required Description
state query any no State name to filter
limit query integer no Maximum results

Response 200LocationSearchResponse

Example

curl -X GET 'https://api.example.com/api/v1/location/indian-cities' \
  -H 'Authorization: Bearer <API_KEY>'

GET /api/v1/location/reverse

Reverse geocode coordinates

Get nearest city from latitude/longitude coordinates.

Param In Type Required Description
lat query number yes Latitude (-90 to 90)
lng query number yes Longitude (-180 to 180)

Response 200LocationResponse

Example

curl -X GET 'https://api.example.com/api/v1/location/reverse' \
  -H 'Authorization: Bearer <API_KEY>'

GET /api/v1/location/search

Search locations by name

Autocomplete search for cities. Returns up to 10 matches sorted by population.

Param In Type Required Description
q query string yes Search query (city name)
limit query integer no Maximum results to return

Response 200LocationSearchResponse

Example

curl -X GET 'https://api.example.com/api/v1/location/search' \
  -H 'Authorization: Bearer <API_KEY>'

GET /api/v1/location/timezone

Get timezone from coordinates

Determine timezone for given latitude/longitude.

Param In Type Required Description
lat query number yes Latitude (-90 to 90)
lng query number yes Longitude (-180 to 180)

Response 200TimezoneResponse

Example

curl -X GET 'https://api.example.com/api/v1/location/timezone' \
  -H 'Authorization: Bearer <API_KEY>'

GET /api/v1/location/timezones

Get common timezones

Get list of common timezones for dropdown selection.

Example

curl -X GET 'https://api.example.com/api/v1/location/timezones' \
  -H 'Authorization: Bearer <API_KEY>'