A response from the ArcGIS 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 ArcGIS Geocoding service.
For example, a search for Avenida República de El Salvador 70, Distrito Federal, MEX returns a Point
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 Street
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 Point
or Street
matches, because delivering something to a street center or city centroid won't work.
Geocoding accuracy varies by region and country. The Sub
match level is the most accurate, followed by Point
and Street
. The Street
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
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 ArcGIS Geocoding service, as well as the request types for which the fields are returned.
Field | Description | Supported request types |
---|---|---|
| The spatial reference of the output match location coordinates as specified by the |
|
| The complete matching address returned for Example: 380 New York St, Redlands, California, 92373 |
|
| The full street address of a location, including house number and street name. Example: 380 New York St |
|
| 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 For |
|
| This is only returned for |
|
| The name of the locator used to return a particular match result. |
|
| Indicates whether a geocode request results in a match, a tie, or is unmatched. The possible values are the following:
|
|
| 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 complete address returned for the geocode request. The format is based on address standards for the country in which the address is located. |
|
| A longer version of the |
|
| A shortened version of the |
|
| The match level for a geocode request. Supported match levels vary in different countries. The possible values are the following:
|
|
| The feature type for results returned by a search. The |
|
| The formal name of a geocode match candidate. Example: Paris or Starbucks. |
|
| The full street address of a place, including street, city, and region. Example: 275 Columbus Ave, New York, New York. |
|
| The primary phone number of a place of interest (POI). Example: Knott's Berry Farm, |
|
| The URL of the primary website for a place of interest (POI). Example: the University of Georgia, |
|
| A floating-point number value indicating the priority 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 |
|
| The name of a building. Example: Empire State Building. |
|
| The alphanumeric value that represents the portion of an address typically known as a house number or building number. Example: in the address 380 New York Street, This value is returned for |
|
| 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 |
|
| 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 |
|
| The full house number range for the street segment that an address lies on, in the format AddNumFrom-AddNumTo. For example, the |
|
| 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 |
|
| An address element defining the direction of a street and occurs before the primary street name. Example: North in North Main Street. |
|
| An address element defining the leading type of a street. Example: the Spanish term Avenida in Avenida Central or the French term Rue in Rue Lapin. |
|
| An address element defining the primary name of a street. Example: Main in North Main Street. |
|
| An address element defining the trailing type of a street. Example: Street in Main Street. |
|
| An address element defining the direction of a street, which occurs after the primary street name. Example: North in Main Street North. |
|
| The name or number of a building subunit. Example: A in building A. |
|
| The classification of a building subunit. Examples are building, hangar, and tower. |
|
| The classification of a floor subunit. Examples are floor, level, department, and wing. |
|
| The name or number of a floor subunit. Example: 3 in level 3. |
|
| The classification of a unit subunit. Examples are unit, apartment, flat, office, and suite. |
|
| The name or number of a unit subunit. Example: 2B in apartment 2B. |
|
| The full subunit value for a candidate with |
|
| The street address of a place, without city and region. Example: 275 Columbus Ave. |
|
| The name of the block-level administrative division for a candidate. The |
|
| The name of the sector-level administrative division for a candidate. The |
|
| The name of the neighborhood-level administrative division for a candidate. The |
|
| The name of the neighborhood-level administrative division for a candidate. The |
|
| The name of the district-level administrative division for a candidate. Such as a subdivision of a city. |
|
| The name of the city-level administrative division for a candidate. The |
|
| 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. |
|
| The name of the subregion-level administrative division for a candidate. The |
|
| 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 |
|
| The abbreviated region name. The |
|
| 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. |
|
| An alphanumeric address element defining the primary postal code. Example: V7M 2B4 for a Canadian postal code and 92374 for a United States postal code. |
|
| An alphanumeric address element defining the postal code extension. Example: 8100 in USA postal code 92373-8110. |
|
| A 3-character code for a country. Example: Canada is CAN. A list of supported countries and codes is available in Geocode data coverage. This field is returned by the |
|
| A 3-character code for a country. Example: Canada is CAN. A list of supported countries and codes is available in Geocode data coverage. |
|
| The full country name for an address candidate. Example: 日本 (Japan). The name may be in the same language as the input address or in the language specified by the |
|
| A 3-character language code representing the language of the address. Example: ENG is English. |
|
| The physical distance in meters from a candidate to a specified location. The |
|
| The primary x-coordinate of an address returned by the ArcGIS Geocoding service in spatial reference WGS84 (WKID 4326). |
|
| The primary y-coordinate of an address returned by the ArcGIS Geocoding service in spatial reference WGS84 (WKID 4326). |
|
| The x-coordinate that was submitted in a |
|
| The y-coordinate that was submitted in a |
|
| The display x-coordinate of an address returned by the ArcGIS Geocoding service in spatial reference WGS84 (WKID 4326). For most types of matches, the |
|
| The display y-coordinate of an address returned by the ArcGIS Geocoding service in spatial reference WGS84 (WKID 4326). For most types of matches, the |
|
| The minimum x-coordinate for the display extent of a feature returned by the ArcGIS Geocoding service. The |
|
| The maximum x-coordinate for the display extent of a feature returned by the ArcGIS Geocoding service. The |
|
| The minimum y-coordinate for the display extent of a feature returned by the ArcGIS Geocoding service. The |
|
| The maximum y-coordinate for the display extent of a feature returned by the ArcGIS Geocoding service. The |
|
| 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. |
|
| The minimum bounding rectangle of the output match feature as specified by the |
|
| A designation for a structure or building that describes its primary usage. These are the possible values:
Only geocoding candidates that have |
|
| Related to For addresses with
For addresses with
Only geocoding candidates that have |
|
Service responses
As a developer, it's useful to be aware of the various JSON responses that can be returned by the ArcGIS 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 | Details | Cause | ExtendedCode |
---|---|---|---|
Unable to complete operation. | "<parameter name> parameter value exceeds the maximum length of <maximum length> characters allowed for the parameter value." | This error is returned if a parameter value contains too many characters. For example, if the singleLine parameter value exceeds 200 characters, this error is returned. | -2147467259 |
Unable to complete operation. | "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. | -2147467259 |
Unable to complete operation. | "magicKey entered is invalid" | This error is returned when the magicKey parameter in a findAddressCandidates request includes an invalid value. | -2147467259 |
Unable to complete operation. | "MagicKey was not generated from the current release and is no longer valid" | This error is returned when the magicKey parameter in a findAddressCandidates request includes a value that corresponds to a different version of the software than the one which is handling the request. | -2147467259 |
Unable to complete operation. | none | This error is returned when the addresses parameter in a geocodeAddresses request is missing, 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. | -2147467259 |
Unable to complete operation. | none | This error is returned when a reverseGeocode request does not include the required location parameter. | -2147467259 |
"Cannot perform query. Invalid query parameters." | "Unable to find address for the specified location." | This error is returned when no match can be found for a reverseGeocode operation. | none |
"Invalid or missing input parameters." | none | This error is returned if a request is missing a required parameter, such as when a suggest request does not include the required text parameter. | -2147024809 |
Error code 403
Message | Details | Cause | ExtendedCode |
---|---|---|---|
"Token is valid but access is denied." | "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, | -2147200253 |
"Token is valid but access is denied." | "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, | -2147200253 |
"Token is valid but access is denied." | "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. | -2147200253 |
Error code 499
Message | Details | Cause | ExtendedCode |
---|---|---|---|
"Token required but not passed in the request." | "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 | none |
Error code 500
Message | Details | Cause | ExtendedCode |
---|---|---|---|
"Error finding address candidates" | none | This error is returned when the casing of the service name in a findAddressCandidates request is incorrect, such as "world" instead of "World". | none |
"Error performing reverse geocode operation" | none | This error is returned when the casing of the service name in a reverseGeocode request is incorrect, such as "world" instead of "World". | none |
"Error performing suggest operation" | none | This error is returned when the casing of the service name in a suggest request is incorrect, such as "world" instead of "World". | none |
"Error performing geocode addresses operation" | none | This error is returned when the casing of the service name in a geocodeAddresses request is incorrect, such as "world" instead of "World". | none |
Error code 504
Message | Details | Cause | ExtendedCode |
---|---|---|---|
"Gateway timeout" | 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. | none |
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 find
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 find
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 reverse
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 response
message (for find
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
{
"address": "",
"score": 0,
"attributes": {
"ResultID": 2,
"Loc_name": "World",
"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": "",
"CntryName": "",
"LangCode": "",
"Distance": 0,
"X": 0.0,
"Y": 0.0,
"DisplayX": 0.0,
"DisplayY": 0.0,
"Xmin": 0.0,
"Xmax": 0.0,
"Ymin": 0.0,
"Ymax": 0.0,
"ExInfo": "",
"StrucType": "",
"StrucDet": ""
}
}
]
}
Response for unsupported category
value
If an invalid category value is passed in a request, a responseInfo message is returned by the service which contains information about the invalid category value. If a list of category values is passed in the request, and one or more of the values are invalid, the response will include any candidates which match the request parameters in addition to the responseInfo object describing the invalid category values. This is a change to the way invalid category values are handled. Previously, the response consisted of a generic error message without any matching candidates or information about invalid categories.
Response for invalid category value in find Address Candidates
request
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
],
"responseInfo": {
"message": "Invalid category value '<category>' in request"
}
}
Response for invalid category value in suggest
request
{
"suggestions": [
],
"responseInfo": {
"message": "Invalid category value '<category>' in request"
}
}
Output fields for StreetInt candidates
Intersection candidates, when Addr
, are a special case with respect to output fields. Three sets of output fields are returned for a single Street
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 St
output fields for a Street
candidate:
St
—TheName St
output field for the intersectionName St
—TheName1 St
output field for the first street segment of the intersectionName St
—TheName2 St
output field for the second street segment of the intersectionName
The following example shows all the output fields included in a JSON response for a Street
candidate.
Example
Find an intersection (New York St and Redlands Blvd, Redlands, CA)
Single-field request URL
https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?singleLine=New York St and Redlands Blvd, Redlands, CA&outFields=*&f=pjson&token=<ACCESS_TOKEN>
JSON response
{
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
},
"candidates": [
{
"address": "New York St & W Redlands Blvd, Redlands, California, 92373",
"location": {
"x": -117.195698701402,
"y": 34.059613898424
},
"score": 99.84,
"attributes": {
"Loc_name": "World",
"Status": "T",
"Score": 99.84,
"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": "",
"District": "",
"City": "Redlands",
"MetroArea": "",
"Subregion": "San Bernardino County",
"Region": "California",
"RegionAbbr": "CA",
"Territory": "",
"Zone": "",
"Postal": "92373",
"PostalExt": "",
"Country": "USA",
"CntryName": "United States",
"LangCode": "ENG",
"Distance": 0,
"X": -117.195698701402,
"Y": 34.059613898424,
"DisplayX": -117.195698701402,
"DisplayY": 34.059613898424,
"Xmin": -117.196698701402,
"Xmax": -117.194698701402,
"Ymin": 34.058613898424,
"Ymax": 34.060613898424,
"ExInfo": "",
"StrucType": "",
"StrucDet": "",
"StrucType1": "",
"StrucType2": "",
"StrucDet1": "",
"StrucDet2": ""
},
"extent": {
"xmin": -117.196698701402,
"ymin": 34.058613898424,
"xmax": -117.194698701402,
"ymax": 34.060613898424
}
}