Location Search API
Instant city and location autocomplete — ranked results from a partial name query.
Pass a partial location name (minimum 3 characters) and receive a ranked list of matching cities and places with their full names, regions, countries, and coordinates. Use it to power a polished location-picker or autocomplete input in your weather app — no additional geocoding service required, no API key juggling.
What You Get with the Location Search API
Fast prefix matching
Returns results in milliseconds, making it responsive enough for keypress-by-keypress autocomplete without debounce delays.
Ranked results
Matches are ordered by population and relevance so the most likely result appears first — 'Lon' returns London before Londonderry.
Full location metadata
Each result includes city name, region/state, country, latitude, and longitude — everything needed for a follow-up weather call.
No separate geocoding needed
The coordinates in the search response can be passed directly to any other WeatherAI.io endpoint as the q parameter.
Free on Standard tier
Location search is included in your 1,000 free daily Standard calls — no premium quota consumed.
Global coverage
Searches across millions of locations worldwide including small towns, districts, and IATA airport codes.
Who Uses This API
From startups to enterprise teams, the Location Search API powers a wide range of real-world applications.
Weather app location pickers
Build a responsive search-as-you-type location picker that resolves to coordinates for all subsequent weather API calls.
Address & destination forms
Add intelligent location suggestion to booking forms, travel apps, and delivery address inputs.
Multi-location dashboards
Let users add locations to a dashboard by searching, without requiring exact city names or coordinates.
Voice assistant slot filling
Resolve an ambiguous spoken city name to the most likely match before making a weather or forecast call.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| q | string | Required | Partial location name (minimum 3 characters) | Lon |
Authenticate every request with the X-API-Key header.
Code Example
Request
curl "https://api.weatherai.io/v1/search?q=Lon" \
-H "X-API-Key: your-api-key"Response
[
{ "name": "London", "region": "City of London", "country": "United Kingdom", "lat": 51.52, "lon": -0.11 },
{ "name": "Londonderry", "region": "New Hampshire", "country": "USA", "lat": 42.87, "lon": -71.37 },
{ "name": "Long Beach", "region": "California", "country": "USA", "lat": 33.77, "lon": -118.19 }
]Response Fields
| Field | Type | Description |
|---|---|---|
| [].name | string | Full city/location name |
| [].region | string | Region, state, or county |
| [].country | string | Country name |
| [].lat | number | Latitude |
| [].lon | number | Longitude |
| [].url | string | URL-safe location slug for use in other API calls |
Related APIs
Start Using the Location Search API Today
Create a free account and get your API key in under a minute. 1,000 free calls per day. No credit card required.
Get Your Free API Key