This document describes API Keys, when to use them, how to acquire them,
and how to use them with the Google API Client Library for .NET.

## Introduction


When calling an API that does not access private user data,
you can use a simple API key.
This key is used to authenticate your application for accounting purposes.
You can read more on [API keys](https://developers.google.com/console/help/using-keys) in the Console documentation.


**Note** :
If you *do* need to access private user data, you must use
[OAuth 2.0](https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth).

## Acquiring API keys

1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) 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](https://cloud.google.com/docs/authentication/api-keys).

## Using API keys


To use an API key, pass it to the
[BaseClientService.Initializer `APIKey`](https://googleapis.dev/dotnet/Google.Apis/latest/api/Google.Apis.Services.BaseClientService.Initializer.html)
property. The
[Simple API Example](https://developers.google.com/api-client-library/dotnet/get_started#simple)
on the Get Started page provides a complete example that uses API keys.


By setting the `APIKey` property, you ensure that every call you make
to the service will include the API key.