Utilities

Geocode a Place to Coordinates and Timezone

Resolve a city or place name to coordinates and timezone.

Returns up to limit matches (default 5, at most 10). When a query is ambiguous (e.g. 'Fatehabad' exists in multiple states), multiple results are returned so the developer can present a disambiguation UI or use the first result. Repeat matches for one place (same city, state and country within 5 km) are listed once.

Examples: ?q=Mumbai, ?q=Rome Italy, ?q=New York USA, ?q=London UK

Pass state/country for precise results: ?q=Fatehabad,Haryana or ?q=Fatehabad&country=in

get/v1/utils/geocode

Request

  • Base URL: https://api.asterwise.com
  • URL: https://api.asterwise.com/v1/utils/geocode
  • Auth: HTTP bearer

Query parameters

qstring required

City or location name. Use comma for disambiguation: 'Fatehabad,Haryana'

limitinteger

Maximum results to return

countrystring nullable

ISO country code to narrow results, e.g. 'in', 'us'

Response

Successful Response

successboolean

True if the request succeeded

messagestring

Human-readable status message

Changes

No recorded changes to this operation across all 2 revisions of this API.