Place class
google.maps.places.Place
class
implements PlaceOptions
const {Place} = await google.maps.importLibrary("places");
Constructor | |
|---|---|
Place |
Place(options)Parameters:
|
Static Methods | |
|---|---|
searchByText |
searchByText(request)Parameters:
Text query based place search. |
searchNearby |
searchNearby(request)Parameters:
Search for nearby places. |
Properties | |
|---|---|
accessibilityOptions
readonly |
Type:
AccessibilityOptions optionalAccessibility options of this Place. undefined if the accessibility options data have not been called for from the server. |
addressComponents
readonly |
Type:
Array<AddressComponent> optionalThe collection of address components for this Place’s location. Empty object if there is no known address data. undefined if the address data has not been called for from the server. |
adrFormatAddress
readonly |
Type:
string optionalThe representation of the Place’s address in the adr microformat. |
allowsDogs
readonly |
Type:
boolean optional |
attributions
readonly |
Type:
Array<Attribution> optionalData providers that must be shown for the Place. |
businessStatus
readonly |
Type:
BusinessStatus optionalThe location's operational status. null if there is no known status. undefined if the status data has not been loaded from the server. |
consumerAlert
readonly |
Type:
ConsumerAlert optionalThe consumer alert for this place. |
currentOpeningHours
readonly |
Type:
OpeningHours optionalThe hours of operation for the next seven days (including today). This includes exceptional hours like holidays and irregular closures. |
currentSecondaryOpeningHours
readonly |
Type:
Array<SecondaryOpeningHours> optionalThe current secondary hours of this place which includes exceptional hours like holidays and irregular closures for the next seven days. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. |
displayName
readonly |
Type:
string optionalThe location's display name. null if there is no name. undefined if the name data has not been loaded from the server. |
displayNameLanguageCode
readonly |
Type:
string optionalThe language of the location's display name. null if there is no name. undefined if the name data has not been loaded from the server. |
editorialSummary
readonly |
Type:
string optionalThe editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. |
editorialSummaryLanguageCode
readonly |
Type:
string optionalThe language of the editorial summary for this place. null if there is no editorial summary. undefined if this field has not yet been requested. |
evChargeAmenitySummary
readonly |
Type:
EVChargeAmenitySummary optionalThe EVChargeAmenitySummary for this place. |
evChargeOptions
readonly |
Type:
EVChargeOptions optionalEV Charge options provided by the place. undefined if the EV charge options have not been called for from the server. |
formattedAddress
readonly |
Type:
string optionalThe location’s full address. |
fuelOptions
readonly |
Type:
FuelOptions optionalFuel options provided by the place. undefined if the fuel options have not been called for from the server. |
generativeSummary
readonly |
Type:
GenerativeSummary optionalThe GenerativeSummary for this place. |
googleMapsLinks
readonly |
Type:
GoogleMapsLinks optionalLinks to trigger different Google Maps actions. |
googleMapsURI
readonly |
Type:
string optionalURL of the official Google page for this place. This is the Google-owned page that contains the best available information about the Place. |
hasCurbsidePickup
readonly |
Type:
boolean optionalWhether a place has curbside pickup. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
hasDelivery
readonly |
Type:
boolean optionalWhether a place has delivery. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
hasDineIn
readonly |
Type:
boolean optionalWhether a place has dine in. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
hasLiveMusic
readonly |
Type:
boolean optional |
hasMenuForChildren
readonly |
Type:
boolean optional |
hasOutdoorSeating
readonly |
Type:
boolean optional |
hasRestroom
readonly |
Type:
boolean optional |
hasTakeout
readonly |
Type:
boolean optionalWhether a place has takeout. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
iconBackgroundColor
readonly |
Type:
string optionalThe default HEX color code for the place's category. |
id |
Type:
stringThe unique place id. |
internationalPhoneNumber
readonly |
Type:
string optionalThe Place’s phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. |
isGoodForChildren
readonly |
Type:
boolean optional |
isGoodForGroups
readonly |
Type:
boolean optional |
isGoodForWatchingSports
readonly |
Type:
boolean optional |
isReservable
readonly |
Type:
boolean optionalWhether a place is reservable. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
location
readonly |
Type:
LatLng optionalThe Place’s position. |
nationalPhoneNumber
readonly |
Type:
string optionalThe Place’s phone number, formatted according to the number's regional convention. |
neighborhoodSummary
readonly |
Type:
NeighborhoodSummary optionalThe NeighborhoodSummary for this place. |
parkingOptions
readonly |
Type:
ParkingOptions optionalOptions of parking provided by the place. undefined if the parking options data have not been called for from the server. |
paymentOptions
readonly |
Type:
PaymentOptions optionalPayment options provided by the place. undefined if the payment options data have not been called for from the server. |
photos
readonly |
Photos of this Place. The collection will contain up to ten Photo objects. |
plusCode
readonly |
Type:
PlusCode optional |
postalAddress
readonly |
Type:
PostalAddress optional |
priceLevel
readonly |
Type:
PriceLevel optionalThe price level of the Place. This property can return any of the following values
|
priceRange
readonly |
Type:
PriceRange optionalThe price range for this Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100"). |
primaryType
readonly |
Type:
string optionalThe location's primary type. null if there is no type. undefined if the type data has not been loaded from the server. |
primaryTypeDisplayName
readonly |
Type:
string optionalThe location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. |
primaryTypeDisplayNameLanguageCode
readonly |
Type:
string optionalThe language of the location's primary type display name. null if there is no type. undefined if the type data has not been loaded from the server. |
rating
readonly |
Type:
number optionalA rating, between 1.0 to 5.0, based on user reviews of this Place. |
regularOpeningHours
readonly |
Type:
OpeningHours optionalThe regular hours of operation for this place. This does not include exceptional hours like holidays. |
regularSecondaryOpeningHours
readonly |
Type:
Array<SecondaryOpeningHours> optionalThe regular secondary hours of this place which excludes exceptional hours like holidays and irregular closures. Secondary hours are different from a place's main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. |
requestedLanguage |
Type:
string optionalThe requested language for this place. |
requestedRegion |
Type:
string optionalThe requested region for this place. |
resourceName |
Type:
stringThe unique place resource name. |
reviews
readonly |
A list of reviews for this Place. |
reviewSummary
readonly |
Type:
ReviewSummary optionalThe ReviewSummary for this place. |
servesBeer
readonly |
Type:
boolean optionalWhether a place serves beer. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesBreakfast
readonly |
Type:
boolean optionalWhether a place serves breakfast. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesBrunch
readonly |
Type:
boolean optionalWhether a place serves brunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesCocktails
readonly |
Type:
boolean optional |
servesCoffee
readonly |
Type:
boolean optional |
servesDessert
readonly |
Type:
boolean optional |
servesDinner
readonly |
Type:
boolean optionalWhether a place serves dinner. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesLunch
readonly |
Type:
boolean optionalWhether a place serves lunch. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesVegetarianFood
readonly |
Type:
boolean optionalWhether a place serves vegetarian food. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
servesWine
readonly |
Type:
boolean optionalWhether a place serves wine. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. Returns 'undefined' if this field has not yet been requested. |
shortFormattedAddress
readonly |
Type:
string optionalThe location’s short address. |
subDestinations
readonly |
The list of sub-destinations for this place. Sub-destinations are specific places associated with a main place. These provide more specific destinations for users who are searching within a large or complex place, like an airport, national park, university, or stadium. |
svgIconMaskURI
readonly |
Type:
string optionalURI to the svg image mask resource that can be used to represent a place’s category. |
types
readonly |
Type:
Array<string> optionalAn array of types for this Place (for example, ["political", "locality"] or ["restaurant", "establishment"]). |
userRatingCount
readonly |
Type:
number optionalThe number of user ratings which contributed to this Place’s Place.rating. |
utcOffsetMinutes
readonly |
Type:
number optionalThe offset from UTC of the Place’s current timezone, in minutes. For example, Austrialian Eastern Standard Time (GMT+10) in daylight savings is 11 hours ahead of UTC, so the utc_offset_minutes will be 660. For timezones behind UTC, the offset is negative. For example, the utc_offset_minutes is -60 for Cape Verde. |
viewport
readonly |
Type:
LatLngBounds optionalThe preferred viewport when displaying this Place on a map. |
websiteURI
readonly |
Type:
string optionalThe authoritative website for this Place, such as a business' homepage. |
readonly |
Type:
OpeningHours optional |
readonly |
Type:
boolean optional |
Methods | |
|---|---|
fetchFields |
fetchFields(options)Parameters:
|
|
getNextOpeningTime([date])Parameters:
Calculates the Date for the next opening time using the Place's Place.regularOpeningHours. Returns undefined if the data is insufficient to calculate the result, or this place is not operational. |
|
isOpen([date])Parameters:
Return Value:
Promise<boolean optional>Check if the place is open at the given Date. Resolves with undefined if the known data for the location is insufficient to calculate this, e.g. if the opening hours are unregistered. |
Inherited:
toJSON
| |
PlaceOptions interface
google.maps.places.PlaceOptions
interface
Options for constructing a Place.
Properties | |
|---|---|
id
optional |
Type:
string optionalThe unique place id. |
requestedLanguage
optional |
Type:
string optionalA language identifier for the language in which details should be returned. See the list of supported languages. |
requestedRegion
optional |
Type:
string optionalA region code of the user's region. This can affect which photos may be returned, and possibly other things. The region code accepts a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions. For example, the United Kingdom's ccTLD is "uk" ( .co.uk) while its ISO 3166-1 code is "gb" (technically for the entity of "The United Kingdom of Great Britain and Northern Ireland"). |
resourceName
optional |
Type:
string optionalThe unique place resource name. |
AccessibilityOptions class
google.maps.places.AccessibilityOptions
class
const {AccessibilityOptions} = await google.maps.importLibrary("places");
Properties | |
|---|---|
hasWheelchairAccessibleEntrance
readonly |
Type:
boolean optionalWhether a place has a wheelchair accessible entrance. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasWheelchairAccessibleParking
readonly |
Type:
boolean optionalWhether a place has wheelchair accessible parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasWheelchairAccessibleRestroom
readonly |
Type:
boolean optionalWhether a place has a wheelchair accessible restroom. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasWheelchairAccessibleSeating
readonly |
Type:
boolean optionalWhether a place offers wheelchair accessible seating. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
AddressComponent class
google.maps.places.AddressComponent
class
Address component for the Place's location.
const {AddressComponent} = await google.maps.importLibrary("places");
Properties | |
|---|---|
longText
readonly |
Type:
string optionalThe full text of the address component. |
shortText
readonly |
Type:
string optionalThe abbreviated, short text of the given address component. |
types
readonly |
Type:
Array<string>An array of strings denoting the type of this address component. A list of valid types can be found here. |
Methods | |
|---|---|
Inherited:
toJSON
|
Attribution class
google.maps.places.Attribution
class
Information about a data provider for a Place.
const {Attribution} = await google.maps.importLibrary("places");
Properties | |
|---|---|
provider
readonly |
Type:
string optionalName of the Place's data provider. |
providerURI
readonly |
Type:
string optionalURI to the Place's data provider. |
Methods | |
|---|---|
Inherited:
toJSON
|
AuthorAttribution class
google.maps.places.AuthorAttribution
class
Information about the author of user-generated content.
const {AuthorAttribution} = await google.maps.importLibrary("places");
Properties | |
|---|---|
displayName
readonly |
Type:
stringAuthor's name for this result. |
photoURI
readonly |
Type:
string optionalAuthor's photo URI for this result. This may not always be available. |
uri
readonly |
Type:
string optionalAuthor's profile URI for this result. |
Methods | |
|---|---|
Inherited:
toJSON
|
ConnectorAggregation class
google.maps.places.ConnectorAggregation
class
EV charging information, aggregated for connectors of the same type and the same charge rate.
const {ConnectorAggregation} = await google.maps.importLibrary("places");
Properties | |
|---|---|
availabilityLastUpdateTime
readonly |
Type:
Date optionalThe time when the connector availability information in this aggregation was last updated. |
availableCount
readonly |
Type:
number optionalNumber of connectors in this aggregation that are currently available. |
count
readonly |
Type:
numberNumber of connectors in this aggregation. |
maxChargeRateKw
readonly |
Type:
numberThe static max charging rate in kw of each connector of the aggregation. |
outOfServiceCount
readonly |
Type:
number optionalNumber of connectors in this aggregation that are currently out of service. |
type
readonly |
Type:
EVConnectorType optionalThe connector type of this aggregation. |
ConsumerAlert class
google.maps.places.ConsumerAlert
class
The consumer alert message. All text are rendered in the language specified by the languageCode field.
const {ConsumerAlert} = await google.maps.importLibrary("places");
Properties | |
|---|---|
details
readonly |
Type:
ConsumerAlertDetails optionalThe details of the consumer alert message. |
languageCode
readonly |
Type:
string optionalThe language code of the consumer alert message. |
overview
readonly |
Type:
string optionalThe overview of the consumer alert message. |
Methods | |
|---|---|
Inherited:
toJSON
|
ConsumerAlertDetails class
google.maps.places.ConsumerAlertDetails
class
Details of the consumer alert message.
const {ConsumerAlertDetails} = await google.maps.importLibrary("places");
Properties | |
|---|---|
aboutLinkTitle
readonly |
Type:
string optionalThe title to show for a link to provide more information. |
aboutLinkURI
readonly |
Type:
string optionalThe URI for a link to provide more information. |
description
readonly |
Type:
string optionalThe description of the consumer alert message. |
title
readonly |
Type:
string optionalThe title to show together with the detailed description. |
ContentBlock class
google.maps.places.ContentBlock
class
ContentBlock describes the content of a summary and where it came from.
const {ContentBlock} = await google.maps.importLibrary("places");
Properties | |
|---|---|
content
readonly |
Type:
string optionalContent related to the topic. |
contentLanguageCode
readonly |
Type:
string optionalLanguage code of the content. |
referencedPlaces
readonly |
A list of Places referenced. When first retrieved, each Place only contains a place ID in the id field. |
Methods | |
|---|---|
Inherited:
toJSON
|
EVChargeAmenitySummary class
google.maps.places.EVChargeAmenitySummary
class
AI-generated summary of amenities near the EV charging station. This only applies to places with type electric_vehicle_charging_station.
const {EVChargeAmenitySummary} = await google.maps.importLibrary("places");
Properties | |
|---|---|
coffee
readonly |
Type:
ContentBlock optionalA summary of the nearby coffee options. |
disclosureText
readonly |
Type:
string optionalThe text for the disclosure relating to this summary. |
disclosureTextLanguageCode
readonly |
Type:
string optionalThe language code of the disclosure text. |
flagContentURI
readonly |
Type:
string optionalA URI to report a problem with the summary. |
overview
readonly |
Type:
ContentBlock optionalAn overview of the available amenities. |
restaurant
readonly |
Type:
ContentBlock optionalA summary of the nearby restaurants. |
store
readonly |
Type:
ContentBlock optionalA summary of nearby stores. |
Methods | |
|---|---|
Inherited:
toJSON
|
EVChargeOptions class
google.maps.places.EVChargeOptions
class
Information about the EV charging station hosted in the place.
const {EVChargeOptions} = await google.maps.importLibrary("places");
Properties | |
|---|---|
connectorAggregations
readonly |
Type:
Array<ConnectorAggregation>A list of EV charging connector aggregations that contain connectors of the same type and same charge rate. |
connectorCount
readonly |
Type:
numberNumber of connectors at this station. Because some ports can have multiple connectors but only be able to charge one car at a time, the number of connectors may be greater than the total number of cars which can charge simultaneously. |
Methods | |
|---|---|
Inherited:
toJSON
|
EVConnectorType constants
google.maps.places.EVConnectorType
constants
EV charging connector types.
These constants are also usable as strings. In TypeScript, the string literals are defined by the EVConnectorTypeString type.
const {EVConnectorType} = await google.maps.importLibrary("places");
Constants | |
|---|---|
CCS_COMBO_1 |
Combined Charging System (AC and DC). Based on SAE Type-1 J-1772 connector. |
CCS_COMBO_2 |
Combined Charging System (AC and DC). Based on Type-2 Mennekes connector. |
CHADEMO |
CHAdeMO type connector. |
J1772 |
J1772 type 1 connector. |
NACS |
The North American Charging System (NACS), standardized as SAE J3400. |
OTHER |
Other connector types. |
TESLA |
The generic TESLA connector. This is NACS in the North America but can be non-NACS in other parts of the world (e.g. CCS Combo 2 (CCS2) or GB/T). This value is less representative of an actual connector type, and more represents the ability to charge a Tesla brand vehicle at a Tesla owned charging station. |
TYPE_2 |
IEC 62196 type 2 connector. Often referred to as MENNEKES. |
UNSPECIFIED_GB_T |
GB/T type corresponds to the GB/T standard in China. This type covers all GB_T types. |
UNSPECIFIED_WALL_OUTLET |
Unspecified wall outlet. |
EVSearchOptions interface
google.maps.places.EVSearchOptions
interface
EV-related options that can be specified for a place search request.
Properties | |
|---|---|
connectorTypes
optional |
Type:
Array<EVConnectorType> optionalThe list of preferred EV connector types. A place that does not support any of the listed connector types is filtered out. |
minimumChargingRateKw
optional |
Type:
number optionalMinimum required charging rate in kilowatts. A place with a charging rate less than the specified rate is filtered out. |
FetchFieldsRequest interface
google.maps.places.FetchFieldsRequest
interface
Options for fetching Place fields.
Properties | |
|---|---|
fields |
Type:
Array<string>List of fields to be fetched. |
FuelOptions class
google.maps.places.FuelOptions
class
The most recent information about fuel options in a gas station. This information is updated regularly.
const {FuelOptions} = await google.maps.importLibrary("places");
Properties | |
|---|---|
fuelPrices
readonly |
A list of fuel prices for each type of fuel this station has, one entry per fuel type. |
Methods | |
|---|---|
Inherited:
toJSON
|
FuelPrice class
google.maps.places.FuelPrice
class
Fuel price information for a given type of fuel.
const {FuelPrice} = await google.maps.importLibrary("places");
Properties | |
|---|---|
price
readonly |
Type:
Money optionalThe price of the fuel. |
type
readonly |
Type:
FuelType optionalThe type of fuel. |
updateTime
readonly |
Type:
Date optionalThe time the fuel price was last updated. |
FuelType constants
google.maps.places.FuelType
constants
Types of fuel.
These constants are also usable as strings. In TypeScript, the string literals are defined by the FuelTypeString type.
const {FuelType} = await google.maps.importLibrary("places");
Constants | |
|---|---|
BIO_DIESEL |
Bio-diesel. |
DIESEL |
Diesel fuel. |
DIESEL_PLUS |
Diesel plus fuel. |
E100 |
E 100. |
E80 |
E 80. |
E85 |
E 85. |
LPG |
LPG. |
METHANE |
Methane. |
MIDGRADE |
Midgrade. |
PREMIUM |
Premium. |
REGULAR_UNLEADED |
Regular unleaded. |
SP100 |
SP 100. |
SP91 |
SP 91. |
SP91_E10 |
SP 91 E10. |
SP92 |
SP 92. |
SP95 |
SP 95. |
SP95_E10 |
SP95 E10. |
SP98 |
SP 98. |
SP99 |
SP 99. |
TRUCK_DIESEL |
Truck diesel. |
GenerativeSummary class
google.maps.places.GenerativeSummary
class
AI-generated summary of the place.
const {GenerativeSummary} = await google.maps.importLibrary("places");
Properties | |
|---|---|
disclosureText
readonly |
Type:
string optionalThe text for the disclosure relating to this summary. |
disclosureTextLanguageCode
readonly |
Type:
string optionalThe language code of the disclosure text. |
flagContentURI
readonly |
Type:
string optionalA URI to report a problem with the summary. |
overview
readonly |
Type:
string optionalThe overview of the place. |
overviewLanguageCode
readonly |
Type:
string optionalThe language code of the overview. |
Methods | |
|---|---|
Inherited:
toJSON
|
GoogleMapsLinks class
google.maps.places.GoogleMapsLinks
class
Links to trigger different Google Maps actions.
const {GoogleMapsLinks} = await google.maps.importLibrary("places");
Properties | |
|---|---|
directionsURI
readonly |
Type:
string optionalA link to show the directions to the place on Google Maps. The link only populates the destination location and uses the default travel mode DRIVE. |
photosURI
readonly |
Type:
string optionalA link to show the photos for the place on Google Maps. |
placeURI
readonly |
Type:
string optionalA link to show the place on Google Maps. |
reviewsURI
readonly |
Type:
string optionalA link to show the reviews for the place on Google Maps. |
writeAReviewURI
readonly |
Type:
string optionalA link to write a review for the place on Google Maps. |
Methods | |
|---|---|
Inherited:
toJSON
|
Money class
google.maps.places.Money
class
A representation of an amount of money with its currency type.
const {Money} = await google.maps.importLibrary("places");
Properties | |
|---|---|
currencyCode
readonly |
Type:
stringThe three-letter currency code, defined in ISO 4217. |
nanos
readonly |
Type:
numberNumber of nano (10^-9) units of the amount. |
units
readonly |
Type:
numberThe whole units of the amount. For example, if Money.currencyCode is "USD", then 1 unit is 1 US dollar. |
Methods | |
|---|---|
toString |
toString()Parameters: None
Return Value:
stringReturns a human-readable representation of the amount of money with its currency symbol. |
Inherited:
toJSON
| |
NeighborhoodSummary class
google.maps.places.NeighborhoodSummary
class
AI-generated summary of points of interest near the place.
const {NeighborhoodSummary} = await google.maps.importLibrary("places");
Properties | |
|---|---|
description
readonly |
Type:
ContentBlock optionalA detailed description of the neighborhood. |
disclosureText
readonly |
Type:
string optionalThe text for the disclosure relating to this summary. |
disclosureTextLanguageCode
readonly |
Type:
string optionalThe language code of the disclosure text. |
flagContentURI
readonly |
Type:
string optionalA URI to report a problem with the summary. |
overview
readonly |
Type:
ContentBlock optionalAn overview of the neighborhood. |
Methods | |
|---|---|
Inherited:
toJSON
|
OpeningHours class
google.maps.places.OpeningHours
class
Information about business hours of a Place.
const {OpeningHours} = await google.maps.importLibrary("places");
Properties | |
|---|---|
periods
readonly |
Type:
Array<OpeningHoursPeriod>Opening periods covering each day of the week, starting from Sunday, in chronological order. Does not include days where the Place is not open. |
specialDays
readonly |
An array of dates representing special days that fall within the current period. Special days impact the business hours of a place, e.g. Christmas day or one off closures. Set for currentOpeningHours and currentSecondaryOpeningHours if there are exceptional hours. |
weekdayDescriptions
readonly |
Type:
Array<string>An array of seven strings representing the formatted opening hours for each day of the week. The Places Service will format and localize the opening hours appropriately for the current language. The ordering of the elements in this array depends on the language. Some languages start the week on Monday, while others start on Sunday. |
Methods | |
|---|---|
Inherited:
toJSON
|
OpeningHoursPeriod class
google.maps.places.OpeningHoursPeriod
class
A period where the Place is open.
const {OpeningHoursPeriod} = await google.maps.importLibrary("places");
Properties | |
|---|---|
close
readonly |
Type:
OpeningHoursPoint optionalThe closing time for the Place. |
open
readonly |
Type:
OpeningHoursPointThe opening time for the Place. |
Methods | |
|---|---|
Inherited:
toJSON
|
OpeningHoursPoint class
google.maps.places.OpeningHoursPoint
class
A point where the Place changes its opening status.
const {OpeningHoursPoint} = await google.maps.importLibrary("places");
Properties | |
|---|---|
day
readonly |
Type:
numberThe day of the week, as a number in the range [0, 6], starting on Sunday. For example, 2 means Tuesday. |
hour
readonly |
Type:
numberThe hour of the OpeningHoursPoint.time as a number, in the range [0, 23]. This will be reported in the Place’s time zone. |
minute
readonly |
Type:
numberThe minute of the OpeningHoursPoint.time as a number, in the range [0, 59]. This will be reported in the Place’s time zone. |
Methods | |
|---|---|
Inherited:
toJSON
|
SecondaryOpeningHours class
google.maps.places.SecondaryOpeningHours
class
extends OpeningHours
Information about secondary business hours of a Place.
const {SecondaryOpeningHours} = await google.maps.importLibrary("places");
Properties | |
|---|---|
type
readonly |
Type:
string optionalThe type of secondary opening hours. This refers to what the secondary hours apply to like takeout, delivery, or pickup. See SecondaryHoursType for a list of valid values. |
Inherited:
periods,
specialDays,
weekdayDescriptions
| |
Methods | |
|---|---|
Inherited:
toJSON
|
ParkingOptions class
google.maps.places.ParkingOptions
class
const {ParkingOptions} = await google.maps.importLibrary("places");
Properties | |
|---|---|
hasFreeGarageParking
readonly |
Type:
boolean optionalWhether a place offers free garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasFreeParkingLot
readonly |
Type:
boolean optionalWhether a place offers free parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasFreeStreetParking
readonly |
Type:
boolean optionalWhether a place offers free street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasPaidGarageParking
readonly |
Type:
boolean optionalWhether a place offers paid garage parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasPaidParkingLot
readonly |
Type:
boolean optionalWhether a place offers paid parking lots. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasPaidStreetParking
readonly |
Type:
boolean optionalWhether a place offers paid street parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
hasValetParking
readonly |
Type:
boolean optionalWhether a place offers valet parking. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
PaymentOptions class
google.maps.places.PaymentOptions
class
const {PaymentOptions} = await google.maps.importLibrary("places");
Properties | |
|---|---|
acceptsCashOnly
readonly |
Type:
boolean optionalWhether a place only accepts payment via cash. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
acceptsCreditCards
readonly |
Type:
boolean optionalWhether a place accepts payment via credit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
acceptsDebitCards
readonly |
Type:
boolean optionalWhether a place accepts payment via debit card. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
acceptsNFC
readonly |
Type:
boolean optionalWhether a place accepts payment via NFC. Returns 'true' or 'false' if the value is known. Returns 'null' if the value is unknown. |
Photo class
google.maps.places.Photo
class
Information about a photo of a Place.
const {Photo} = await google.maps.importLibrary("places");
Properties | |
|---|---|
authorAttributions
readonly |
Type:
Array<AuthorAttribution>Attribution text to be displayed for this photo. |
flagContentURI
readonly |
Type:
string optionalA link where user can flag a problem with the photo. |
googleMapsURI
readonly |
Type:
string optionalA link to show the photo on Google Maps. |
heightPx
readonly |
Type:
numberThe height of the photo in pixels. |
widthPx
readonly |
Type:
numberThe width of the photo in pixels. |
Methods | |
|---|---|
getURI |
getURI([options])Parameters:
Return Value:
stringReturns the image URL corresponding to the specified options. |
Inherited:
toJSON
| |
PlusCode class
google.maps.places.PlusCode
class
Plus code for the Place. See https://plus.codes/ for more information.
const {PlusCode} = await google.maps.importLibrary("places");
Properties | |
|---|---|
compoundCode
readonly |
Type:
string optionalA plus code with a 1/8000th of a degree by 1/8000th of a degree area where the first four characters (the area code) are dropped and replaced with a locality description. For example, "9G8F+5W Zurich, Switzerland". |
globalCode
readonly |
Type:
string optionalA plus code with a 1/8000th of a degree by 1/8000th of a degree area. For example, "8FVC9G8F+5W". |
Methods | |
|---|---|
Inherited:
toJSON
|
PostalAddress class
google.maps.places.PostalAddress
class
implements PostalAddressLiteral
Represents a postal address (e.g. for a postal service to deliver items to). Note: PostalAddress is used by the JavaScript API to instantiate objects that represent data returned by the Web Service.
const {PostalAddress} = await google.maps.importLibrary("places");
Properties | |
|---|---|
addressLines
readonly |
Type:
Array<string>Unstructured address lines describing the lower levels of an address. |
administrativeArea
readonly |
Type:
string optionalThe highest administrative subdivision which is used for postal addresses of a country or region. |
languageCode
readonly |
Type:
string optionalBCP-47 language code of the contents of this address. Examples: "zh-Hant", "ja", "ja-Latn", "en". |
locality
readonly |
Type:
string optionalGenerally refers to the city/town portion of the address. |
organization
readonly |
Type:
string optionalThe name of the organization at the address. |
postalCode
readonly |
Type:
string optionalPostal code of the address. |
recipients
readonly |
Type:
Array<string>The recipient at the address. |
regionCode
readonly |
Type:
stringCLDR region code of the country/region of the address. Example: "CH" for Switzerland. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. |
sortingCode
readonly |
Type:
string optionalSorting code of the address. |
sublocality
readonly |
Type:
string optionalSublocality of the address such as neighborhoods, boroughs, or districts. |
Methods | |
|---|---|
Inherited:
toJSON
|
PostalAddressLiteral interface
google.maps.places.PostalAddressLiteral
interface
Data for hydrating a PostalAddress.
Properties | |
|---|---|
regionCode |
Type:
string |
addressLines
optional |
Type:
Iterable<string> optional |
administrativeArea
optional |
Type:
string optional |
languageCode
optional |
Type:
string optional |
locality
optional |
Type:
string optional |
organization
optional |
Type:
string optional |
postalCode
optional |
Type:
string optional |
recipients
optional |
Type:
Iterable<string> optional |
sortingCode
optional |
Type:
string optional |
sublocality
optional |
Type:
string optional |
PriceLevel constants
google.maps.places.PriceLevel
constants
Price level for a Place.
These constants are also usable as strings. In TypeScript, the string literals are defined by the PriceLevelString type.
const {PriceLevel} = await google.maps.importLibrary("places");
Constants | |
|---|---|
EXPENSIVE |
|
FREE |
|
INEXPENSIVE |
|
MODERATE |
|
VERY_EXPENSIVE |
|
PriceRange class
google.maps.places.PriceRange
class
The price range associated with a Place. endPrice could be unset, which indicates a range without upper bound (e.g. "More than $100").
const {PriceRange} = await google.maps.importLibrary("places");
Properties | |
|---|---|
endPrice
readonly |
Type:
Money optionalThe upper end of the price range (inclusive). Price should be lower than this amount. |
startPrice
readonly |
Type:
MoneyThe low end of the price range (inclusive). Price should be at or above this amount. |
Methods | |
|---|---|
Inherited:
toJSON
|
Review class
google.maps.places.Review
class
Information about a review of a Place.
const {Review} = await google.maps.importLibrary("places");
Properties | |
|---|---|
authorAttribution
readonly |
Type:
AuthorAttribution optionalThe reviewer. |
flagContentURI
readonly |
Type:
string optionalA link where user can flag a problem with the review. |
googleMapsURI
readonly |
Type:
string optionalA link to show the review on Google Maps. |
originalText
readonly |
Type:
string optionalThe review text in its original language. |
originalTextLanguageCode
readonly |
Type:
string optionalAn IETF language code indicating the original language of the review. |
publishTime
readonly |
Type:
Date optional |
rating
readonly |
Type:
number optionalThe rating of this review, a number between 1.0 and 5.0 (inclusive). |
relativePublishTimeDescription
readonly |
Type:
string optionalA string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. For example `"a month ago"'. |
text
readonly |
Type:
string optionalThe localized text of the review. |
textLanguageCode
readonly |
Type:
string optionalAn IETF language code indicating the localized language of the review. |
visitDateMonth
readonly |
Type:
number optionalThe month of the date when the review author visited the place. This field is 0-based; 0 is January, and 11 is December. |
visitDateYear
readonly |
Type:
number optionalThe year of the date when the review author visited the place. |
Methods | |
|---|---|
Inherited:
toJSON
|
ReviewSummary class
google.maps.places.ReviewSummary
class
AI-generated summary of the place user reviews.
const {ReviewSummary} = await google.maps.importLibrary("places");
Properties | |
|---|---|
disclosureText
readonly |
Type:
string optionalThe text for the disclosure relating to this summary. |
disclosureTextLanguageCode
readonly |
Type:
string optionalThe language code of the disclosure text. |
flagContentURI
readonly |
Type:
string optionalA URI to report a problem with the summary. |
reviewsURI
readonly |
Type:
string optionalA URI to show reviews of this place on Google Maps. |
text
readonly |
Type:
string optionalThe summary of user reviews. |
textLanguageCode
readonly |
Type:
string optionalThe language code of the summary of user reviews. |
Methods | |
|---|---|
Inherited:
toJSON
|
SearchByTextRequest interface
google.maps.places.SearchByTextRequest
interface
Request interface for Place.searchByText.
Properties | |
|---|---|
fields |
Type:
Array<string>Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the Place class as a field. |
evSearchOptions
optional |
Type:
EVSearchOptions optionalEV-related options that can be specified for a place search request. |
includedType
optional |
Type:
string optionalThe requested place type. Full list of types supported: https://developers.google.com/maps/documentation/places/web-service/place-types. Only one included type is supported. See SearchByTextRequest.useStrictTypeFiltering |
isOpenNow
optional |
Type:
boolean optionalDefault:
falseUsed to restrict the search to places that are currently open. |
language
optional |
Type:
string optionalPlace details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. |
locationBias
optional |
Type:
LatLng|LatLngLiteral|LatLngBounds|LatLngBoundsLiteral|CircleLiteral|Circle optionalThe region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with locationRestriction. |
locationRestriction
optional |
Type:
LatLngBounds|LatLngBoundsLiteral optionalThe region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with locationBias. |
maxResultCount
optional |
Type:
number optionalMaximum number of results to return. It must be between 1 and 20, inclusively. |
minRating
optional |
Type:
number optionalFilter out results whose average user rating is strictly less than this limit. A valid value must be an float between 0 and 5 (inclusively) at a 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating will be rounded up to the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all results with a less than 1.0 rating. |
priceLevels
optional |
Type:
Array<PriceLevel> optionalUsed to restrict the search to places that are marked as certain price levels. Any combinations of price levels can be chosen. Defaults to all price levels. |
optional |
Type:
string optional |
optional |
Type:
SearchByTextRankPreference optional |
rankPreference
optional |
Type:
SearchByTextRankPreference optionalDefault:
SearchByTextRankPreference.RELEVANCEHow results will be ranked in the response. |
region
optional |
Type:
string optionalThe Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. |
textQuery
optional |
Type:
string optionalRequired when you do not use . The text query for textual search. |
useStrictTypeFiltering
optional |
Type:
boolean optionalDefault:
falseUsed to set strict type filtering for SearchByTextRequest.includedType. If set to true, only results of the same type will be returned. |
SearchByTextRankPreference constants
google.maps.places.SearchByTextRankPreference
constants
RankPreference enum for SearchByTextRequest.
These constants are also usable as strings. In TypeScript, the string literals are defined by the SearchByTextRankPreferenceString type.
const {SearchByTextRankPreference} = await google.maps.importLibrary("places");
Constants | |
|---|---|
DISTANCE |
Ranks results by distance. |
RELEVANCE |
Ranks results by relevance. |
SearchNearbyRequest interface
google.maps.places.SearchNearbyRequest
interface
Request interface for Place.searchNearby. For more information on the request, see Places API reference.
Properties | |
|---|---|
fields |
Type:
Array<string>Fields to be included in the response, which will be billed for. If ['*'] is passed in, all available fields will be returned and billed for (this is not recommended for production deployments). You can request any property in the Place class as a field. |
locationRestriction |
Type:
Circle|CircleLiteralThe region to search, specified as a circle with center and radius. Results outside given location are not returned. |
excludedPrimaryTypes
optional |
Type:
Array<string> optionalExcluded primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. |
excludedTypes
optional |
Type:
Array<string> optionalExcluded place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. |
includedPrimaryTypes
optional |
Type:
Array<string> optionalIncluded primary place types. See the full list of types supported. A place can only have a single primary type. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. |
includedTypes
optional |
Type:
Array<string> optionalIncluded place types. See the full list of types supported. A place can have many different place types. Up to 50 types may be specified. If you specify the same type in both included and excluded lists, an INVALID_ARGUMENT error is returned. |
language
optional |
Type:
string optionalPlace details will be displayed with the preferred language if available. Will default to the browser's language preference. Current list of supported languages: https://developers.google.com/maps/faq#languagesupport. |
maxResultCount
optional |
Type:
number optionalMaximum number of results to return. For acceptable values and default, see Places API reference. |
rankPreference
optional |
Type:
SearchNearbyRankPreference optionalDefault:
SearchNearbyRankPreference.POPULARITYHow results will be ranked in the response. |
region
optional |
Type:
string optionalThe Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported. |
SearchNearbyRankPreference constants
google.maps.places.SearchNearbyRankPreference
constants
RankPreference enum for SearchNearbyRequest.
These constants are also usable as strings. In TypeScript, the string literals are defined by the SearchNearbyRankPreferenceString type.
const {SearchNearbyRankPreference} = await google.maps.importLibrary("places");
Constants | |
|---|---|
DISTANCE |
Ranks results by distance. |
POPULARITY |
Ranks results by popularity. |