GET/v1/utils/geocode
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
Request parameters
qrequired
string
City or location name. Use comma for disambiguation: 'Fatehabad,Haryana'
limitoptional
integer
Maximum results to return
countryoptional
string | null
ISO country code to narrow results, e.g. 'in', 'us'
Response fields
success
boolean
True if the request succeeded
message
string
Human-readable status message
data
object
data.query
string
The search query as received.
data.count
integer
Number of results returned.
data.ambiguous
boolean
True if multiple locations matched the query.
data.results
array[object]
List of matching locations, best match first. Repeat matches for one place (same city, state and country within 5 km) are listed once.
data.results[].label
string
Human-readable location label.
data.results[].city
string | null
City name.
data.results[].state
string | null
State or region.
data.results[].country
string | null
Country name.
data.results[].latitude
number
Latitude in decimal degrees.
data.results[].longitude
number
Longitude in decimal degrees.
data.results[].timezone
string
IANA timezone identifier.
data.results[].place_id
string
Nominatim place ID.
data.tip
string | null
Disambiguation hint when ambiguous is True.
Errors
Invalid API key format.
API key is missing. Include it in the Authorization header as 'Bearer YOUR_KEY'.
The provided API key was not found. Verify the key in your Asterwise dashboard.
This API key has been revoked.
Too many requests per minute. Please slow down.
Something went wrong on our end. Please try again, or contact [email protected] if the problem persists. Include your request_id when contacting support.
Too many requests from this IP address. Please slow down.
Monthly API call limit reached. Upgrade your plan to continue.
Request body exceeds maximum allowed size of 64KB.
Your subscription has expired. Please renew at asterwise.com/dashboard to continue.
The request couldn't be processed. See the 'details' field for specific field-level issues.