City Search

GET

City Search

Returns information for an array of cities that match the search text.

Resource URL

http://dataservice.accuweather.com /locations/v1/cities/search

Query Parameters


Name Values Description
apikey
(required)

Provided API Key.

q
(required)

Text to search for.

language

String indicating the language in which to return the resource.

details

Boolean value specifies whether or not to include full details in the response.

offset

Integer, along with the limit (25) that determines the first resource to be returned. If no offset is provided, the max number (100) of results will be returned.

alias

Enumeration that specifies when alias locations should be included in the results. By default, an alias will only be returned if no official match for the search text was found. Enumeration values: Never or Always


Request Body

HTTP Basic

OAuth 2.0

API Key

Reset

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Response Error Details

  • HTTP Code
    Error Code
    Description
  • 400

    Request had bad syntax or the parameters supplied were invalid.

  • 401

    Unauthorized. API authorization failed.

  • 403

    Unauthorized. You do not have permission to access this endpoint.

  • 404

    Server has not found a route matching the given URI.

  • 500

    Server encountered an unexpected condition which prevented it from fulfilling the request.

Working...

General Locations Information | Regions and Countries | Administrative Areas | AutoComplete Information

 

Response Parameters

Parameter Type Description
Version int32 Version of the api.
Key string Location key.
Type string Location type such as City, PostalCode, POI, or LatLong.
Rank int32 Number applied to locations, set by factors such as population, political importance, and geographic size.
LocalizedName string Display name in local dialect set with language code in URL. Default is US English (en-us).
EnglishName string Location name displayed in English.
PrimaryPostalCode string Official postal code provided by our main location data provider for the requested location.
Region.ID string Unique region code for the location.
Region.LocalizedName string Region name displayed in the local dialect set with the language code in the URL. Default is US English (en-us).
Region.EnglishName string Region name displayed in English.
Country.ID string Unique ISO or Microsoft Localization Code for the country.
Country.LocalizedName string Country name as displayed in the local dialect set with language code in the URL. Default is US English (en-us).
Country.EnglishName string Country name displayed in English.
AdministrativeArea.ID string Unique Administrative Area ID for the Location.
AdministrativeArea.LocalizedName string Administrative Area name displayed in the local dialect set with the language code in the URL. Default is US English (en-us).
AdministrativeArea.EnglishName string Administrative Area name displayed in English.
AdministrativeArea.Level int32 An assigned number, describing the scale of the administrative subdivisions for countries. As the Level number increases, the scale of the subdivision will decrease. Numbers of 10 or greater are reserved for non-political boundaries and should be used independently. May be NULL.
AdministrativeArea.LocalizedType string Administrative Area type displayed in the local dialect set with the language code in the URL. Default is US English (en-us).
AdministrativeArea.EnglishType string Administrative Area type displayed in English.
AdministrativeArea.CountryID string Unique ISO or Microsoft Localization Code for the country that contains the AdministrativeArea.
TimeZone.Code string Official abbreviation code for designated Time Zone.
TimeZone.Name string Official name of designated Time Zone.
TimeZone.GmtOffset float Number of hours offset from local GMT time.
TimeZone.IsDaylightSaving boolean Is the location currently observing Daylight Saving time.
TimeZone.NextOffsetChange date-time Next time that daylight saving time changes. May be NULL.
GeoPosition.Latitude double Geographical coordinate that specifies the north-south position of a point on the earth`s surface.
GeoPosition.Longitude double Geographical coordinate that specifies the east-west position of a point on the earth`s surface.
GeoPosition.Elevation.Metric.Value double Rounded value in specified units. May be NULL.
GeoPosition.Elevation.Metric.Unit string Type of unit.
GeoPosition.Elevation.Metric.UnitType int32 Numeric ID associated with the type of unit being displayed.
GeoPosition.Elevation.Imperial.Value double Rounded value in specified units. May be NULL.
GeoPosition.Elevation.Imperial.Unit string Type of unit.
GeoPosition.Elevation.Imperial.UnitType int32 Numeric ID associated with the type of unit being displayed.
IsAlias boolean "True" or "False" verification of whether a location is an "alias" or an alternative name or spelling for a requested location.
ParentCity string This object will be displayed only if the location is part of a larger metropolitan area or parent city.
ParentCity.Key string Parent city location key.
ParentCity.LocalizedName string Parent city name as displayed in local dialect set with language code in the URL. If no language code is selected, the default is English.
ParentCity.EnglishName string Parent city name displayed in English.
SupplementalAdminAreas.Level int32 An assigned number, describing the scale of the administrative subdivisions for countries. As the Level number increases, the scale of the subdivision will decrease. Numbers of 10 or greater are reserved for non-political boundaries and should be used independently. May be NULL.
SupplementalAdminAreas.LocalizedName string Administrative Area name as displayed in local dialect set with language code in the URL. Default is US English (en-us).
SupplementalAdminAreas.EnglishName string Administrative Area name displayed in English.
DataSets string Array of location-specific products that are available for this location. Products include Alerts, PremiumAirQuality, AirQuality, MinuteCast, and ForecastConfidence. If no location-specific products are available, the array will be empty.
Details.Key string Location key.
Details.StationCode string Weather station code of the location.
Details.StationGmtOffset float GMT offset of the weather station. May be NULL.
Details.BandMap string Temperature and precipitation band map code.
Details.Climo string Source of the climatology data for the location.
Details.LocalRadar string Local radar code associated with the location.
Details.MediaRegion string Media region associated with the location.
Details.Metar string Metar station associated with the location.
Details.NXMetro string City level radar code.
Details.NXState string State Level radar code.
Details.Population int64 Reported population of the location. May be NULL.
Details.PrimaryWarningCountyCode string Primary warning county code.
Details.PrimaryWarningZoneCode string Primary warning zone code.
Details.Satellite string Satellite associated with the location.
Details.Synoptic string Synoptic station associated with the location.
Details.MarineStation string Marine station code.
Details.MarineStationGMTOffset float GMT offset of the marine station. May be NULL.
Details.VideoCode string Code that identifies city or region for video.
Details.PartnerID int32 Unique number that indentifies a display partner for the Designated Marketing Area (DMA). Language dependent. May be NULL.
Details.DMA.ID string Numeric Designated Marketing Area (DMA) identifier.
Details.DMA.EnglishName string Name of the DMA in English.
Details.Sources.DataType string Type of data the source provides.
Details.Sources.Source string Name of the data provider.
Details.Sources.SourceId int32 ID associated with the source. Can be used as a key.
Details.CanonicalPostalCode string Optimized postal code, which may be the postal code of the location or a nearby metropolitan area. May be empty.
Details.CanonicalLocationKey string Optimized locationKey, which may be the locationKey of the location or a nearby metropolitan area. May be empty.
Details.LocationStem string Country ID/location name/postal code or Country ID/location name/Location Key when the location does not have a postal code. For AccuWeather internal use only.