Suggest

Character-by-character autocomplete address suggestions

Suggest - suggest

The suggest method allows you to request a list of valid addresses for a partial input text. An input 'text' parameter is required. You can limit the number of suggestions by using the 'maxSuggestions' parameter.


Helpful Documentation Links


Contents


Request URL

GET/POST https://locatenyc.io/arcgis/rest/services/locateNYC/v1/GeocodeServer/suggest


Parameters

Required Parameters

token

(string) JSON web token (JWT). An encoded token used to authenticate the user. Can be obtained by making a request to the /tokens/generateToken operation.



text

(string) The input text provided by a user that is used by the suggest operation to generate a list of possible matches. This is a required parameter.

Example:

text=231 East 10


Optional Parameters

maxSuggestions

(string) The maximum number of suggestions returned by a suggest operation, up to the maximum number allowed by the service.

Example:

maxSuggestions=3


callback

(string) Callback parameter. Produces padded JSON response. Used by Esri APIs/SDKs. Only use this if you really know what your doing.



f

(string) Requested format of the response. Only accepts 'json', and the default value is 'json'.




suggest Details

GET/POST https://locatenyc.io/arcgis/rest/services/locateNYC/v1/GeocodeServer/suggest


The suggest operation response parameters are returned as a list of possible matches in the "suggestions" key. Each list item will have the possible match address contained in the "text" key. These addresses can be used as input in the /findAddressCandidates operation.

It is important to note that, for the time being, the suggestions only work with addresses. In the future, the LocateNYC team will be adding support for intersections, tax lots, buildings, places, and more.

Basic Suggest

Example: Basic suggest

 Request




 Response

{
  "suggestions": [
    {
      "text": "231 EAST 10 STREET MANHATTAN, NY 10003",
      "magicKey": "dHA9MCNsb2M9ODMyNjQyMSNsbmc9MzMjbGJzPTEwOTo5NzU5MDUz",
      "isCollection": false
    },
    {
      "text": "231 EAST 104 STREET MANHATTAN, NY 10029",
      "magicKey": "dHA9MCNsb2M9ODMyNjQyMSNsbmc9MzMjbGJzPTEwOTo5NzU5MDUz",
      "isCollection": false
    },
    {
      "text": "231 EAST 105 STREET MANHATTAN, NY 10029",
      "magicKey": "dHA9MCNsb2M9ODMyNjQyMSNsbmc9MzMjbGJzPTEwOTo5NzU5MDUz",
      "isCollection": false
    },
    {
      "text": "231 EAST 106 STREET MANHATTAN, NY 10029",
      "magicKey": "dHA9MCNsb2M9ODMyNjQyMSNsbmc9MzMjbGJzPTEwOTo5NzU5MDUz",
      "isCollection": false
    },
    {
      "text": "231 EAST TENTH STREET MANHATTAN, NY 10003",
      "magicKey": "dHA9MCNsb2M9ODMyNjQyMSNsbmc9MzMjbGJzPTEwOTo5NzU5MDUz",
      "isCollection": false
    }
  ]
}

 Esri Search Widget Implementation


Response Parameters

Below is a list of response parameters that may be returned in the response for the suggest operation function in LocateNYC.




text
Parameter Name: text
Geosupport Parameter Name:
Geosupport Functions:
Field Length:
Field Format: Character
Field Status: Active
Description: The suggested matching address for the suggest operation




magicKey
Parameter Name: magicKey
Geosupport Parameter Name:
Geosupport Functions:
Field Length:
Field Format: Character
Field Status: Active
Description: This parameter is currently used as placeholder to support Esri compatability. It is unsupported in the LocateNYC findAddressCandidates operation, so its best to just ignore this (for now).




isCollection
Parameter Name: isCollection
Geosupport Parameter Name:
Geosupport Functions:
Field Length:
Field Format: Character
Field Status: Active
Description: This parameter is currently used as placeholder to support Esri compatability. It will always be false, so its best to just ignore this (for now).