REST API Example
Street Address Example with Multiple Field Support
This example illustrates a REST API request and JSON response using multiple fields to return candidates.
See REST API Features for a description of all the options than can be controlled through the API.
When you choose a candidate, the address can be placed on a map.
The following example illustrates a request for candidates using multiline support. It begins with a partial address (Data.AddressLine1=Jordan). The response included candidates from all over the US.
http://localhost:8080/rest/GeoComplete/results.json?Data.AddressLine1=jordan&Data.Country=USA&Option.Database=GCM
By adding Data.PostalCode=12180 to the request the returned candidates are more targeted.
http://localhost:8080/rest/GeoComplete/results.json?Data.AddressLine1=jordan&Data.Country=USA&Option.Database=GCM&Data.PostalCode=12180
{
"output_port" : [ {
"AddressLine1" : "Jordan Rd",
"City" : "Troy",
"Country" : "USA",
"LastLine" : "Troy, NY 12180",
"Latitude" : "42.679065",
"Longitude" : "-73.692485",
"PostalCode" : "12180",
"StateProvince" : "NY",
"Type" : "2",
"Distance" : "-0.0",
"DistanceUnit" : "KILOMETERS",
"FormattedString" : "Jordan Rd, Troy, NY 12180",
"IsUserDictionary" : "false",
"featureID" : "368400000856999",
"StreetNameMatch" : "true",
"user_fields" : [ ]
}, {
"AddressLine1" : "Jordan Point Dr",
"City" : "Troy",
"Country" : "USA",
"LastLine" : "Troy, NY 12180",
"Latitude" : "42.676154999999994",
"Longitude" : "-73.688185",
"PostalCode" : "12180",
"StateProvince" : "NY",
"Type" : "2",
"Distance" : "-0.0",
"DistanceUnit" : "KILOMETERS",
"FormattedString" : "Jordan Point Dr, Troy, NY 12180",
"IsUserDictionary" : "false",
"featureID" : "368400001448931",
"StreetNameMatch" : "true",
"user_fields" : [ ]
} ]
}