findAddressCandidates

The findAddressCandidates operation geocodes one location per request; the input address can be combined into a single input field or divided among multiple parameters.

findAddressCandidates

Note:

The find operation has been deprecated. Please discontinue using it in your application, and use the findAddressCandidates operation instead.

The findAddressCandidates operation supports finding the following types of locations:

Request URL

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?<PARAMETERS>

There are several options for refining or restricting search results:

Request parameters

The findAddressCandidates operation supports searching for places and addresses in single-field format (the singleLine parameter) or in multifield format with the address components separated into multiple parameters. Single-field input is easier because the address parsing is done for you; however, multifield input may provide faster responses and more precise results.

In order to provide a way to find addresses in many different countries, which may use different addressing formats, the findAddressCandidates operation uses standardized field names for submitting address components. In the parameters listed below, the neighborhood, city, subregion, and region parameters represent typical administrative divisions within a country. They may have different contexts for different countries, and not all administrative divisions are used in all countries. For instance, with addresses in the United States, only the city (city) and region (state) parameters are used; for addresses in Mexico, the neighborhood parameter is used for districts (colonias) within a city, city for municipalities (municipios), and the region parameter for states (estados); Spain uses all four administrative divisions.

The service info page http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?f=pjson provides localized versions of the input field names in all locales supported by the service. See Localized input field names for more information.

Required parameters

The findAddressCandidates operation has only one required parameter: f. However, you also need to pass address or place information, which can be done by passing the name as a single line of text for clarity or passing it as multiple fields of text for accuracy. To access single-line functionality, the singleLine parameter is required. To access multifield functionality instead, any combination of the address, neighborhood, city, region, subregion, countryCode, and postal parameters is required.

NoteNote:

The singleLine parameter can be combined with the sourceCountry parameter in a request. The singleLine parameter cannot be used with any of the other multifield parameters.

f

The service supports responses in JSON or PJSON format. You can specify the response format using the f parameter. This is a required parameter.

Example:
f=pjson

Optional parameters

singleLine

Specifies the location to be geocoded. This can be a street address, place-name, postal code, or POI. The input address components need to be formatted as a single string.

NoteNote:

The singleLine parameter is not required if the category parameter is included in the request with a valid value.

Example:
singleLine=380 New York St, Redlands, California 92373

Address parameters

The full street address of a place (excluding administrative divisions and postal codes) may consist of multiple components, such as building name, street, and subunit (apartment). Web forms and written correspondence typically utilize multiple fields or lines to designate these components. The findAddressCandidates operation supports three different address parameters which can be used to represent the different components of a street address: address, address2, address3. If you want to geocode the address Beetham Tower, 301 Deansgate, Suite 4208, Manchester, England using multiple input fields, you can set address=Beetham Tower, address2=301 Deansgate, and address3=Suite 4208.

NoteNote:

For most geocoding cases it will only be necessary to use the address parameter.

address

A string that represents the first line of a street address. In most cases this field will be used for street name and house number input, but it can also be used to input building name or place name.

Example of address field input in the United States:
address=380 New York Street
Example of address field input in Mexico:
address=Avenida Revolucion 8208

address2

A string that represents the second line of a street address. This can include street name/house number, building name, place name, or subunit.

Example address2 field input:
address2=Beetham Tower

address3

A string that represents the third line of a street address. This can include street name/house number, building name, place name, or subunit.

Example address3 field input:
address3=Suite 4208

neighborhood

The smallest administrative division associated with an address, typically, a neighborhood or a section of a larger populated place. A neighborhood is a subdivision of a city.

NoteNote:

The neighborhood parameter is not used in all countries or regions.

Example of a neighborhood in Mexico (colonia):
neighborhood=Herrera

city

The next largest administrative division associated with an address, typically, a city or municipality. A city is a subdivision of a subregion or a region.

Example of a city in the U.S.:
city=Los Angeles
Example of a city in Mexico:
city=Tijuana

subregion

The next largest administrative division associated with an address. Depending on the country, a subregion can represent a county, state, or province.

Example of a subregion (department) in France:
subregion=Vienne

region

The largest administrative division associated with an address, typically, a state or province.

Example of a region in the U.S. (state):
region=Florida
Example of a region in Mexico (estado):
region=Baja California

postal

The standard postal code for an address, typically, a 3–6-digit alphanumeric code.

Example:
postal=92373

postalExt

A postal code extension, such as the United States Postal Service ZIP+4 code, provides finer resolution or higher accuracy when also passing postal.

Example:
postalExt=1112

countryCode

A value representing the country. Providing this value increases geocoding speed. Acceptable values include the full country name in English or the official language of the country, the ISO 3166-1 2-digit country code, or the ISO 3166-1 3-digit country code. A list of supported countries and codes is available in Geocode coverage.

NoteNote:

The sourceCountry and countryCode parameters are similar but serve different purposes. The countryCode parameter defines the country value for a multifield geocode request. The sourceCountry parameter defines the country value for a request regardless of whether it is a single-field or multifield request. If both countryCode and sourceCountry are included in a findAddressCandidates request, and the country values are different, the countryCode value takes priority over sourceCountry.

Example:
countryCode=USA

magicKey

The findAddressCandidates operation retrieves results quicker when you pass in valid singleLine and magicKey values than when you don't pass in magicKey. However, to get these advantages, you need to make a prior request to suggest, which provides a magicKey. This may or may not be relevant to your workflow.

The suggest operation is often called on to improve the user experience of search boxes by analyzing partial text and providing complete names of places, addresses, points of interest, and so on. For instance, typing Mbu into a search box offers Mbuji-Mayi, Democratic Republic of the Congo as a suggestion, so the user doesn't need to type the complete name.

Looking at the suggestion process from another perspective, as the user types, the suggest operation performs a text search, which is a redundant part of the overall search that the findAddressCandidates operation can also perform. The user chooses a place-name or type—narrowing the results to a specific record. The results from suggest include text and magicKey values that contain the information the user chose; passing these values from suggest into findAddressCandidates results in faster and more accurate operations.

In summary, using the magicKey parameter in findAddressCandidates is a two-step process:

  • Make a request to suggest. The response includes text and magicKey properties.
  • Make a request to findAddressCandidates and pass in the text and magicKey values returned from suggest as the singleLine and magicKey input parameters, respectively. The magicKey parameter will not function correctly if passed alone. Both magicKey and singleLine must be included in a findAddressCandidates request so the output matches the selected suggestion.

NoteNote:

For best results, when the searchExtent and location parameters are included in a suggest request, the same parameters should be included in the corresponding findAddressCandidates request.

Example:
magicKey=JS91CYhQDS5vDPhvSMyGZby0YFbaUDoaM5bHMoFF

searchExtent

A set of bounding box coordinates that limit the search area to a specific region. This is especially useful for applications in which a user will search for places and addresses within the current map extent.

You can specify the spatial reference of the searchExtent coordinates, which is necessary if the map spatial reference is different than that of the geocoding service; otherwise, the spatial reference of the coordinates is assumed to be the same as that of the geocoding service.

The input can either be a comma-separated list of coordinates defining the bounding box or a JSON envelope object. The spatial reference of the bounding box coordinates can be included if an envelope object is used.

Example without a spatial reference:
searchExtent=-104,35.6,-94.32,41
Example with a spatial reference:
searchExtent=
{
    "xmin": -13052769,
    "ymin": 3951172,
    "xmax": -13019630,
    "ymax": 3978490,
    "spatialReference": {
        "wkid": 3395
    }
}

location

Defines an origin point location that is used to sort geocoding candidates based on their proximity to the location. The priority of candidates within a default radial distance from the location are boosted relative to those outside the radius. The default distance is 50,000 meters; this value is not configurable.

This is useful in mobile applications where a user will want to search for places in the vicinity of their current GPS location; the location parameter can be used in this scenario.

The location can be represented with a simple comma-separated syntax (x,y), or as a JSON point object. If the comma-separated syntax is used, the spatial reference of the coordinates must be WGS84; otherwise, the spatial reference of the point coordinates can be defined in the JSON object.

NoteNote:

The distance parameter is deprecated and no longer recognized by the service. A default distance of 50,000 meters is now used internally by the service to boost candidate priority for all requests with location.

Example using simple syntax (WGS84):
location=-117.196,34.056
JSON example with a spatial reference:
location=
{
    "x": -13046165.572,
    "y": 4036389.847,
    "spatialReference": {
        "wkid": 102100
    }
}

category

A place or address type that can be used to filter findAddressCandidates results. The parameter supports input of single category values or multiple comma-separated values. The category parameter can be passed in a request with or without the singleLine parameter. See Category filtering for complete details about the category parameter.

Example of category filtering with a single category:
category=Address
Example of category filtering with multiple categories:
category=Address,Postal

outSR

The spatial reference of the x/y coordinates returned by a geocode request. This is useful for applications using a map with a spatial reference different than that of the geocode service.

The spatial reference can be specified as either a well-known ID (WKID) or as a JSON spatial reference object. If outSR is not specified, the spatial reference of the output locations is the same as that of the service. The World Geocoding Service spatial reference is WGS84 (WKID = 4326).

For a list of valid WKID values, see Projected Coordinate Systems and Geographic Coordinate Systems.

Example (102100 is the WKID for the Web Mercator projection):
outSR=102100

outFields

The list of fields to be returned in the response. Descriptions for each of these fields are available in the Output fields section of this document.

The returned address, x/y coordinates of the match location, match score, spatial reference, extent of the output feature, and the Addr_type (match level) are returned by default.

Example that returns all output fields:
outFields=*
Example that returns the specified fields only:
outFields=AddrNum,StName,City

maxLocations

The maximum number of locations to be returned by a search, up to the maximum number allowed by the service. If not specified, then all matching candidates up to the service maximum are returned.

The World Geocoding Service allows up to 50 candidates to be returned for a single request.

Example:
maxLocations=10

forStorage

Specifies whether the results of the operation will be persisted. The default value is false, which indicates the results of the operation can't be stored, but they can be temporarily displayed on a map for instance. If you store the results, in a database, for example, you need to set this parameter to true.

Applications are contractually prohibited from storing the results of geocoding transactions unless they make the request by passing the forStorage parameter with a value of true and the token parameter with a valid ArcGIS Online token. Instructions for composing a request with a valid token are provided in the authentication topic.

ArcGIS Online service credits are deducted from the organization account for each geocode transaction that includes the forStorage parameter with a value of true and a valid token. Refer to the ArcGIS Online service credits overview page for more information on how credits are charged.

To learn more about free and paid geocoding operations, see Free vs. paid operations.

Example:
forStorage=true

matchOutOfRange

A Boolean which specifies if StreetAddress matches should be returned even when the input house number is outside of the house number range defined for the input street. Out-of-range matches have Addr_type=StreetAddressExt. The geometry of such matches is a point corresponding to the end of the street segment where the range value is closest to the input house number. If matchOutOfRange is not specified in a request, its value is set to true by default.

With matchOutOfRange, better spatial accuracy is provided for inexact street address searches. Most street segments are assigned house number ranges. For example, "Main Street" may include house numbers from 2–100 on one side of the street and 1–99 on the other. A user may search for a house number which is not within this range, such as "109 Main Street". If matchOutOfRange=false is passed in this request, the geocode service will return a StreetName-level match to "Main Street", with geometry corresponding to the centroid of a street segment which most closely matches the input values. StreetName matches can be ambiguous because there may be multiple street segments with the same name that equally match the input. However, if matchOutOfRange=true in this case, a more precise geometry is returned to the specific side of the segment of Main Street with house number range 1–99.

NoteNote:
Input house numbers that exceed the range on a street segment by more than 100 will not result in StreetAddressExt matches. For streets with smaller house number ranges, the maxOutOfRange tolerance is less than 100.
Example:
matchOutOfRange=false

locationType

Specifies if the output geometry of PointAddress matches should be the rooftop point or street entrance location. Valid values are rooftop and street. The default value is street.

Geocode results include one geometry object (the location object) which defines the location of the address, as well as two sets of X/Y coordinate values within the attributes object: X/Y, and DisplayX/DisplayY. For geocode results with Addr_type=PointAddress, the X/Y attribute values describe the coordinates of the address along the street, while the DisplayX/DisplayY values describe the rooftop, or building centroid, coordinates. By default the geometry returned for geocode results represents the street entrance location of the address. This is useful for routing scenarios because the rooftop location of some addresses may be offset from a street by a large distance. However for map display purposes it may be desirable to show the rooftop location instead, especially when large buildings or landmarks are geocoded. For these cases the locationType parameter can be used to specify that the rooftop geometry should be returned.

NoteNote:

The locationType parameter only affects the location object in the geocode JSON response. It does not change the X/Y or DisplayX/DisplayY attribute values.

Example:
locationType=rooftop

langCode

Sets the language in which geocode results are returned. Addresses and places in many countries are available in more than one language; in these cases the langCode parameter can be used to specify which language should be used for results returned by the findAddressCandidates operation. This is useful for ensuring that results are returned in the expected language. For example, a web application could be designed to get the browser language and pass it as the langCode parameter value in a findAddressCandidates request.

See the table of supported countries for valid language code values in each country. The Supported Language Codes column provides the valid input values for the langCode parameter. Full language names cannot be used with the langCode parameter. Only one language code value can be included for the langCode parameter in a findAddressCandidates request.

The default language code for each country is the first one listed in the Supported Language Codes column, highlighted with bold text. It is the default language of results returned by the findAddressCandidates operation for a particular country. For countries with multiple supported languages, the default language is the one spoken by the highest percentage of the country's population. For some countries, not all addresses and places are available in the default language. If the langCode parameter isn't included in a request, or if it is included but there are no matching features with the input language code, then the resultant match is returned in the country's default language code.

Similarly, when there are multiple supported languages for a country, it doesn't mean that every address in the country is available in each of the languages. It may be the case that addresses are available in multiple languages for only one region of the country, or that each language is exclusive to a different region and there is no overlap at all.

  • Both English and French are listed as supported languages for Canada. However, there is no overlap between the languages for any addresses in most provinces. In the province of Quebec, only French addresses are available, while English is the only language used for addresses in Ontario.
  • In Belgium, where three languages are supported (Dutch, French, and German), addresses are available in the City of Brussels in both Dutch and French. However, in the majority of the country only a single language is used for addresses.
  • In Greece there is complete address coverage in both Greek and transliterated Greek languages (Greek words translated with Latin characters).

Due to variability of language coverage, the following logic is used to handle the different scenarios that may be encountered.

Scenario

Result

Example

No langCode value is specified and only one language is supported for the matching record.

Address is returned in the supported language

Location in Geneva, Switzerland (only French addresses are supported)

Address returned in French language

No langCode value is specified and multiple languages are supported for the matching record.

Address is returned in the country's default language

Location in Brussels, Belgium (Dutch and French addresses are supported; Dutch is the default language)

Address returned in Dutch language

An invalid langCode value is specified and only one language is supported for the matching record.

Address is returned in the supported language

Location in Geneva, Switzerland (only French addresses are supported), and langCode=zh

Address returned in French language

An invalid langCode is specified and multiple languages are supported for the matching record; the input langCode is a Latin-based script and a transliterated address exists at the location.

Address is returned in the country's default language

Location in Athens, Greece (Greek and transliterated Greek are supported), and langCode=fr

Address returned in Greek language

An invalid langCode is specified and multiple languages are supported for the matching record; the input langCode is not a Latin-based script.

Address is returned in the country's default language

Location in Athens, Greece (Greek and transliterated Greek are supported; Greek is the default language), and langCode=ru

Address returned in Greek language

Example:
langCode=fr

sourceCountry

Limits the candidates returned by the findAddressCandidates operation to the specified country or countries. For example, if sourceCountry=USA is included in the request, it is assumed that the address is in the United States, so only matching addresses in USA are returned. Using this parameter prevents potential unexpected results in other countries for ambiguous searches.

Acceptable values include the ISO 3166-1 3-character country code. You can specify multiple country codes to limit results to more than one country.

A list of supported countries and codes is available in Geocode coverage.

NoteNote:

The sourceCountry and countryCode parameters are similar but serve different purposes. The countryCode parameter defines the country value for a multifield geocode request. The sourceCountry parameter defines the country value for a request regardless of whether it is a single-field or multifield request. If both countryCode and sourceCountry are included in a findAddressCandidates request, and the country values are different, the countryCode value takes priority over sourceCountry.

Example: Single country
sourceCountry=USA
Example: Multiple countries
sourceCountry=FRA,DEU,ESP

Search for street addresses

You can search for a street address, street name, or street intersection using the findAddressCandidates operation. For best results, you should include as much location information as possible in the search in addition to the street address. See Match accuracy for more information about obtaining optimal results for address searches.

You can pass the address components in a single parameter or separated into multiple parameters. Examples of each are shown. Note that in each case the JSON response is the same for both the single and multiple parameter requests.

Example: Find a street address (380 New York Street, Redlands, CA 92373)

Single-field request URL

Multifield request URL: In this example, the street address component (380 New York St) is passed as the value for the address parameter; the city component (Redlands) as the value for the city parameter; the state component (CA) as the region parameter; and the ZIP Code (92373) as the value for the postal parameter. Also in this example, all possible output fields are returned (outFields=*), even if they don't contain a value.

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "380 New York St, Redlands, California, 92373",
   "location": {
    "x": -117.1956703176181,
    "y": 34.056488119308924
   },
   "score": 100,
   "attributes": {
    "Loc_name": "World",
    "Status": "M",
    "Score": 100,
    "Match_addr": "380 New York St, Redlands, California, 92373",
    "LongLabel": "380 New York St, Redlands, CA, 92373, USA",
    "ShortLabel": "380 New York St",
    "Addr_type": "PointAddress",
    "Type": "",
    "PlaceName": "",
    "Place_addr": "380 New York St, Redlands, California, 92373",
    "Phone": "",
    "URL": "",
    "Rank": 20,
    "AddBldg": "",
    "AddNum": "380",
    "AddNumFrom": "",
    "AddNumTo": "",
    "AddRange": "",
    "Side": "R",
    "StPreDir": "",
    "StPreType": "",
    "StName": "New York",
    "StType": "St",
    "StDir": "",
    "BldgType": "",
    "BldgName": "",
    "LevelType": "",
    "LevelName": "",
    "UnitType": "",
    "UnitName": "",
    "SubAddr": "",
    "StAddr": "380 New York St",
    "Block": "",
    "Sector": "",
    "Nbrhd": "West Redlands",
    "District": "",
    "City": "Redlands",
    "MetroArea": "Inland Empire",
    "Subregion": "San Bernardino",
    "Region": "California",
    "RegionAbbr": "CA",
    "Territory": "",
    "Zone": "",
    "Postal": "92373",
    "PostalExt": "",
    "Country": "USA",
    "LangCode": "ENG",
    "Distance": 0,
    "X": -117.1956703176181,
    "Y": 34.056488119308924,
    "DisplayX": -117.1953135,
    "DisplayY": 34.056108000000009,
    "Xmin": -117.1963135,
    "Xmax": -117.19431349999999,
    "Ymin": 34.055108000000011,
    "Ymax": 34.057108000000007,
    "ExInfo": ""
   },
   "extent": {
    "xmin": -117.1963135,
    "ymin": 34.055108000000011,
    "xmax": -117.19431349999999,
    "ymax": 34.057108000000007
   }
  }
 ]
}

Search for intersections

An intersection is where two streets cross each other. An intersection search consists of the intersecting street names plus the containing administrative division or postal code. For example, redlands blvd and new york st 92373 is a valid intersection search, as is redlands blvd & new york st redlands ca. For street intersection matches, Addr_type=StreetInt.

NoteNote:

The valid intersection connectors can be found by looking up the IntersectionConnectors property from the service info URL: http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?f=pjson.

There are several different types of intersections that can found by the World Geocoding Service. A typical simple intersection is formed by two street segments crossing each other. An example of this is W Park Ave and Tennessee St, Redlands, CA.

Example: Find a simple street intersection (W Park Ave and Tennessee St, Redlands, CA)

Simple intersection example

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "W Park Ave & Tennessee St, Redlands, California, 92373",
   "location": {
    "x": -117.20008350000001,
    "y": 34.059222000000005
   },
   "score": 100,
   "attributes": {
    "Addr_type": "StreetInt"
   },
   "extent": {
    "xmin": -117.20108350000001,
    "ymin": 34.058222000000008,
    "xmax": -117.1990835,
    "ymax": 34.060222000000003
   }
  }
 ]
}

You can also find intersections between streets that aren't physically connected. This includes cases where streets are separated by elevation, such as a highway overpass crossing over another street. An example of this is Pacific Hwy and W Washington St, San Diego, CA 92140.

Example: Find an intersection at a highway overpass (Pacific Hwy and W Washington St, San Diego, CA 92140)

highway overpass intersection example

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Pacific Hwy & W Washington St, San Diego, California, 92140",
   "location": {
    "x": -117.18433350000001,
    "y": 32.740434000000008
   },
   "score": 100,
   "attributes": {
    "Addr_type": "StreetInt"
   },
   "extent": {
    "xmin": -117.18533350000001,
    "ymin": 32.73943400000001,
    "xmax": -117.1833335,
    "ymax": 32.741434000000005
   }
  }
 ]
}

An intersection can also be formed by two disconnected streets when one street ends close to another, such as a cul-de-sac or a dead end. In cases like this, if the streets are within a certain distance of each other then the World Geocoding Service returns a StreetInt match when they are searched for. This near-intersection tolerance is currently 60 meters. An example of this type of near-intersection is Rua da Capitania & Avenida Comendador Franco, Curitiba, BRA.

Example: Find a near-intersection (Rua da Capitania & Avenida Comendador Franco, Curitiba, BRA)

Near-intersection example

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Rua da Capitania & Avenida Comendador Franco, Guabirotuba, Curitiba, Paraná, 81520-590",
   "location": {
    "x": -49.235552999999996,
    "y": -25.46397
   },
   "score": 100,
   "attributes": {
    "Addr_type": "StreetInt"
   },
   "extent": {
    "xmin": -49.236552999999994,
    "ymin": -25.464970000000001,
    "xmax": -49.234552999999998,
    "ymax": -25.462969999999999
   }
  }
 ]
}

Another type of disconnected intersection supported by the World Geocoding Service occurs at roundabouts. A roundabout is formed when two or more different streets connect to a circular roadway, which is often unnamed. The participating streets typically don't connect directly to each other, but when they are searched for and are within the near-intersection tolerance, the service returns a StreetInt match. An example of a roundabout intersection is Rue Jean Laurent & Avenue Jean Mermoz, Le Vésinet, FRA.

Example: Find a roundabout intersection (Rue Jean Laurent & Avenue Jean Mermoz, Le Vésinet, FRA)

roundabout intersection example

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Rue Jean Laurent & Avenue Jean Mermoz, 78110, Le Vésinet, Yvelines, Île-de-France",
   "location": {
    "x": 2.1344557500000123,
    "y": 48.895249500000006
   },
   "score": 100,
   "attributes": {
    "Addr_type": "StreetInt"
   },
   "extent": {
    "xmin": 2.1334557500000124,
    "ymin": 48.894249500000008,
    "xmax": 2.1354557500000122,
    "ymax": 48.896249500000003
   }
  }
 ]
}

Sometimes there may be multiple possible matches for an intersection search. This typically occurs when divided roads cross each other. A divided road consists of two street segments separated by a median. In a scenario like this there could be up to four equivalent intersection matches consisting of the same street names at different locations. The World Geocoding Service uses an ambiguous intersection tolerance with such searches to remove redundant intersection candidates from the response. The ambiguous intersection tolerance is currently 30 meters. Specifically, if there are multiple intersection candidates with the same street names and different locations, and if they are within 30 meters of each other, the service returns only one of the candidates. An example of an ambiguous intersection search is Cambie St and W King Edward Ave, Vancouver, British Columbia. In this case there are three potential intersection candidates with the same street names. Because the locations are within the ambiguous intersection tolerance only one intersection candidate is returned.

Example: Find an ambiguous intersection (Cambie St and W King Edward Ave, Vancouver, British Columbia)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Cambie St & W King Edward Ave, Vancouver, British Columbia, V5Z",
   "location": {
    "x": -123.11556300000001,
    "y": 49.248936000000008
   },
   "score": 100,
   "attributes": {
    "Addr_type": "StreetInt"
   },
   "extent": {
    "xmin": -123.11656300000001,
    "ymin": 49.24793600000001,
    "xmax": -123.114563,
    "ymax": 49.249936000000005
   }
  }
 ]
}

Search for POIs

In the context of the World Geocoding Service, a POI is a point location that can represent a cultural or geographic landmark, business, or administrative division. For example, you can find amusement parks, museums, schools, restaurants, hotels, gas stations, or other types of businesses or landmarks; geographic features, such as mountains, lakes, rivers, or deserts; or administrative places, such as neighborhoods, cities, states, counties, or countries. The findAddressCandidates operation supports geocoding POIs by name or by type.

NoteNote:

The supported types are listed in this table.

As with street addresses, you can search for POIs with findAddressCandidates using the single field or multifield approach.

Single-field POI search

To search for POIs with single-field search, use the singleLine parameter. In general, valid singleLine POI search strings can be formatted in variations of three basic structures:

  1. <name or type> <optional connector> <zone>
  2. <zone> <name or type>
  3. <name or type><address><zone>

Where

  • <name or type> = A place-name, such as Disneyland, Starbucks, or Niagara Falls; or a type, such as amusement parks, waterfalls, or coffee shops.
  • <zone> = A postal code or administrative boundary—such as neighborhood, city, subregion, region, country, or any combination thereof— that provides a spatial boundary to the search. It can be included in the search to limit matching candidates but is not required.
  • <optional connector> = in or at; this is not required for the search.
  • <address> = A street name, such as Main St, or a complete street address, such as 590 N Main St.

Examples of valid singleLine search strings include the following:

Business name searches

  • Starbucks San Diego
  • Starbucks in San Diego
  • San Diego Starbucks
  • Starbucks 92101
  • Starbucks 5th Ave San Diego
  • Rueben H Fleet Science Center, 1875 El Prado, San Diego, CA, 92101, USA

Type searches

  • coffee shops San Diego
  • coffee shops in San Diego CA
  • San Diego coffee shops
  • coffee shops 92101
  • coffee shops 5th Ave San Diego

Multifield POI search

When searching for POIs using multifield input, the name or type of the POI must be passed as the value for the address parameter. The zone information can be passed in the postal, neighborhood, city, subregion, region, and countryCode parameters. If searching for POI + address, the address should be passed as the value for the address2 parameter.

General information

It is important to note that instead of providing a zone, you can limit searches to a specific area by using the searchExtent parameter. You can also influence the sorting of match candidates according to their proximity to a location with the location parameter.

As with address searches, the quality of POI search results is dependent on the amount and quality of information in the search string. If you just search for hotels without qualifying information, such as zone, search extent, or location, your results will not be meaningful. Adding supplemental information to the search string—the more specific the better—will result in more accurate and relevant matches.

NoteNote:

There may be instances when searches yield unexpected results. For example, a search for New York pizza, where the expected results are pizzerias in New York City, may instead return a match to a restaurant named New York Pizza in Sacramento, California. This is because exact place-name matches are given higher priority to increase performance. If this occurs, you can obtain the desired results by modifying the search string—in this case, a search for pizza in NYC should yield the expected results.

NoteNote:

The address, phone number, and website URL of a POI can be returned by including outFields=Place_addr,Phone,URL in the request. But not all POIs have address, phone, and URL values associated with them. See Service output for more information about these output fields.

Examples

Example: Find a business name (Starbucks Sydney, AUS)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Starbucks",
   "location": {
    "x": 151.21507000000008,
    "y": -33.879089999999962
   },
   "score": 100,
   "attributes": {
    "Type": "Coffee Shop",
    "City": "Sydney",
    "Region": "New South Wales"
   },
   "extent": {
    "xmin": 151.21007000000009,
    "ymin": -33.884089999999965,
    "xmax": 151.22007000000008,
    "ymax": -33.87408999999996
   }
  }
 ]
}

Example: Find a business type (hotels Miami, FL)

Single-field request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Miami Int'l Airport Hotel",
   "location": {
    "x": -80.278409999999951,
    "y": 25.795080000000041
   },
   "score": 100,
   "attributes": {
    "Type": "Hotel",
    "City": "Miami",
    "Region": "Florida"
   },
   "extent": {
    "xmin": -80.283409999999947,
    "ymin": 25.790080000000042,
    "xmax": -80.273409999999956,
    "ymax": 25.80008000000004
   }
  },

Example: Find a business on a specific street (Starbucks 5th Ave San Diego)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Starbucks",
   "location": {
    "x": -117.16030999999998,
    "y": 32.730770000000064
   },
   "score": 100,
   "attributes": {
    "Place_addr": "2440 5th Ave, San Diego, California, 92101",
    "Phone": "(619) 702-2113",
    "Type": "Coffee Shop",
    "Addr_type": "POI"
   },
   "extent": {
    "xmin": -117.16530999999998,
    "ymin": 32.725770000000061,
    "xmax": -117.15530999999999,
    "ymax": 32.735770000000066
   }
  },
  {
   "address": "Starbucks",
   "location": {
    "x": -117.16037994835261,
    "y": 32.74717000000004
   },
   "score": 100,
   "attributes": {
    "Place_addr": "3801 5th Ave, San Diego, California, 92103",
    "Phone": "(619) 295-9310",
    "Type": "Coffee Shop",
    "Addr_type": "POI"
   },
   "extent": {
    "xmin": -117.16512999999998,
    "ymin": 32.742170000000037,
    "xmax": -117.15512999999999,
    "ymax": 32.752170000000042
   }
  },
  {
   "address": "Starbucks",
   "location": {
    "x": -117.16007996609754,
    "y": 32.707810000000052
   },
   "score": 100,
   "attributes": {
    "Place_addr": "209 5th Ave, San Diego, California, 92101",
    "Phone": "(619) 234-0749",
    "Type": "Coffee Shop",
    "Addr_type": "POI"
   },
   "extent": {
    "xmin": -117.16463999999996,
    "ymin": 32.702810000000049,
    "xmax": -117.15463999999997,
    "ymax": 32.712810000000054
   }
  }
 ]
}

Search for administrative place-names

The findAddressCandidates operation supports single-field and multifield searches for administrative place-names. This includes searches for neighborhoods, cities, counties, states, provinces, or countries. If a search for a city name results in multiple matches with the same name, the World Geocoding Service will sort the candidates in order of their relative importance to each other (as indicated by the value of the Rank output field), with priority generally based on population and capital status. For example, there are many cities in the world named London, so a search for London results in several equivalent matches; London, UK, will always be the top candidate since it has the greatest population.

Example: Find a city name (London)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "London, England",
   "location": {
    "x": -0.1272099999999341,
    "y": 51.506420000000048
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -0.1552099999999341,
    "ymin": 51.47842000000005,
    "xmax": -0.099209999999934101,
    "ymax": 51.534420000000047
   }
  },
  {
   "address": "London, Ontario",
   "location": {
    "x": -81.246239999999943,
    "y": 42.986900000000048
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -81.338239999999942,
    "ymin": 42.89490000000005,
    "xmax": -81.154239999999945,
    "ymax": 43.078900000000047
   }
  },

However, rank alone is not always enough to distinguish between administrative places. Also, you may not necessarily want to find the highest-ranked feature for a particular search. It may be necessary to remove ambiguity by refining searches with additional information. For example, a search for Oxford returns Oxford, UK, as the top candidate based on rank. If you instead want to find the town of Oxford, Ohio, it is necessary to add the state information to the search.

Example: Search for city, state (Oxford, OH)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Oxford, Ohio",
   "location": {
    "x": -84.742749999999944,
    "y": 39.510490000000061
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -84.77074999999995,
    "ymin": 39.482490000000062,
    "xmax": -84.714749999999938,
    "ymax": 39.53849000000006
   }
  }

Search for postal codes

The findAddressCandidates operation supports searches for postal codes and postal code extensions. When searching for postal codes, it is important to note that the same code can be valid in more than one country; for best results, it may be necessary to include additional information with the postal code, such as city or country.

Example: Find a postal code (20002 USA)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "20002, Washington, District of Columbia",
   "location": {
    "x": -76.98190679999999,
    "y": 38.902602600000023
   },
   "score": 100,
   "attributes": {
    "Addr_type": "Postal"
   },
   "extent": {
    "xmin": -77.020906799999992,
    "ymin": 38.863602600000021,
    "xmax": -76.942906799999989,
    "ymax": 38.941602600000024
   }
  }
 ]
}

Search for coordinates

The World Geocoding Service supports searches for coordinates. The output is a geometry point with a match address that is the same as the input coordinates. This is different than reverse geocoding, in which input x/y coordinates are resolved to a matching street address; see reverseGeocode for more information. The following types of coordinate search are supported:

NoteNote:

Coordinates must be passed as the value for the singleLine or Address field in the request. If the coordinates are included in the Address field then all other input fields, such as Address2, City, Region, and Postal, must be empty.

MGRS and USNG coordinates can be searched with various precisions, from 10,000-meter square to 1-meter square precision. See the table below for examples of valid MGRS or USNG search input.

MGRS/USNG examples

18SUH64

10,000-meter square

2-digit coordinate

18SUH6743

1,000-meter square

4-digit coordinate

18SUH678432

100-meter square

6-digit coordinate

18SUH67894321

10-meter square

8-digit coordinate

18SUH6789043210

1-meter square

10-digit coordinate

Example: Find MGRS / USNG coordinates (18SUH6789043210)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "18SUH6788943210",
   "location": {
    "x": -76.511416672563371,
    "y": 38.327287449633303
   },
   "score": 100,
   "attributes": {
    "Addr_type": "MGRS"
   },
   "extent": {
    "xmin": -76.512416672563376,
    "ymin": 38.326287449633305,
    "xmax": -76.510416672563366,
    "ymax": 38.328287449633301
   }
  }
 ]
}

Input x/y coordinates can be formatted in several different ways:

The following tables shows examples of different formats that can be used to search x/y coordinates.

Decimal degrees examples

Longitude

Latitude

Example search input

-14

28.4

-14 28.4

14 W

28.4 N

45 W, 45 N

14.09W

28.37N

14.09W 28.37N

W14

N28.4

W14, N28.4

X: -14

Y: 28.4

X: -14 Y: 28.4

-14.079085

28.413518

-14.079085, 28.413518

Degrees minutes seconds examples

Longitude

Latitude

Example search input

14°05'20" W

28°25'01" N

14°05'20" W 28°25'01" N

-14°05'20"

28°25'01"

-14°05'20",28°25'01"

X:-14°05'20"

Y:28°25'01"

X:-14°05'20" Y:28°25'01"

14° 05' 20" W

28° 25' 01" N

14° 05' 20" W 28° 25' 01" N

14d05m20s W

28d25m01s N

14d05m20s W 28d25m01s N

-14d05m20s

28d25m01s

-14d05m20s,28d25m01s

X:-14d05m20s

Y:28d25m01s

X:-14d05m20s Y:28d25m01s

14d 05m 20s W

28d 25m 01s N

14d 05m 20s W 28d 25m 01s N

Searches for x/y coordinates can be ambiguous, because some users may place the longitude (x) coordinate first, while others may place the latitude (y) coordinate first. For instance, a search for x/y coordinates 80,50 produces very different results when longitude is first than when latitude is first. The service handles this by returning candidates in both <latitude>,<longitude> and <longitude>,<latitude> formats for ambiguous coordinate searches. The World Geocoding Service returns two or three candidates with the following possible Addr_type values for x/y coordinate searches:

Details about the logic used by the service for x/y coordinate searches are listed below.

NoteNote:

You can also use the category parameter to disambiguate x/y coordinate searches.

Example: Find an ambiguous x/y coordinate pair (18.9919543,47.5283605)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "18.991954 47.528360",
   "location": {
    "x": 18.9919543,
    "y": 47.528360499999998
   },
   "score": 100,
   "attributes": {
    "Addr_type": "LatLong"
   },
   "extent": {
    "xmin": 18.990954299999999,
    "ymin": 47.5273605,
    "xmax": 18.992954300000001,
    "ymax": 47.529360499999996
   }
  },
  {
   "address": "X:18.991954 Y:47.528360",
   "location": {
    "x": 18.9919543,
    "y": 47.528360499999998
   },
   "score": 100,
   "attributes": {
    "Addr_type": "XY"
   },
   "extent": {
    "xmin": 18.990954299999999,
    "ymin": 47.5273605,
    "xmax": 18.992954300000001,
    "ymax": 47.529360499999996
   }
  },
  {
   "address": "Y:18.991954 X:47.528360",
   "location": {
    "x": 47.528360499999998,
    "y": 18.9919543
   },
   "score": 100,
   "attributes": {
    "Addr_type": "YX"
   },
   "extent": {
    "xmin": 47.5273605,
    "ymin": 18.990954299999999,
    "xmax": 47.529360499999996,
    "ymax": 18.992954300000001
   }
  }
 ]
}

Example: Find an explicit latitude / longitude coordinate pair (Y:47.5283605 X:18.9919543)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Y:47.528360 X:18.991954",
   "location": {
    "x": 18.9919543,
    "y": 47.528360499999998
   },
   "score": 100,
   "attributes": {
    "Addr_type": "YX"
   },
   "extent": {
    "xmin": 18.990954299999999,
    "ymin": 47.5273605,
    "xmax": 18.992954300000001,
    "ymax": 47.529360499999996
   }
  }
 ]
}

Example: Find an implicit longitude / latitude coordinate pair (151.214776,-33.856716)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "151.214776 -33.856716",
   "location": {
    "x": 151.214776,
    "y": -33.856715999999999
   },
   "score": 100,
   "attributes": {
    "Addr_type": "LatLong"
   },
   "extent": {
    "xmin": 151.213776,
    "ymin": -33.857715999999996,
    "xmax": 151.21577600000001,
    "ymax": -33.855716000000001
   }
  },
  {
   "address": "X:151.214776 Y:-33.856716",
   "location": {
    "x": 151.214776,
    "y": -33.856715999999999
   },
   "score": 100,
   "attributes": {
    "Addr_type": "XY"
   },
   "extent": {
    "xmin": 151.213776,
    "ymin": -33.857715999999996,
    "xmax": 151.21577600000001,
    "ymax": -33.855716000000001
   }
  }
 ]
}

Specify output fields

The findAddressCandidates operation allows you to specify individual output fields or return all output fields. The outFields parameter is used for this. If you want to return all supported output fields, set outFields=*; if you only want to return the default output fields, then outFields does not need to be passed in the request. If you want to return specific fields, pass the desired field names as comma-separated values, such as outFields=PlaceName,Type,City,Country, which returns the name, feature type, city, and country for a POI search.

See Service output for detailed information about the fields returned by a findAddressCandidates request.

Example: Specify individual outfields for a POI search (PlaceName,Type,City,Country)

Single-field request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Gymocha",
   "location": {
    "x": -92.993389999999977,
    "y": 43.677670000000035
   },
   "score": 100,
   "attributes": {
    "PlaceName": "Gymocha",
    "Type": "Coffee Shop",
    "City": "Austin",
    "Country": "USA"
   },
   "extent": {
    "xmin": -92.998389999999972,
    "ymin": 43.672670000000032,
    "xmax": -92.988389999999981,
    "ymax": 43.682670000000037
   }
  },

Specify the output spatial reference

By default, the World Geocoding Service returns candidate geometry in WGS84 coordinates (decimal degrees). You can specify a different spatial reference for output coordinates by using the outSR parameter. This is necessary if you have a mapping application in which you display geocoding candidates and the map spatial reference is not WGS84. For example, the ArcGIS.com basemaps use a Web Mercator spatial reference, with coordinates in meters. In order to display geocoding candidates correctly in such a map you would need to set outSR=102100, which is the well-known ID (WKID) of the Web Mercator spatial reference.

For a list of valid WKID values, see Projected Coordinate Systems and Geographic Coordinate Systems.

Example: Specify output coordinates in Web Mercator spatial reference (380 new york st redlands ca)

Single-field request URL

Multifield request URL:

JSON response

{
 "spatialReference": {
  "wkid": 102100,
  "latestWkid": 3857
 },
 "candidates": [
  {
   "address": "380 New York St, Redlands, California, 92373",
   "location": {
    "x": -13046162.342933612,
    "y": 4036389.5247833105
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -13046233.941668853,
    "ymin": 4036204.0865814835,
    "xmax": -13046011.302687265,
    "ymax": 4036472.8153481646
   }
  },

Specify the maximum number of candidates

The maxLocations parameter allows you to specify the maximum number of candidates to be returned by a search, up to the maximum number of candidates allowed by the World Geocoding Service. By default, the service allows up to 50 candidates to be returned for searches. As an example, if you set maxLocations=10, findAddressCandidates will return the top 10 candidates for the search. If no value is specified for maxLocations, findAddressCandidates returns all matching candidates.

Example: Specify the maximum number of candidates for a POI search (Starbucks in Paris)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Starbucks",
   "location": {
    "x": 2.3408099233943815,
    "y": 48.871880047752278
   },
   "score": 100,
   "attributes": {
    "PlaceName": "Starbucks",
    "City": "Paris",
    "Country": "FRA"
   },
   "extent": {
    "xmin": 2.3357800000000521,
    "ymin": 48.867030000000049,
    "xmax": 2.3457800000000519,
    "ymax": 48.877030000000055
   }
  },
  {
   "address": "Starbucks",
   "location": {
    "x": 2.3346200510704831,
    "y": 48.872780054965659
   },
   "score": 100,
   "attributes": {
    "PlaceName": "Starbucks",
    "City": "Paris",
    "Country": "FRA"
   },
   "extent": {
    "xmin": 2.3296400000000359,
    "ymin": 48.86790000000007,
    "xmax": 2.3396400000000357,
    "ymax": 48.877900000000075
   }
  }
 ]
}

Search within an extent

The findAddressCandidates operation allows spatial filtering of search results by using the searchExtent parameter. If you want to confine a search to a localized area, something that is especially useful in a mobile application, you can define a bounding rectangle to search within. No candidates outside of the rectangle are returned. Bounding rectangle coordinates can be entered as a simple comma-separated string in the format <lower left corner>,<upper right corner>. If the simple format is used, the coordinates must be in the default spatial reference of the geocode service, which is WGS84. The searchExtent parameter can be used with all supported search types (street address, POI, admin place, postal code).

The example URL below illustrates how to find McDonald's in downtown San Diego using the searchExtent format.

Example: Find POIs using searchExtent with default spatial reference (McDonald's)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "McDonald's",
   "location": {
    "x": -117.15385999999995,
    "y": 32.71864000000005
   },
   "score": 100,
   "attributes": {
    "City": "San Diego",
    "Type": "Burgers"
   },
   "extent": {
    "xmin": -117.15885999999995,
    "ymin": 32.713640000000048,
    "xmax": -117.14885999999996,
    "ymax": 32.723640000000053
   }
  }
 ]
}

You can specify a spatial reference for the searchExtent, which is necessary if your map uses a different spatial reference than the geocode service. For example, the default ArcGIS.com basemaps utilize a Web Mercator spatial reference (WKID = 102100), with coordinates in meters. The searchExtent must be passed as a JSON envelope object if the coordinates are in a spatial reference other than WGS84. The following request URL uses the previous example of McDonald's in downtown San Diego, but specifies the bounding rectangle with Web Mercator coordinates.

NoteNote:

Note that, in this example, the outSR property is set to 102100, so the output coordinates are also in Web Mercator coordinates. If outSR was left blank, the coordinates would be returned in the WGS84 spatial reference.

For a list of supported spatial references and their WKID values, see Projected Coordinate Systems and Geographic Coordinate Systems.

Example: Find POIs using searchExtent with Web Mercator spatial reference (McDonald's)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 102100,
  "latestWkid": 3857
 },
 "candidates": [
  {
   "address": "McDonald's",
   "location": {
    "x": -13041508.039666457,
    "y": 3858017.4017375661
   },
   "score": 100,
   "attributes": {
    "City": "San Diego",
    "Type": ""
   },
   "extent": {
    "xmin": -13042064.637120422,
    "ymin": 3857355.8556649638,
    "xmax": -13040951.44221249,
    "ymax": 3858678.9849002399
   }
  }
 ]
}

Requests that include searchExtent can also include zone information (that is, city, state, and country). If the extent defined for searchExtent is large enough to encompass multiple cities, it may be necessary to include the city name in the search to achieve optimal results. For example, if the searchExtent covers the Dallas-Fort Worth metropolitan region, and you search for Starbucks, there could be matches returned in Dallas or Fort Worth or any of their suburbs. If you specifically want to find Starbucks in Garland, for example, this needs to be specified in the search.

Example: Find POIs using searchExtent and zone (Starbucks garland)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Starbucks",
   "location": {
    "x": -96.616279999999961,
    "y": 32.956760000000031
   },
   "score": 100,
   "attributes": {
    "Type": "Coffee Shop",
    "City": "Garland",
    "Region": "Texas"
   },
   "extent": {
    "xmin": -96.621279999999956,
    "ymin": 32.951760000000029,
    "xmax": -96.611279999999965,
    "ymax": 32.961760000000034
   }
  },

You can also search for street addresses within an extent. When the searchExtent parameter is defined for an address search, city and postal code can be omitted from the search and valid matches can still be found. However, if the searchExtent is large, it is possible for a street address to occur multiple times within the extent, and it may be necessary to refine the search by including city, state, postal code, or other distinguishing information. Additionally, if the search includes a city or postal code that is outside the searchExtent, no matches will be returned. See the following example, which illustrates finding a street address using searchExtent.

Example: Find a street address using searchExtent (380 New York St)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "380 New York St, Redlands, California, 92373",
   "location": {
    "x": -117.1956703176181,
    "y": 34.056488119308924
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -117.1963135,
    "ymin": 34.055108000000011,
    "xmax": -117.19431349999999,
    "ymax": 34.057108000000007
   }
  },
  {
   "address": "380 New York St, Redlands, California, 92373",
   "location": {
    "x": -117.19563406395716,
    "y": 34.055519563957162
   },

Proximity searches

Geocoding results are typically sorted according to their relevance to the search and their relative importance. However, with some applications, especially mobile apps, users are more concerned with finding features closest to their current location. For this reason, the findAddressCandidates operation supports prioritization of candidates based on their distance from a specified point. By passing in the location parameter, you can define an area of influence for your searches. The location value represents the center point of the area, which spans a radius of 50,000 meters. Features closest to the input location show up higher in the list of candidates. Results that are within the area of influence area receive a greater boost than those outside the area.

It is important to note that proximity search does not filter results that are further than 50,000 meters from the input location—it is intended to influence the sort order of results so the most locationally relevant candidates are returned first. For instance, if your location is in Las Vegas, and you search for Golden Nugget, the first candidate is Golden Nugget in Las Vegas. The second is Golden Nugget in Biloxi, Mississippi. So even though Golden Nugget in Biloxi is much farther away than the 50,000 meters, it is still returned because it is the second most relevant (closest) candidate. In general, the number of candidates returned by a proximity search is only limited by the maxLocations parameter.

Example: Find a place-name using a proximity search (Golden Nugget)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Golden Nugget",
   "location": {
    "x": -115.14432004053886,
    "y": 36.170799948352681
   },
   "score": 100,
   "attributes": {
    "City": "Las Vegas",
    "Region": "Nevada",
    "Country": "USA"
   },
   "extent": {
    "xmin": -115.14949999999999,
    "ymin": 36.165550000000046,
    "xmax": -115.1395,
    "ymax": 36.175550000000051
   }
  },
  {
   "address": "Golden Nugget",
   "location": {
    "x": -88.860470036643719,
    "y": 30.392299937100887
   },
   "score": 100,
   "attributes": {
    "City": "Biloxi",
    "Region": "Mississippi",
    "Country": "USA"
   },
   "extent": {
    "xmin": -88.865549999999985,
    "ymin": 30.385470000000051,
    "xmax": -88.855549999999994,
    "ymax": 30.395470000000049
   }
  },

If you only want to return candidates within a specific area, and sort the candidates according to their proximity to a location, then you need to define a search extent by passing the searchExtent parameter in the request along with the location parameter. Consider the Golden Nugget example again. If your location is in Las Vegas and you want to confine your search results to places named Golden Nugget that are within the map extent, you would need to construct a request with the following parameters:

The request URL would be similar to the one below. See Searching within an extent for more information about the searchExtent parameter.

Example: Find a place-name using both proximity and searchExtent (Golden Nugget)

Single-field request URL

Multifield request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "Golden Nugget",
   "location": {
    "x": -115.14432004053886,
    "y": 36.170799948352681
   },
   "score": 100,
   "attributes": {
    "City": "Las Vegas",
    "Region": "Nevada",
    "Country": "USA"
   },
   "extent": {
    "xmin": -115.14949999999999,
    "ymin": 36.165550000000046,
    "xmax": -115.1395,
    "ymax": 36.175550000000051
   }
  },

Category filtering

The findAddressCandidates operation supports filtering searches by category values, which represent address and place types. By including the category parameter in a findAddressCandidates request, you can avoid false positive matches to unexpected place and address types due to ambiguous searches.

NoteNote:

The category parameter is only functional when used with the singleLine parameter. It does not work with the multifield parameters, specifically, the address, neighborhood, city, region, subregion, countryCode, and postal parameters.

For example, a user may search for June, expecting the service to match to June Mountain ski resort. However, there are many places in the world named June, so the search returns several cities named June.

Example: Search for June without a category

Request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "June, Missouri",
   "location": {
    "x": -94.36021999999997,
    "y": 36.801180000000045
   },
   "score": 100,
   "attributes": {
    "PlaceName": "June",
    "Type": "City",
    "Place_addr": "June, Missouri",
    "City": "June",
    "Region": "Missouri"
   },
   "extent": {
    "xmin": -94.380219999999966,
    "ymin": 36.781180000000042,
    "xmax": -94.340219999999974,
    "ymax": 36.821180000000048
   }
  },
  {
   "address": "June",
   "location": {
    "x": 8.616670000000056,
    "y": 7.366670000000056
   },
   "score": 100,
   "attributes": {
    "PlaceName": "June",
    "Type": "City",
    "Place_addr": "",
    "City": "June",
    "Region": ""
   },
   "extent": {
    "xmin": 8.6066700000000562,
    "ymin": 7.3566700000000562,
    "xmax": 8.6266700000000558,
    "ymax": 7.3766700000000558
   }
  },

The solution for this case is to pass the category parameter in the request. By including category=Ski Resort in the request, all places that are not ski resorts are bypassed by the search, and only ski resorts whose names begin with June are returned.

Example: Search for June with category=Ski Resort

Request URL

JSON response

{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "June Mountain",
   "location": {
    "x": -119.08940999999999,
    "y": 37.770690000000059
   },
   "score": 85.670000000000002,
   "attributes": {
    "PlaceName": "June Mountain",
    "Type": "Ski Resort",
    "Place_addr": "3819 CA-158, June Lake, California, 93529",
    "City": "June Lake",
    "Region": "California"
   },
   "extent": {
    "xmin": -119.09440999999998,
    "ymin": 37.765690000000056,
    "xmax": -119.08440999999999,
    "ymax": 37.775690000000061
   }
  }
 ]
}

See Category filtering for complete details.

Using the langCode parameter

In some countries multiple languages are spoken, and an address may be available in different languages. You may want to search for an address in one language but return it in another. The langCode parameter is useful in this case. For instance, you may have an address in Israel that is in the Hebrew language and you want to geocode it and return the address in English.

Example: Search for Hebrew address הרימון 4, רמת גן and return it in English

Single-field request URL

Multifield request URL

JSON response

{
{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "HaRimon 4, Ramat Gan",
   "location": {
    "x": 34.808883102833384,
    "y": 32.087871429915204
   },
   "score": 100,
   "attributes": {
    "LangCode": "ENG",
    "Addr_type": "PointAddress"
   },
   "extent": {
    "xmin": 34.807908500000003,
    "ymin": 32.086826000000009,
    "xmax": 34.809908499999999,
    "ymax": 32.088826000000005
   }
  }
 ]
}
7/27/2017