As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Maps Places v1 API

class google.maps.places_v1.types.Circle(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Circle with a LatLng as center and radius.

center

Required. Center latitude and longitude.

The range of latitude must be within [-90.0, 90.0]. The range of the longitude must be within [-180.0, 180.0].

Type

google.type.latlng_pb2.LatLng

radius

Required. Radius measured in meters. The radius must be within [0.0, 50000.0].

Type

float

class google.maps.places_v1.types.Int32Range(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

int 32 range. Both min and max are optional. If only min is set, then the range only has a lower bound. If only max is set, then range only has an upper bound. At least one of min and max must be set. Values are inclusive.

min_

Lower bound. If unset, behavior is documented on the range field.

This field is a member of oneof _min.

Type

int

max_

Upper bound. If unset, behavior is documented on the range field.

This field is a member of oneof _max.

Type

int

class google.maps.places_v1.types.Place(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

All the information representing a Place.

id

Required. The unique identifier of a place.

Type

str

display_name

The localized name of the place, suitable as a short human-readable description. For example, “Google Sydney”, “Starbucks”, “Pyrmont”, etc.

Type

google.type.localized_text_pb2.LocalizedText

types

A set of type tags for this result. For example, “political” and “locality”.

Type

MutableSequence[str]

national_phone_number

A human-readable phone number for the place, in national format.

Type

str

international_phone_number

A human-readable phone number for the place, in international format.

Type

str

formatted_address

A full, human-readable address for this place.

Type

str

address_components

Repeated components for each locality level.

Type

MutableSequence[google.maps.places_v1.types.Place.AddressComponent]

plus_code

Plus code of the place location lat/long.

Type

google.maps.places_v1.types.Place.PlusCode

location

The position of this place.

Type

google.type.latlng_pb2.LatLng

viewport

A viewport suitable for displaying the place on an average-sized map.

Type

google.geo.type.types.Viewport

rating

A rating between 1.0 and 5.0, based on user reviews of this place.

Type

float

google_maps_uri

A URL providing more information about this place.

Type

str

website_uri

The authoritative website for this place, e.g. a business’ homepage. Note that for places that are part of a chain (e.g. an IKEA store), this will usually be the website for the individual store, not the overall chain.

Type

str

reviews

List of reviews about this place.

Type

MutableSequence[google.maps.places_v1.types.Place.Review]

opening_hours

The regular hours of operation.

Type

google.maps.places_v1.types.Place.OpeningHours

utc_offset_minutes

Number of minutes this place’s timezone is currently offset from UTC. This is expressed in minutes to support timezones that are offset by fractions of an hour, e.g. X hours and 15 minutes.

Type

int

adr_format_address

The place’s address in adr microformat: http://microformats.org/wiki/adr.

Type

str

business_status

The business status for the place.

Type

google.maps.places_v1.types.Place.BusinessStatus

price_level

Price level of the place.

Type

google.maps.places_v1.types.PriceLevel

attributions

A set of data provider that must be shown with this result.

Type

MutableSequence[google.maps.places_v1.types.Place.Attribution]

user_rating_count

The total number of reviews (with or without text) for this place.

Type

int

icon_mask_base_uri

A truncated URL to an v2 icon mask. User can access different icon type by appending type suffix to the end (eg, “.svg” or “.png”).

Type

str

icon_background_color

Background color for icon_mask in hex format, e.g. #909CE1.

Type

str

takeout

Specifies if the business supports takeout.

This field is a member of oneof _takeout.

Type

bool

delivery

Specifies if the business supports delivery.

This field is a member of oneof _delivery.

Type

bool

dine_in

Specifies if the business supports indoor or outdoor seating options.

This field is a member of oneof _dine_in.

Type

bool

curbside_pickup

Specifies if the business supports curbside pickup.

This field is a member of oneof _curbside_pickup.

Type

bool

wheelchair_accessible_entrance

Specifies if the place has an entrance that is wheelchair-accessible.

This field is a member of oneof _wheelchair_accessible_entrance.

Type

bool

reservable

Specifies if the place supports reservations.

This field is a member of oneof _reservable.

Type

bool

serves_breakfast

Specifies if the place serves breakfast.

This field is a member of oneof _serves_breakfast.

Type

bool

serves_lunch

Specifies if the place serves lunch.

This field is a member of oneof _serves_lunch.

Type

bool

serves_dinner

Specifies if the place serves dinner.

This field is a member of oneof _serves_dinner.

Type

bool

serves_beer

Specifies if the place serves beer.

This field is a member of oneof _serves_beer.

Type

bool

serves_wine

Specifies if the place serves wine.

This field is a member of oneof _serves_wine.

Type

bool

serves_brunch

Specifies if the place serves brunch.

This field is a member of oneof _serves_brunch.

Type

bool

serves_vegetarian_food

Specifies if the place serves vegetarian food.

This field is a member of oneof _serves_vegetarian_food.

Type

bool

current_opening_hours

The hours of operation for the next seven days (including today). The time period starts at midnight on the date of the request and ends at 11:59 pm six days later. This field includes the special_days subfield of all hours, set for dates that have exceptional hours.

Type

google.maps.places_v1.types.Place.OpeningHours

current_secondary_opening_hours

Contains an array of entries for the next seven days including information about secondary hours of a business. Secondary hours are different from a business’s main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list of opening hours types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place. This field includes the special_days subfield of all hours, set for dates that have exceptional hours.

Type

MutableSequence[google.maps.places_v1.types.Place.OpeningHours]

secondary_opening_hours

Contains an array of entries for information about regular secondary hours of a business. Secondary hours are different from a business’s main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. This field populates the type subfield, which draws from a predefined list of opening hours types (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the place.

Type

MutableSequence[google.maps.places_v1.types.Place.OpeningHours]

editorial_summary

Contains a summary of the place. A summary is comprised of a textual overview, and also includes the language code for these if applicable. Summary text must be presented as-is and can not be modified or altered.

Type

google.maps.places_v1.types.Place.EditorialSummary

class AddressComponent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The structured components that form the formatted address, if this information is available.

long_text

The full text description or name of the address component. For example, an address component for the country Australia may have a long_name of “Australia”.

Type

str

short_text

An abbreviated textual name for the address component, if available. For example, an address component for the country of Australia may have a short_name of “AU”.

Type

str

types

An array indicating the type(s) of the address component.

Type

MutableSequence[str]

language_code

The language used to format this components, in CLDR notation.

Type

str

class Attribution(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Information about data providers of this place.

provider

Name of the Place’s data provider.

Type

str

provider_uri

URI to the Place’s data provider.

Type

str

class BusinessStatus(value)[source]

Bases: proto.enums.Enum

Business status for the place.

Values:
BUSINESS_STATUS_UNSPECIFIED (0):

Default value. This value is unused.

OPERATIONAL (1):

The establishment is operational, not necessarily open now.

CLOSED_TEMPORARILY (2):

The establishment is temporarily closed.

CLOSED_PERMANENTLY (3):

The establishment is permanently closed.

class EditorialSummary(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Contains a summary of the place.

overview

A summary is comprised of a textual overview, and also includes the language code for these if applicable. Summary text must be presented as-is and can not be modified or altered.

Type

google.type.localized_text_pb2.LocalizedText

class OpeningHours(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Information about business hour of the place.

open_now

Is this place open right now? Always present unless we lack time-of-day or timezone data for these opening hours.

Type

bool

periods

The periods that this place is open during the week. The periods are in chronological order, starting with Sunday in the place-local timezone. An empty (but not absent) value indicates a place that is never open, e.g. because it is closed temporarily for renovations.

Type

MutableSequence[google.maps.places_v1.types.Place.OpeningHours.OpeningHoursPeriod]

weekday_descriptions

Localized strings describing the opening hours of this place, one string for each day of the week. Will be empty if the hours are unknown or could not be converted to localized text. Example: “Sun: 18:00–06:00”.

Type

MutableSequence[str]

secondary_hour_type

A type string used to identify the type of secondary hours.

Type

google.maps.places_v1.types.Place.OpeningHours.SecondaryHourType

special_days

Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of a place, e.g. Christmas day. Set for current_opening_hours and current_secondary_opening_hours if there are exceptional hours.

Type

MutableSequence[google.maps.places_v1.types.Place.OpeningHours.SpecialDay]

class OpeningHoursPeriod(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A period the place remains in open_now status.

open_

The time that the place starts to be open.

Type

google.maps.places_v1.types.Place.OpeningHours.OpeningHoursPeriod.OpeningHoursPoint

close

The time that the place starts to be closed.

Type

google.maps.places_v1.types.Place.OpeningHours.OpeningHoursPeriod.OpeningHoursPoint

class OpeningHoursPoint(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Status changing points.

day

A day of the week, as an integer in the range 0-6. 0 is Sunday, 1 is Monday, etc.

This field is a member of oneof _day.

Type

int

hour

The hour in 2 digits. Ranges from 00 to 23.

This field is a member of oneof _hour.

Type

int

minute

The minute in 2 digits. Ranges from 00 to 59.

This field is a member of oneof _minute.

Type

int

date_deprecated

Date of the endpoint expressed in RFC3339 format in the local timezone for the place. For example 2010-12-31.

Type

str

date

Date in the local timezone for the place.

Type

google.type.date_pb2.Date

truncated

Whether or not this endpoint was truncated. Truncation occurs when the real hours are outside the times we are willing to return hours between, so we truncate the hours back to these boundaries. This ensures that at most 24 * 7 hours from midnight of the day of the request are returned.

Type

bool

class SecondaryHourType(value)[source]

Bases: proto.enums.Enum

A type used to identify the type of secondary hours.

Values:
SECONDARY_HOUR_TYPE_UNSPECIFIED (0):

Default value when secondary hour type is not specified.

DRIVE_THROUGH (1):

The drive-through hour for banks, restaurants, or pharmacies.

HAPPY_HOUR (2):

The happy hour.

DELIVERY (3):

The delivery hour.

TAKEOUT (4):

The takeout hour.

KITCHEN (5):

The kitchen hour.

BREAKFAST (6):

The breakfast hour.

LUNCH (7):

The lunch hour.

DINNER (8):

The dinner hour.

BRUNCH (9):

The brunch hour.

PICKUP (10):

The pickup hour.

ACCESS (11):

The access hours for storage places.

SENIOR_HOURS (12):

The special hours for seniors.

ONLINE_SERVICE_HOURS (13):

The online service hours.

class SpecialDay(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of a place, e.g. Christmas day.

date

The date of this special day.

Type

google.type.date_pb2.Date

class PlusCode(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Plus code (http://plus.codes) is a location reference with two formats: global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and compound code, replacing the prefix with a reference location.

global_code

Place’s global (full) code, such as 9FWM33GV+HQ, representing an 1/8000 by 1/8000 degree area (~14 by 14 meters).

Type

str

compound_code

Place’s compound code, such as 33GV+HQ, Ramberg, Norway, containing the suffix of the global code and replacing the prefix with a formatted name of a reference entity.

Type

str

class Review(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Information about a review of the place.

publish_time

Timestamp for the review, expressed in seconds since epoch.

Type

google.protobuf.timestamp_pb2.Timestamp

relative_publish_time_description

A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country.

Type

str

text

The localized text of the review.

Type

google.type.localized_text_pb2.LocalizedText

author

The name of the review author.

Type

str

author_uri

A link to the review author’s profile.

Type

str

author_photo_uri

The author’s profile photo.

Type

str

rating

A whole number between 1.0 and 5.0, a.k.a. the number of stars.

Type

float

original_language_code

A BCP-47 language code indicating the original language of the review. If the review has been translated, then original_language != language. This field contains the main language tag only, and not the secondary tag indicating country or region. For example, all the English reviews are tagged as ‘en’, and not ‘en-AU’ or ‘en-UK’ and so on.This field is empty if there is only a rating with no review text.

Type

str

translated

A boolean value indicating if the review was translated from the original language it was written in. If a review has been translated, corresponding to a value of true, Google recommends that you indicate this to your users. For example, you can add the following string, “Translated by Google”, to the review.

Type

bool

class google.maps.places_v1.types.PriceLevel(value)[source]

Bases: proto.enums.Enum

Price level of the place.

Values:
PRICE_LEVEL_UNSPECIFIED (0):

Place price level is unspecified or unknown.

FREE (1):

No description available.

INEXPENSIVE (2):

Place provides inexpensive services.

MODERATE (3):

Place provides moderately priced services.

EXPENSIVE (4):

Place provides expensive services.

VERY_EXPENSIVE (5):

Place provides very expensive services.

class google.maps.places_v1.types.SearchTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request data structure for SearchText.

text_query

Required. The text query for textual search.

Type

str

language_code

Place details will be displayed with the preferred language if available. If the language code is unspecified or unrecognized, place details of any language may be returned, with a preference for English if such details exist.

Current list of supported languages: https://developers.google.com/maps/faq#languagesupport.

Type

str

region_code

The Unicode country/region code (CLDR) of the location where the request is coming from. It is used to display the place details, like region-specific place name, if available.

For more information, see http://www.unicode.org/reports/tr35/#unicode_region_subtag.

Note that 3-digit region codes are not currently supported.

Type

str

rank_preference

How results will be ranked in the response.

Type

google.maps.places_v1.types.SearchTextRequest.RankPreference

location

The region to search. Setting location would usually yields better results. Recommended to set. This location serves as a bias unless strict_restriction is set to true, which turns the location to a strict restriction.

Deprecated. Use LocationRestriction or LocationBias instead.

Type

google.maps.places_v1.types.SearchTextRequest.Location

included_type

The requested place type. Full list of types supported: https://developers.google.com/places/supported_types. Only support one included type.

Type

str

open_now

Used to restrict the search to places that are open at a specific time. open_now marks if a business is currently open.

Type

bool

price_range

[Deprecated!]Used to restrict the search to places that are within a certain price range. This is on a scale of 0 to 4. Set a minimum of 0 or set a maximum of 4 has no effect on the search results. Min price is default to 0 and max price is default to 4. Default value will be used if either min or max is unset.

Type

google.maps.places_v1.types.Int32Range

min_rating

Filter 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. This is to keep parity with LocalRefinement_UserRating. The input rating will round 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.

Type

float

max_result_count

Maximum number of results to return. It must be between 1 and 20, inclusively. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds the upper limit, an INVALID_ARGUMENT error is returned.

Type

int

price_levels

Used to restrict the search to places that are marked as certain price levels. Users can choose any combinations of price levels. Default to select all price levels.

Type

MutableSequence[google.maps.places_v1.types.PriceLevel]

strict_type_filtering

Used to set strict type filtering for included_type. If set to true, only results of the same type will be returned. Default to false.

Type

bool

location_bias

The region to search. This location serves as a bias which means results around given location might be returned. Cannot be set along with location_restriction.

Type

google.maps.places_v1.types.SearchTextRequest.LocationBias

location_restriction

The region to search. This location serves as a restriction which means results outside given location will not be returned. Cannot be set along with location_bias.

Type

google.maps.places_v1.types.SearchTextRequest.LocationRestriction

class Location(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The region to search. Deprecated. Use LocationRestriction or LocationBias instead.

rectangle

A rectangle box defined by northeast and southwest corner.

This field is a member of oneof type.

Type

google.geo.type.types.Viewport

strict_restriction

Make location field a strict restriction and filter out POIs outside of the given location. If location type field is unset this field will have no effect.

Type

bool

class LocationBias(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The region to search. This location serves as a bias which means results around given location might be returned.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

rectangle

A rectangle box defined by northeast and southwest corner.

This field is a member of oneof type.

Type

google.geo.type.types.Viewport

circle

A circle defined by center point and radius.

This field is a member of oneof type.

Type

google.maps.places_v1.types.Circle

class LocationRestriction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The region to search. This location serves as a restriction which means results outside given location will not be returned.

rectangle

A rectangle box defined by northeast and southwest corner.

This field is a member of oneof type.

Type

google.geo.type.types.Viewport

class RankPreference(value)[source]

Bases: proto.enums.Enum

How results will be ranked in the response.

Values:
RANK_PREFERENCE_UNSPECIFIED (0):

RankPreference value not set. Will default to DISTANCE.

DISTANCE (1):

Ranks results by distance.

RELEVANCE (2):

Ranks results by relevance. Sort order determined by normal ranking stack. See SortRefinement::RELEVANCE.

class google.maps.places_v1.types.SearchTextResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response proto for SearchText.

places

A list of places that meet the user’s text search criteria.

Type

MutableSequence[google.maps.places_v1.types.Place]