Skip to content

DevSite Import: Using API Keys聽#676

Closed

Description

@grant

Notice: This DevSite page will soon be deleted per b/133171590. Please add this sample to GitHub if it is relevant still:

https://developers.google.com/api-client-library/python/auth/api-keys


Using API Keys

When calling APIs that do not access private user data, you can use simple API keys. These keys are used to authenticate your application for accounting purposes. The Google API Console documentation also describes API keys.

Note: If you do need to access private user data, you must use OAuth 2.0. See Using OAuth 2.0 for Web Server Applications, Using OAuth 2.0 for Installed Applications, and Using OAuth 2.0 for Server to Server Applications for more information.

Acquiring API keys

  1. Open the Credentials page in the API Console.
  2. Click Create credentials > API key and select the appropriate key type.

To keep your API keys secure, follow the best practices for securely using API keys.

Using API keys

To use API keys, pass them to the build() function when creating service objects. For example:

books_service = build('books', 'v1', developerKey='api_key')

All calls made using that service object will include your API key.

Activity

  1. added
    type: docsImprovement to the documentation for an API.
    and removed
    triage meI really want to be triaged.
    on Jun 10, 2019
  2. added a commit that references this issue on Jun 26, 2019
    a73a4be
  3. grant commented on Jun 26, 2019

    @grant
    ContributorAuthor

    The docs are now added to the docs/ folder.
    Fixed with #706.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions