Get authorized API credentials using Python

Get an authorized API client by using the Healthcare API.

Code sample

Python

def get_client():
    """Returns an authorized API client by discovering the Healthcare API and
    creating a service object using the service account credentials in the
    GOOGLE_APPLICATION_CREDENTIALS environment variable."""
    api_version = "v1"
    service_name = "healthcare"

    return discovery.build(service_name, api_version)

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser