A response from the geocoding service includes match accuracy and output fields information.
Match accuracy
The accuracy of a match returned by a search depends on the amount and quality of information submitted. The location of the match can vary from a highly precise point address to a more general postal code centroid. Providing high quality and complete information in a geocoding request can significantly improve the match quality.
For example, if you search for an address such as "100 Main St Springfield", several matches will be returned, because there are many cities in the United States named Springfield that contain a street named Main St. In this case, more accurate results will be obtained by including state or postal code information in the request.
The Addr_type output field can be used as an indicator of the precision of geocode results. It describes the match level of the results returned by the geocoding service.
For example, a search for Avenida República de El Salvador 70, Distrito Federal, MEX returns a PointAddress match as the top candidate. This is the most precise match level because it represents a building rooftop. If you search for a house number that doesn't exist on the same street, such as Avenida República de El Salvador 700, Distrito Federal, MEX, a StreetName candidate is returned. This match indicates a lower level of precision because the output location is at the center of the street segment named Avenida República de El Salvador. You can use the category parameter to filter out unwanted values from the response. For instance, if you're delivering a package, you need PointAddress or StreetAddress matches, because delivering something to a street center or city centroid won't work.
Geocoding accuracy varies by region and country. The SubAddress match level is the most accurate, followed by PointAddress and StreetAddress. The StreetName match level can be accurate if the street is a short segment, but less so if it is a long segment.
The list of Addr_type values (see the table below) is a combined list of all match levels for all countries; each country does not necessarily support each match level.
Output fields
The following table describes all of the fields that can be returned in a response from the geocoding service.
Note:
The values returned in output fields are subject to change when the ArcGIS World Geocoding Service is updated. Applications that use the service should handle such changes; application logic should not be based on the presence of specific output values.
Field | Description |
---|---|
spatialReference | The spatial reference of the output match location coordinates as specified by the wkid and latestWkid properties. The outSR input parameter determines the spatial reference. This is always returned by default. |
address | The complete matching address returned for findAddressCandidates and geocodeAddresses geocode requests. This is always returned by default. |
location | The point coordinates of the output match location as specified by the x and y properties. The spatial reference of the x and y coordinates is defined by the spatialReference output field. This is always returned by default for findAddressCandidates and geocodeAddresses geocode requests only. Refer to the description of the locationType parameter for more information about how the location output field relates to the X and Y output attributes. |
ResultID | This is only returned for geocodeAddresses requests. Each record in a batch geocode response includes a ResultID value, which equals the OBJECTID value of the corresponding input address record. It can be used to join the output fields in the response to the attributes in the original address table. |
Loc_name | The name of the locator used to return a particular match result. Note:The Loc_name field is used internally by ArcGIS software and is not intended for use by client applications. |
Status | Indicates whether a batch geocode request results in a match, tie, or unmatch. The possible values are the following:
|
Score | A number from 1–100 indicating the degree to which the input tokens in a geocoding request match the address components in a candidate record. A score of 100 represents a perfect match, while lower scores represent decreasing match accuracy. The Score output field is always returned by default.. |
Match_addr | The complete address returned for the geocode request. The format is based on address standards for the country in which the address is located. |
LongLabel | A longer version of the Match_addr value containing more administrative information. |
ShortLabel | A shortened version of the Match_addr value. |
Addr_type | The match level for a geocode request. Supported match levels vary in different countries. The possible values are the following:
|
Type | The feature type for results returned by a search. The Type field only includes a value for candidates with Addr_type = POI or Locality. As an example, for Starbucks, Type=Coffee Shop. |
PlaceName | The formal name of a geocode match candidate, for example, Paris or Starbucks. |
Place_addr | The full street address of a place, including street, city, and region; for example, 275 Columbus Ave, New York, New York. |
Phone | The primary phone number of a place, for example, Knott's Berry Farm, Phone=(714)220-5200. For other searches, such as address, intersection, and postal code, the field is empty. |
URL | The URL of the primary website for a place, for example, the University of Georgia, URL =http://www.uga.edu/. For other searches, such as address, intersection, and postal code, the field is empty. |
Rank | A floating-point number value indicating the importance of a result relative to other results with the same name. For example, there are cities in France and Texas named Paris. Paris, France, has a greater population than Paris, Texas, so it has a higher rank. The Rank field is used to sort results for ambiguous queries such as Lincoln, when no additional information (state) is available. Rank values are based on population or feature type. |
AddBldg | The name of a building, for example, Empire State Building. |
AddNum | The alphanumeric value that represents the portion of an address typically known as a house number or building number, for example, in the address 380 New York Street, AddNum = 380. This value is returned for PointAddress and StreetAddress matches only. |
AddNumFrom | A value representing the beginning number of a street address range. It is relative to direction of feature digitization and is not always the smallest number in the range. This value is provided for StreetAddress results. |
AddNumTo | A value representing the ending number of a street address range. It is relative to direction of feature digitization and is not always the largest number in the range. This value is provided for StreetAddress results. |
AddRange | The full house number range for the street segment that an address lies on, in the format AddNumFrom-AddNumTo. For example, the AddRange value for street address 123 Main St may be 101-199. |
Side | The side of the street where an address resides relative to the direction of feature digitization. This value is not relative to the direction of travel along the street. Possible values are R(right) and L (left). Note:Side is a legacy field that is kept in place only to support applications that expect it to be present in the REST response. The field is empty for most addresses returned by the geocoding service. It should not be used for analysis purposes. |
StPreDir | An address element defining the direction of a street and occurs before the primary street name, for example, North in North Main Street. |
StPreType | An address element defining the leading type of a street, for example, the Spanish term Avenida in Avenida Central or the French term Rue in Rue Lapin. |
StName | An address element defining the primary name of a street, for example, Main in North Main Street. |
StType | An address element defining the trailing type of a street, for example, Street in Main Street. |
StDir | An address element defining the direction of a street, which occurs after the primary street name, for example, North in Main Street North. |
BldgName | The name or number of a building subunit, for example, A in building A. |
BldgType | The classification of a building subunit. Examples are building, hangar, and tower. |
LevelType | The classification of a floor subunit. Examples are floor, level, department, and wing. |
LevelName | The name or number of a floor subunit, for example, 3 in level 3. |
UnitType | The classification of a unit subunit. Examples are unit, apartment, flat, office, and suite. |
UnitName | The name or number of a unit subunit, for example, 2B in apartment 2B. |
SubAddr | The full subunit value for a candidate with Addr_type=Subaddress that includes <subunit type> + <subunit name>. For example, if the subaddress candidate is an apartment unit, SubAddr = UnitType + UnitName, for example, Apt 4B |
StAddr | The street address of a place, without city and region, for example, 275 Columbus Ave. |
Block | The name of the block-level administrative division for a candidate. The Block value is the smallest administrative area for a country. It can be described as a subdivision of sector or neighborhood or a named city block. It is not commonly used. |
Sector | The name of the sector-level administrative division for a candidate. The Sector value is a subdivision of a neighborhood or district, or represents a collection of blocks. It is not commonly used. |
Nbrhd | The name of the neighborhood-level administrative division for a candidate. The Nbhrhd value is a subsection of a city or district. |
District | The name of the district-level administrative division for a candidate. Such as a subdivision of a city. |
City | The name of the city-level administrative division for a candidate. The City value is a subdivision of a subregion or region. |
MetroArea | The name of the metropolitan area-level administrative division for a candidate. It is an urban area consisting of a large city and the smaller cities surrounding it. The value can potentially intersect multiple subregions or regions. An example is Kolkata Metropolitan Area in India. |
Subregion | The name of the subregion-level administrative division for a candidate. The Subregion value is a subdivision of a region. |
Region | The name of the region-level administrative division for a candidate. It is a subdivision of a country or territory. It is typically the largest administrative area for a country if the Territory administrative division is not used. |
RegionAbbr | The abbreviated region name. The RegionAbbr value for California is CA. |
Territory | The name of the territory-level administrative division for a candidate. It is a subdivision of country. It is not commonly used. The Sudeste macroregion of Brazil, which encompasses the states of Espírito Santo, Minas Gerais, Rio de Janeiro and São Paulo, is an example. |
Postal | An alphanumeric address element defining the primary postal code, for example, V7M 2B4 for a Canadian postal code and 92374 for a United States postal code. |
PostalExt | An alphanumeric address element defining the postal code extension, for example, 8100 in USA postal code 92373-8110. |
Country | A 3-character code for a country, for example, Canada is CAN. A list of supported countries and codes is available in Geocode data coverage. This field is returned by the findAddressCandidates and geocodeAddresses operations. |
CountryCode | A 3-character code for a country, for example, Canada is CAN. A list of supported countries and codes is available in Geocode data coverage. This field is the same as the Country output field; however, it is only returned by the reverseGeocode operation. |
CntryName | The full country name for an address candidate, for example, 日本 (Japan). The name may be in the same language as the input address or in the language specified by the langCode parameter for the request. If the full country name is not available in the specified language, the primary language of the country that the address candidate is in is used. Information about supported languages by country is available in Geocode data coverage. This field is returned by the findAddressCandidates, geocodeAddresses, and reverseGeocode operations. |
LangCode | A 3-character language code representing the language of the address, for example, ENG is English. |
Distance | The physical distance in meters from a candidate to a specified location. The Distance output value is calculated for each candidate when the Location input parameter is passed in a request using the findAddressCandidates operation. If the Location parameter is not passed in a request, the value of Distance is zero. |
X | The primary x-coordinate of an address returned by the geocoding service in spatial reference WGS84 (WKID 4326). |
Y | The primary y-coordinate of an address returned by the geocoding service in spatial reference WGS84 (WKID 4326). |
DisplayX | The display x-coordinate of an address returned by the geocoding service in spatial reference WGS84 (WKID 4326). For most types of matches, the X and DisplayX values are the same. For matches of Addr_type, PointAddress, and Subaddress specifically, the values may be different. In general, for PointAddress and Subaddress matches, DisplayX represents the x-coordinate value of the building rooftop or parcel centroid for the address, and the X value represents the x-coordinate of the street-side location for the address. There are exceptions however. Some address data sources used by the geocoding service only provide the rooftop location of PointAddress and Subaddress features. However, for some PointAddress and Subaddress features, only the street-side location is available. For these cases, the X and DisplayX values are equivalent. |
DisplayY | The display y-coordinate of an address returned by the geocoding service in spatial reference WGS84 (WKID 4326). For most types of matches, the Y and DisplayY values are the same. For matches of Addr_type, PointAddress, and Subaddress specifically, the values may be different. In general, for PointAddress and Subaddress matches, DisplayY represents the y-coordinate value of the building rooftop or parcel centroid for the address, and the Y value represents the y-coordinate of the street-side location for the address. There are exceptions however. Some address data sources used by the geocoding service only provide the rooftop location of PointAddress and Subaddress features. However, for some PointAddress and Subaddress features, only the street-side location is available. For these cases, the Y and DisplayY values are equivalent. |
Xmin | The minimum x-coordinate for the display extent of a feature returned by the geocoding service. The Xmin, Xmax, Ymin, and Ymax values can be combined to set the map extent for displaying a geocode result. The extent coordinates use the WGS84 spatial reference. |
Xmax | The maximum x-coordinate for the display extent of a feature returned by the geocoding service. The Xmin, Xmax, Ymin, and Ymax values can be combined to set the map extent for displaying a geocode result. The extent coordinates use the WGS84 spatial reference. |
Ymin | The minimum y-coordinate for the display extent of a feature returned by the geocoding service. The Xmin, Xmax, Ymin, and Ymax values can be combined to set the map extent for displaying a geocode result. The extent coordinates use the WGS84 spatial reference. |
Ymax | The maximum y-coordinate for the display extent of a feature returned by the geocoding service. The Xmin, Xmax, Ymin, and Ymax values can be combined to set the map extent for displaying a geocode result. The extent coordinates use the WGS84 spatial reference. |
ExInfo | A collection of strings from the input that could not be matched to any part of an address and were used to score or penalize the result. |
extent | The minimum bounding rectangle of the output match feature as specified by the Xmin, Ymin, Xmax, and Ymax field values. The spatial reference of the x- and y-coordinates is defined by the spatialReference output field. This is always returned by default for findAddressCandidates geocode requests only. |
Service responses
As a developer, it's useful to be aware of the various JSON responses that can be returned by the geocoding service for erroneous or invalid requests, or when there are no matches returned for a request.
Error codes
Error codes are returned when the service cannot complete a request. This can be due to invalid parameters included in the request or insufficient user permissions. Some potential errors that may be encountered with the service are described below.
Error code 400
Message: "Unable to complete operation."
Possible causes
- Details: "<parameter name> parameter value exceeds the maximum length of <maximum length> characters allowed for the parameter value." This error is returned if the input parameter value contains too many characters. For example, if the SingleLine parameter value exceeds 200 characters, this error is returned.
- Details: "Category parameter value entered is not supported" This error is returned when an invalid category parameter value is included in a request.
- Details: "Invalid reverse geocode values provided in input" This error is returned when the location parameter in a reverseGeocode request includes a value that isn't a valid set of coordinates.
- Details: "magicKey entered is invalid " This error is returned when the magicKey parameter in a findAddressCandidates request includes an invalid value.
- Details: None. This error may be returned when the addresses parameter in a geocodeAddresses request is invalid or poorly formed. For example, if the addresses JSON object is missing a required comma or if the parameter name is misspelled, this error is returned.
Message: "Cannot perform query. Invalid query parameters."
Possible causes
- Details: "Unable to find address for the specified location."This error is returned when no match can be found for a reverseGeocode operation.
Message: "Invalid or missing input parameters."
Possible causes
- Details: None. This error is returned if a request is missing a required parameter.
Error code 403
Message: "Token is valid but access is denied."
Possible causes
- Details: "User does not have permissions to store geocoding results." This error is returned when a user with insufficient privileges attempts to store the results of a findAddressCandidates operation (that is, forStorage=true in the request).
- Details: "User does not have permissions to store reverse geocoding results." This error is returned when a user with insufficient privileges attempts to store the results of a reverseGeocode operation (that is, forStorage=true in the request).
- Details: "User does not have permissions to access geocodeAddresses." This error is returned when a user with insufficient privileges attempts to batch geocode a table of addresses.
Error code 499
Message: "Token required but not passed in the request."
Possible causes
- Details: "Token required". This error is returned when a token is required but was not included in a request, such as a geocodeAddresses request or when forStorage=true in a findAddressCandidates or reverseGeocode request.
Error code 500
Message: "Error performing <operation name> operation"
Possible causes
- Details: None. This error is returned when the casing of the operation name in a request is incorrect, such as reversegeocode instead of reverseGeocode.
Error code 504
Message: "Gateway timeout"
Possible causes
- Details: None. This error is returned when a request takes longer than 60 seconds to complete. It may indicate that the service is temporarily unavailable. A possible solution is to try the request again at a later time. When it's returned by a geocodeAddresses request, it may also indicate there are too many addresses in the input batch. In this case, try adjusting the request so it includes fewer addresses.
Remote service responses
There are responses returned when certain conditions related to remote services are encountered (specific to China and South Korea).
Request to remote service times out
When a findAddressCandidates request to the remote service exceeds the request timeout threshold, the following JSON response is returned:
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
],
"responseInfo": {
"message": "Time out code 2"
}
}
Request to remote service is incorrectly formatted
When a findAddressCandidates request to the remote service includes a formatting problem, such as invalid JSON or incorrect parameters, the following response is returned:
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
],
"responseInfo": {
"message": "Remote Response Error 3"
}
}
This is the response returned for a reverseGeocode request under the same conditions:
{
"error": {
"code": 400,
"message": "Cannot perform query. Invalid query parameters.",
"details": [
"Unable to find address for the specified location."
],
},
"responseInfo": {
"message": "Remote Response Error 3"
}
}
Multiple consecutive errors returned by remote service
If there are several consecutive time out or error responses returned by the remote service, it is assumed that the remote service is unavailable, unstable, or is blocked temporarily. During the time the service is blocked, requests to the remote service result in empty responses with the following responseInfo message (for findAddressCandidates requests):
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
],
"responseInfo": {
"message": "Service code 4"
}
}
No matches returned
When the service cannot find any matches for a request, the JSON responses below are returned.
findAddressCandidates
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
]
}
suggest
{
"suggestions": [
]
}
reverseGeocode
{
"error": {
"code": 400,
"message": "Cannot perform query. Invalid query parameters.",
"details": [
"Unable to find address for the specified location."
]
}
}
geocodeAddresses
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"locations": [
{
"address": "",
"score": 0,
"attributes": {
"ResultID": 1,
"Loc_name": "",
"Status": "U",
"Score": 0,
"Match_addr": "",
"LongLabel": "",
"ShortLabel": "",
"Addr_type": "",
"Type": "",
"PlaceName": "",
"Place_addr": "",
"Phone": "",
"URL": "",
"Rank": 0,
"AddBldg": "",
"AddNum": "",
"AddNumFrom": "",
"AddNumTo": "",
"AddRange": "",
"Side": "",
"StPreDir": "",
"StPreType": "",
"StName": "",
"StType": "",
"StDir": "",
"BldgType": "",
"BldgName": "",
"LevelType": "",
"LevelName": "",
"UnitType": "",
"UnitName": "",
"SubAddr": "",
"StAddr": "",
"Block": "",
"Sector": "",
"Nbrhd": "",
"District": "",
"City": "",
"MetroArea": "",
"Subregion": "",
"Region": "",
"RegionAbbr": "",
"Territory": "",
"Zone": "",
"Postal": "",
"PostalExt": "",
"Country": "",
"LangCode": "",
"Distance": 0,
"X": 0,
"Y": 0,
"DisplayX": 0,
"DisplayY": 0,
"Xmin": 0,
"Xmax": 0,
"Ymin": 0,
"Ymax": 0
}
}
]
}
Output fields for StreetInt candidates
Intersection candidates, when Addr_type = StreetInt, are a special case with respect to output fields. Three sets of output fields are returned for a single StreetInt candidate: one set for the intersection and two for the street segments composing the intersection. The additional output fields for the individual street segments are indicated by a 1 or 2 suffix at the end of the output field name. For example, there are three StName output fields for a StreetInt candidate:
- StName—The StName output field for the intersection
- StName1—The StName output field for the first street segment of the intersection
- StName2—The StName output field for the second street segment of the intersection
The following example shows all the output fields included in a JSON response for a StreetInt candidate.
Example: Find an intersection (New York St and Redlands Blvd, Redlands, CA)
Single field request URL
JSON response
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
{
"address": "New York St & W Redlands Blvd, Redlands, California, 92373",
"location": {
"x": -117.19571001697132,
"y": 34.059490013895314
},
"score": 99.840000000000003,
"attributes": {
"Loc_name": "World",
"Status": "M",
"Score": 99.840000000000003,
"Match_addr": "New York St & W Redlands Blvd, Redlands, California, 92373",
"LongLabel": "New York St & W Redlands Blvd, Redlands, CA, 92373, USA",
"ShortLabel": "New York St & W Redlands Blvd",
"Addr_type": "StreetInt",
"Type": "",
"PlaceName": "",
"Place_addr": "New York St & W Redlands Blvd, Redlands, California, 92373",
"Phone": "",
"URL": "",
"Rank": 20,
"AddBldg": "",
"AddNum": "",
"AddNumFrom": "",
"AddNumTo": "",
"AddRange": "",
"Side": "",
"StPreDir": "",
"StPreType": "",
"StName": "",
"StType": "",
"StDir": "",
"StPreDir1": "",
"StPreType1": "",
"StName1": "New York",
"StType1": "St",
"StDir1": "",
"StPreDir2": "W",
"StPreType2": "",
"StName2": "Redlands",
"StType2": "Blvd",
"StDir2": "",
"BldgType": "",
"BldgName": "",
"LevelType": "",
"LevelName": "",
"UnitType": "",
"UnitName": "",
"SubAddr": "",
"StAddr": "New York St & W Redlands Blvd",
"Block": "",
"Sector": "",
"Nbrhd": "West Redlands",
"District": "",
"City": "Redlands",
"MetroArea": "Inland Empire",
"Subregion": "San Bernardino County",
"Region": "California",
"RegionAbbr": "CA",
"Territory": "",
"Zone": "",
"Postal": "92373",
"PostalExt": "",
"Country": "USA",
"CntryName": "United States",
"LangCode": "ENG",
"Distance": 0,
"X": -117.19571001697132,
"Y": 34.059490013895314,
"DisplayX": -117.19571001697132,
"DisplayY": 34.059490013895314,
"Xmin": -117.19671001697132,
"Xmax": -117.19471001697131,
"Ymin": 34.058490013895316,
"Ymax": 34.060490013895311,
"ExInfo": ""
},
"extent": {
"xmin": -117.19671001697132,
"ymin": 34.058490013895316,
"xmax": -117.19471001697131,
"ymax": 34.060490013895311
}
}