Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,6 @@ directions_result = gmaps.directions("Sydney Town Hall",
departure_time=now)
```

Below is the same example, using client ID and client secret (digital signature)
for authentication. This code assumes you have previously loaded the `client_id`
and `client_secret` variables with appropriate values.

For a guide on how to generate the `client_secret` (digital signature), see the
documentation for the API you're using. For example, see the guide for the
[Directions API](https://developers.google.com/maps/documentation/directions/get-api-key#client-id).

```python
gmaps = googlemaps.Client(client_id=client_id, client_secret=client_secret)

# Geocoding and address
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')

# Look up an address with reverse geocoding
reverse_geocode_result = gmaps.reverse_geocode((40.714224, -73.961452))

# Request directions via public transit
now = datetime.now()
directions_result = gmaps.directions("Sydney Town Hall",
"Parramatta, NSW",
mode="transit",
departure_time=now)
```

For more usage examples, check out [the tests](https://github.com/googlemaps/google-maps-services-python/tree/master/googlemaps/test).

## Features
Expand All @@ -120,10 +95,6 @@ For more usage examples, check out [the tests](https://github.com/googlemaps/goo
Automatically retry when intermittent failures occur. That is, when any of the retriable 5xx errors
are returned from the API.

### Client IDs
Comment thread
jpoehnelt marked this conversation as resolved.

Google Maps APIs Premium Plan customers can use their client ID and secret to authenticate,
instead of an API key.

## Building the Project

Expand Down
5 changes: 3 additions & 2 deletions googlemaps/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ def __init__(self, key=None, client_id=None, client_secret=None,
retry_over_query_limit=True, experience_id=None):
"""
:param key: Maps API key. Required, unless "client_id" and
"client_secret" are set.
"client_secret" are set. Most users should use an API key.
:type key: string

:param client_id: (for Maps API for Work customers) Your client ID.
Most users should use an API key instead.
:type client_id: string

:param client_secret: (for Maps API for Work customers) Your client
secret (base64 encoded).
secret (base64 encoded). Most users should use an API key instead.
:type client_secret: string

:param channel: (for Maps API for Work customers) When set, a channel
Expand Down