I am trying to use Youtube Data API v3 to search on android, though when I try to search using my API key i always get this message:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
I have the Youtube Data API set to on in my Console. I have been trying to figure this out for hours. Does anyone know what's wrong?
Go to the Google Maps Platform > Credentials page. Select the API key that you want to set a restriction on. The API key property page appears. Select Android apps. Click + Add package name and fingerprint.
To get an API key: Visit the Google Cloud Platform Console. Click the project drop-down and select or create the project for which you want to add an API key. Click the menu button and select APIs & Services > Credentials. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key.
Click Restrict key. Select Maps SDK for Android from Select APIs dropdown. If the Maps SDK for Android is not listed, you need to enable it. To finalize your changes, click Save. List existing keys. Clear existing restrictions on existing key. Set new restrictions on existing key.
Choose one of the following ways to get your API key from Android Studio: Copy the link provided in the google_maps_api.xml file and paste it into your browser. The link takes you to the Google Cloud Console and supplies the required information to the Cloud Console via URL parameters, thus reducing the manual input required from you.
A bit mind confusing is that for the YouTube Data API you need to use the browser-key, but for the YouTube Player API (for Android) you need the Android-key.
Using the Android key for the YouTube Data API will not work and result in the error you received.
I've finally solved this. I deleted my project and created a new project in the old Cloud Console. I then activated all the APIs I need to use and then went into API Access and there was a key already there. It should say "Key for browser apps (with referers)" and I just used that key, and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With