Get API Key for adsense requests - google-api

I'm using the API Explorer tool to create some request urls for google adsense here. Here is the request url that they gave me that gives a response of today's earnings:
https://www.googleapis.com/adsense/v1.4/reports?startDate=today&endDate=today&accountId=MY_ACCOUNT_ID&metric=EARNINGS&key={YOUR_API_KEY}
However, I don't know how to get my API key for google developer to be able to recreate this url in my code.

The API key is created on the Cloud Platform Console. Please refer to this document and you will be able to do it. Hope this helps!

Related

My Google API keeps returning a limit reached error, when I am sure I am under the limit

I am currently building a NodeJS backend app that is querying the Google Calendar API. I have setup a new project on Google Cloud API platform and have generated all the required credentials. As stated by the google calendar API page, the allowed queries per day is 1,000,000. Since I am only querying for testing purposes at the moment, I am sure that I haven't even hit a 100. Yet whenever I try to query the API it returns the error:
"The API returned an error: Error: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
Also I have noticed that the dev console has generated a API key for me. Where am I supposed to put that?
My initial thinking is that Google API requires me to perform an additional signup using some CLI tools or something along those lines to signup. If not, where am I supposed to sign up?
Thanks in advance.
Note: I already have all the information from the cloud platform such as client_id, client_secret, project_id.
In "Error: Daily Limit for Unauthenticated Use Exceeded", they key word is Unauthenticated. Your request to the Calendar API is missing an OAuth Access Token. You will need to research Google OAuth.
This question has been answered many times. Please learn how to search SO for similar questions whenever you post a new question. https://stackoverflow.com/search?q=google+oauth+%22daily+limit+for+unauthenticated%22
To anyone who comes across this post in the future. I fixed the issue by using the project generated by Google Calendar API site (https://developers.google.com/calendar/quickstart/nodejs) by clicked the big blue "Enable the google calendar api" and then changing the name of the quickstart project that was generated. I don't know why it works now but it does and it's been working quite stably so far. Lets see how to goes.

Where to find espn api key?

I have been looking at the ESPN API. However, I have not been able to find documentation on how to get an API KEY. There is nothing in the Getting Started section about getting an API key. Also, I logged into ESPN and went to my Account Information, but I do not see anything there about an API key.
No, they have blocked the ability to register for an API key.
However, you can get NHL statistics for example by scrapping it from their official site using GitHub solutions such as this one:
https://github.com/sintaxi/nhl-api
If there are other open ones I am on the quest as well will be following this!

Do I need to get API Key for Google Book search

I am little bit confused interpreting the Google Book API terms. In this page it is written that
Note: Performing a search does not require authentication, so you do
not have to provide the Authorization HTTP header with the GET
request. However, if the call is made with authentication, each Volume
will include user-specific information, such as purchased status.
Does that mean I don't need to use an API key for searching book info or linking cover from google books (to be used in Android App)?
Thanks
For searching only the informations about books (author, title, etc..) you can write code without have any API key. But probably for the payment service or other (write a book and insert that in google book api) you should have an API Key (with sign up).
Bye bye
For searching only the informations about books (author, title, etc..) you can write code without have any API key. But sometimes google books API gives back HTTP 403. HTTP Status Code 403: The server understood the request but refuses to authorize it. So it is advisable you use the API key generated and also try to mention your country code in it. As sometimes it fails to recognize where the request is coming from so it gives you access denied (403) error.
https://www.googleapis.com/books/v1/volumes?q=intitle:${bookTitle}&key=${googleKey}&country=${countryName}
This query was used by me in a React application as sometimes without key or country name i got HTTP 403 error. countryName is of the form US or UK, etc.

Google places Api Key

I have searched through here for other questions related to the same topic and cannot find a definite answer.
My problem seems the same as many others in that I cannot get a response from Google Places Api.
I am trying from within an iphone app, yes the code is correct , I have checked and in desperation just resorted to wiping out the code to just make a request using the examples provided by the Docs on Google Places.
Tried putting the url into a browser, always the same response, whichever browser.
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST DENIED"
}
I have tried making new keys, same result and yes the identifer for the app is also listed.
Is there a time frame before being able to use the key.
Here how I've done this
1)You need to login with your google account
2)Google APi Console will Appear
3)Look out at Screenshot
4)you will find Services over there ,click on it where you can have choose API you would like to use
5)then go to API Access as shown in you can get your Google API Key.
Thanks
Advice -use your own Google API key
You probably need 'sensor' parameter in your request URL, I guess.
Just set 'sensor=false&' in the URL and try it.
In order to use the google place API, you need to do the following steps on https://console.developers.google.com:
You need to go your project.
1: Activate Google places API depending upon your clients: iOS, Android or web.
2: Then go to the Credentials section on the left.
3: Generate a SERVER key.
Insert that key into your google place api call. Example:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=SERVERKEY
Its a simple GET Rest call.
instead of this
The url: https://maps.googleapis.com/maps/api/place/search/json?location=-74.006605,40.714623&radius=5000&types=bar|police&name=&sensor=false&key=Api_key
use this
The url:
(https://maps.googleapis.com/maps/api/place/search/json?location=-74.006605,%2040.714623&radius=5000&types=bar|police&name=&sensor=false&key=Api_key)
%20 is for space

how to call a Google API

I read the following two pages on Google:
1) https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files
and
2) https://developers.google.com/accounts/docs/OAuth2WebServer
I can go as far as getting an access_token (OAuth2) to be used in a subsequent Google API call (I want to call Google Docs Listing or Google Drive).
I wanted to use curl or something similar and just form my https URL.
- As such in the 1st document states to form a URL as follows:
https: //docs.google.com/feeds/default/private/full
- In the 2nd document, the example states to use something like https: //www.googleapis.com/oauth2/v1/userinfo?access_token=xxxxx
(adding the access token to the call)
Several questions
- Do I call googleapis.com or docs.google.com?
- can I call https: //docs.google.com/feeds/default/private/full?access_token=xxxxx
just add the access token to the call?
thanks
You need some effort to approach a Google API the first time, but then it's easy and elegant:
Manual preparation (One-time action): Sign in to Google, create a project, enable the API in question, create new Cient ID.
Get OAuth code, refresh token and access token (one-time action).
Make the API call (repetitive arbitrary actions).
Here is a detailed explanation of the entire process - Steps to make a Google API call.
A practical sample based on the Google Calendar API with full demo code in a single HTML file can also be reviewed here - Easy and compact access to my Google calendars.
The fastest way to get started is probably the quickstart guide for the Google Drive API, which shows how to setup your environment and write a complete command-line app to upload a file to Drive:
https://developers.google.com/drive/quickstart
Hie you can go through the Google Docs Sample Available Here
it's a command line smaple but this same thing you can implement in android. it works for me. you will find "docs-cmdline-sample" in repo. that will help you.

Resources