google_find_place {googleway} | R Documentation |
Google Find Place
Description
A Find Place request takes a text input, and returns a place. The text input can be any kind of Places data, for example, a name, address, or phone number
Usage
google_find_place(
input,
inputtype = c("textquery", "phonenumber"),
language = NULL,
fields = place_fields(),
point = NULL,
circle = NULL,
rectangle = NULL,
simplify = TRUE,
curl_proxy = NULL,
key = get_api_key("find_place")
)
Arguments
input |
The text input specifying which place to search for (for example, a name, address, or phone number). |
inputtype |
The type of input. This can be one of either textquery or phonenumber. Phone numbers must be in international format (prefixed by a plus sign ("+"), followed by the country code, then the phone number itself). |
language |
|
fields |
vector of place data types to return. All Basic fields are returned by default. See details |
point |
vector of lat & lon values. Prefer results near this point. |
circle |
list of two elements, point (vector of lat & lon) and radius. Prefer results in this circle. Ignored if point is supplied |
rectangle |
list of two elements, sw (vector of lat & lon) and ne (vector of lat & lon) specifying the south-west and north-east bounds of a rectangle. Prefer results in this rectangle. Ignored if either point or circle are supplied |
simplify |
|
curl_proxy |
a curl proxy object |
key |
|
Details
Fields correspond to place search results https://developers.google.com/maps/documentation/places/web-service/search and are divided into three billing categories: Basic, Contact and Atmosphere.
Basic fields are billed at base rate, and incur no additional charges. Contact and atmosphere fields are billed at a hihger rate. See pricing sheet for more information https://mapsplatform.google.com/pricing/
Basic - formatted_address, geometry, icon, id, name, permanently_closed, photos, place_id, plus_code, types
Contact - opening_hours
Atmosphere - price_level, rating
See Also
google_place_details google_places
Examples
## specifying fields
set_key( "your_api_key" )
google_find_place(
input = "Museum of Contemporary Art Australia"
, fields = c("photos","formatted_address","name","rating","opening_hours","geometry")
)
## Using location bias - circle
google_find_place(
input = "Mongolian Grill"
, circle = list(point = c(47.7, -122.2), radius = 2000)
)
## finding by a phone number
google_find_place(
input = "+61293744000"
, inputtype = "phonenumber"
)