The “KeyLooksLikeClientId” error message appears when the API key that you are using to access the Google Maps Platform API looks like a client ID, rather than an API key. This error can occur if you are using a client ID as your API key or if you have accidentally entered your client ID into the API key field in the Google Cloud Console or in your application code.
How to fix KeyLooksLikeClientId
To resolve this error, you need to ensure that you are using a valid API key, rather than a client ID. If you are using an API key, you should also ensure that it is authorized for the API(s) that you are using.
Look for any keys that have a label of “API key” or that start with “AIza”. These are API keys and should be used to access the Google Maps Platform API.
If you find a client ID that is being used as an API key, delete it and create a new API key to use in its place.
- Check that your API key is correct. Make sure you are using the correct API key, and that it has not been revoked or expired. To find your API key, go to the Google Cloud Console and navigate to the “Credentials” page.
- Check that your API key is properly configured. Make sure that the API key is associated with the correct project and that it has the necessary permissions to use the Google Maps API. You can do this by going to the “Credentials” page in the Google Cloud Console and clicking on the API key you are using.
- Check that the API is enabled for your project. Go to the “Library” page in the Google Cloud Console and make sure that the Google Maps JavaScript API is listed under the “Enabled APIs” section. If it is not, click the “Enable APIs and Services” button and search for the Google Maps JavaScript API.
- Check that you have not exceeded your usage limits. The Google Maps API has usage limits that may cause the KeyLooksLikeClientId error if you exceed them. To view your usage limits, go to the “Usage & Billing” page in the Google Cloud Console.
- In the Google Cloud Platform Console. Select a project or create a new one>Click on the “APIs & Services > Credentials
- Find your API key under the “API keys” section and click on “Edit”
- Make sure that your key has the correct restrictions (e.g. none) and then
- Click “Save”.
- Try loading the Google Maps API again – you should now see the map!
Conclusion
The “KeyLooksLikeClientId” error can be resolved by using a valid API key and ensuring that it is authorized for the correct API(s).