This API project is not authorized to use this API - using geocode in R - r

I've been looking all the answers to this same question, but the solutions seem to be too old or not working...
I am using geocode from the ggmap library in R, I am using it to transform 100,000 addresses to a latitude and longitude...
Everything was working fine for 25,000 and suddenly I started getting the message
"This API project is not authorized to use this API" and now I'm unable to do anything anymore.
I enabled the geocoding API and the google cloud APIs in the google cloud platform..
I also changed the API key, it first said my key expired but after a while it started saying "This API project is not authorized to use this API" again..
As an additional note, my billing method is enabled and working fine
Why do you think this is happening? How to solve it?

well, after an hour or so it seems that it started working again... I assume considering that enabling the geocoding API was the only actual action I did and changing the API key, the only conclusion is that after you do that it's important to wait until all the changes are propagated or something.

Related

gmapsdistance - which API is needed? [duplicate]

I've started getting this error from a Google Maps widget within a CMS I use:
This API key is not authorized to use this service or API. Places API error: ApiTargetBlockedMapError
The error message provides a helpful link to this page, which includes the following text:
ApiTargetBlockedMapError Error
The Maps JavaScript API has not been authorized for the used API key.
Please check the API restrictions settings of your API key in the
Google Cloud Platform Console.
See API keys in the Google Cloud Platform Console. For more
information, see Using API Keys.
I know Google has tweaked this API in the past, so I went to the console and checked the permissions given for the key I am using. It includes these four permissions, include the Maps JavaScript API permission:
Geocoding API
Maps Embed API
Maps JavaScript API
Maps Static API
The only part not working is the address auto-complete. When I change to Don't Restrict Key mode so the key works with all services, it works fine. Any idea which service checkbox I might be missing? I'm wondering if Google is just displaying the wrong error.
Any ideas?
This is what I did. Updated.
Make sure you have enabled all the next Google Maps Services
If you have key restrictions, make sure you add the services like the next image..
Restart the project. It worked.
It turns out that Google has tweaked their permissions settings without updating the error. I had to give access to the Places API as well for the autocomplete to function.
I've submitted a PR to the CMS widget's documentation:
https://github.com/Frojd/wagtail-geo-widget/pull/59/files

How do i tell Openrefine to fetch some data trough the google and facebook API (Grel)

I have a list of around 500 foundations and companies and i need to fetch more data like address, description, lat long, email or phone number, from the google and FB APIs I have found something more or less like this, but it won't work in OpenRefine, i need some help please.
I think it is possible to do beacause there is an addon called spotlight for spreadsheets that is able to fetch Google URLs and Lat Long https://www.youtube.com/watch?v=Vj1v3QfyrgA&feature=youtu.be
https://maps.googleapis.com/maps/api/place/findplacefromtext/output?parameters/json?input=value&inputtype=textquery&fields=photos,formatted_address,name,rating,email,geometry&key=YOURKEY
I have created the FB and Google places and google staic map API already. I have tried different queries, but it won't work unless it is in GREL
value.parseJson().geonames[0].lng
value.parseJson().geonames[0].geonameId
value.parseJson().geonames[0].lat
From the error "This API project is not authorized to use this API" the first thing to check is that you have enabled the Places and/or Geocoding API in the Google Developer console, and you have setup an API Key and that it is showing as a credential for the Places API and/or the Geocoding API
Next step, take OpenRefine out of the equation and check you can get a simple API call working in your browser - using one of the Google Places API examples:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=<INSERT YOUR API KEY HERE>
If that gives you the same error, you know the issue is not with OpenRefine.
If you are still having problems in OpenRefine make sure you are creating URLs in OpenRefine that are valid for the appropriate Google API based on the documentation for that API and that you are using the correct API key.

Connecting to Youtube Analytics API using R

I am trying to pull data from Youtube Analytics API using R and have hit a wall. I'm getting a Status 403 error. I can confirm that:
I have tried logging out of all accounts, rebooting, re-authenticating and then logging into 1 account and it didn't work
I have tried using just the https://www.googleapis.com/auth/youtube.readonly scope (which is supposed to be correct) and all youtube analytics scopes are authorized within the app (each with their own credential key), it didn't work.
I have tried authenticating from different browsers, it didn't work
I can confirm that the call worked from https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v2/youtubeAnalytics.reports.query.
UPDATE
I have found the solution and updated the code to what is now working
scopes<- c('https://www.googleapis.com/auth/youtube.readonly')
endpoint<- oauth_endpoints('google')
youtubeapp<- oauth_app(appname='Youtube Analytics API',
key=client_id,
secret=client_secret)
youtube_token<- oauth2.0_token(
endpoint= oauth_endpoints('google'),
app = youtubeapp,
scope = scopes)
raw_data<- GET(paste("https://youtubeanalytics.googleapis.com/v2/reports?dimensions=",dimensions,"&endDate=",enddate,"&ids=",ids,"&metrics=",metrics,"&startDate=",startdate,sep=""),
config=youtube_token,content_type('application/json'))
content(raw_data, as= 'text')
I have figured out that access permissions are dictated by Youtube (not API IAM), so for example even though my personal email is owner of Brand account and API I still need to authenticate the call using the Brand Account or it won't work (I get 403 error for personal email). I tried switching my Youtube channel from Brand to personal and then my personal email worked. However, I need it under the brand account, so I have switched back.
I will leave this code up regardless because I found that good examples using R were lacking, I hope you find this useful.

Google Oauth client was deleted. can I restore a new one?

We running a wordpress website use google oauth for third-party social login. (via WP Social Login plugin.) Former engineer is leave, and we cannot have past google account credential.
We face a problem shows:
Error 401
Error: deleted_client
The OAuth client was deleted.
but we can only see old client id and secret from website admin panel.
I wanna to know,
if we set up a new google oauth application id/secret, will it make user crash from login website?
Or, is it possible for us to restore/retrieve former application ownership and make it live again?
This happened to me when I was working on an Add-On (maybe not completely related to this question but similar). I mistakenly deleted a Client ID that I thought we weren't using.
How I solved it:
Created a new project in Google Cloud
Associated the Apps Script project (Add-on) to this new Google Cloud project
Then I re-associated the App Script project with my previous Google Cloud project
The previous step will re-compile, create and associate the Client ID to the App Script project. It will contain all settings from the Client ID manually created and associated with your project in the code.
Maybe this will give some light to anyone having a similar problem.
Here use this link:
https://support.google.com/cloud/answer/6251787?hl=en
You have to reach google and they will help you out, this is the only solution you can do.
In my case, the simplest/only path (though certainly not ideal) ended up being to create a new Firebase project and start using that.
This of course can be problematic if you have a lot of data to move and/or a nontrivial data schema - say, with nested collections. For me, it was worth the effort to get unblocked from Sign-In suddenly failing to work.
... ah, OAuth fun
=======
If you are trying to make the new Client ID work .. though it's not a total solution, but after searching for a while, found this config option in Firebase console - where you enable Google Sign In.
So if you generate a new OAuth Client ID, update the ID & secret there.
After I did this, it went from a 401 error to a 400 mis_direct , which I think was step in the right direction.

Google Maps APIs sometimes requires domain verification?

I maintain a WordPress store locator plugin, and this week someone told me it wasn't working anymore. Eventually he fixed it by verifying his domain in the API Console.
That this was a solution to some APIs of Google Maps not working was new to me, and it's also the first time someone told me they fixed it this way.
The problem is that I can't find any information in which scenario verifying your domain fixes a Google Maps API related problem. I read through the Geocode API / Google Maps JavaScript API / Google Places API Web Service pages, but no where do I see something about the need to verify your domain ( I could of course have missed it ).
Does anyone know when you need to verify your domain if you want to use the Google Maps APIs? Normally it works fine without doing it, but in his case it wasn't, and I really like to know what he could possible have done to make it a requirement.
You shouldn't need to verify the domain for using Google Maps API.
You need to generate one API Key for your app so you can use it when you call the Google Map JavaScript API like this:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
Substitute the value YOUR_API_KEY for the one that Google generated for you.

Resources