FullTextSearch
GEThttps://api.uber.com/maps/beta/fulltextsearch¶ Use Case
The FullTextSearch endpoint returns location suggestions based on a string. FullTextSearch differs from Autocomplete in that it works best with longer strings or complete addresses.
The locations returned from FullTextSearch contain an ID, that can be used to call the Details endpoint to hydrate additional information such as coordinates, address components, and other location information. By comparison, Full Text Search returns a location name and address but not necessarily a coordinate or address components.
¶ Authorization
OAuth 2.0 Bearer token with the maps-apis scope.
¶ Request Parameters
| Name | Type | Description | Required? |
|---|---|---|---|
query |
string | The partial or complete text string used to generate location suggestions. For example, the string “san fran” or “sfo”. | Yes |
locale |
string | The preferred language of the suggestions. For example, the string “en-US”. This should follow the BCP47 standards. | No |
latitude |
double | The point around which to generate location suggestions expressed as a latitude and longitude. | No |
longitude |
double | The point around which to generate location suggestions expressed as a latitude and longitude. | No |
num_results |
int | The number of suggestions to return. By default, a single result will be returned. | No |
¶ Notes on latitude, longitude
This parameter geobiases the request to a specific area which instructs the search to prefer locations within a certain distance of the coordinate. This can greatly improve the quality of the suggestions provided. However, suggestions outside of this defined area may still be returned.
¶ Example Request
curl -X GET \
-H "authorization: Bearer $UBER_TOKEN" \
-H 'content-type: application/json' \
https://$api_url/maps/beta/fulltextsearch?locale=en&query=The%20Empire%20State%20Building&country_code=US&latitude=40.74864369921407&longitude=-73.9859648073998&num_results=5 | jq .
¶ Response body parameters
| Name | Type | Description | Required? |
|---|---|---|---|
entities[i].id |
string | The unique identifier for the suggested location | Yes |
addresses[i].location |
object | The location data for the place | Yes |
addresses[i].location.name |
string | The name of the suggested location | No |
addresses[i].location.address |
string | The full address for the suggested location | Yes |
addresses[i].location.locale |
string | The locale used for the response | Yes |
addresses[i].location.categories |
string | The list of categories the place belong to (i.e. Restaurant) | No |
addresses[i].location.distanceMeters |
long | The distance, in meters from the input location, if one was supplied | No |
For an overview of available categories, refer to Categories
Status-code: 200 OK
{
"entities": [
{
"id": "u01:04:here:pds:place:840dr5ru-f494d331f0204d89bef762a8fdc04049",
"location": {
"name": "Empire State Building",
"address": "20 W 34th St, New York, NY, US",
"locale": "en",
"categories": [
"LANDMARK",
"HISTORIC_SITE",
"ATTRACTION",
"AREAS_AND_BUILDINGS",
"place"
]
}
},
{
"id": "u01:04:here:pds:place:840dr5ru-6aedd61bf91f5008e1d658b2cec323a1",
"location": {
"name": "Empire State Building",
"address": "350 5th Ave, New York, NY, US",
"locale": "en",
"categories": [
"REAL_ESTATE",
"LANDMARK",
"ATTRACTION",
"ELECTRONICS",
"BUILDING_AND_CONSTRUCTION",
"ENTERTAINMENT_AND_RECREATION_SERVICES",
"COMMERCIAL_SERVICES",
"SHOPS_AND_SERVICES",
"AREAS_AND_BUILDINGS",
"place"
]
}
},
{
"id": "u01:04:here:pds:place:840dr5ru-f0f2b28f6573419222d62d3fd95454b0",
"location": {
"name": "Esb Official Gift Store (Empire State Building Official Store)",
"address": "20 W 34th St, New York, NY, US",
"locale": "en",
"categories": [
"SHOPS_AND_SERVICES",
"place"
]
}
},
{
"id": "u01:04:here:pds:place:840dr5ru-b75da6f6679745788fb5d9d4b0fdfb9c",
"location": {
"name": "Empire State Realty Trust (Empire State Building Associates)",
"address": "111 W 33rd St, New York, NY, US",
"locale": "en",
"categories": [
"REAL_ESTATE",
"INSURANCE",
"COMMERCIAL_SERVICES",
"SHOPS_AND_SERVICES",
"BANKING_AND_FINANCE",
"place"
]
}
},
{
"id": "u01:04:here:pds:place:840dr5ru-412762f8b4998918aa4cc21bf3d24a76",
"location": {
"name": "Hotel and the City, Empire State Building",
"address": "38 W 31st St, New York, NY, US",
"locale": "en",
"categories": [
"LODGING",
"HOTEL",
"TRAVEL_AND_TRANSPORTATION",
"place"
]
}
}
]
}