# Create API Credentials

#### Generate an API Key

1. In your Google Cloud project, go to **"APIs & Services"** → **"Credentials"**
2. Click **"+ Create Credentials"** at the top
3. Select **"API Key"** from the dropdown
4. A modal will appear titled **"**&#x43;reate API Ke&#x79;**"** with configuration options
5. **Configure the API Key:** **Name your API key:**

   * Enter a descriptive name in the **"Name"** field
   * Example: `StreamLink-YouTube-API-Key`
   * This helps you identify the key later

   **Application restrictions**:

   * Select **"None"** for the simplest setup
   * This allows the key to work from any location

   **API restrictions**:

   * Select **"Restrict key"**
   * In the dropdown menu that appears, search for and select: "**YouTube Data API v3**"
   * This ensures the key can only be used for specific APIs
6. Click the blue **"Create"** button at the bottom
7. **Copy your API key** from the confirmation modal that appears
   * Example format: `AIzaSyAbc123Def456Ghi789Jkl012Mno345Pqr`
   * Click the copy icon or manually select and copy the entire key

{% hint style="warning" %}
**Save Your API Key Securely!** Treat it like a password. Don't share it publicly.
{% endhint %}

#### Test Your API Key (Optional)

You can test your API key using this URL in a browser:

```
https://www.googleapis.com/youtube/v3/search?part=id&maxResults=1&q=test&type=video&key=YOUR_API_KEY_HERE
```

Replace `YOUR_API_KEY_HERE` with your actual API key.

**Expected Result:** JSON response with video search results

**If you see an error:**

* `"API_KEY_INVALID"` → Key is wrong, regenerate it
* `"ACCESS_NOT_CONFIGURED"` → YouTube Data API v3 not enabled
* `"PERMISSION_DENIED"` → API restrictions too strict


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kentatetsu.gitbook.io/streamlink/guides/youtube-setup-guide/create-api-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
