Monitoring how many request by key - google-cloud-endpoints

I Possible trace how many requests an API key made on my gateway URL?
Because I need to create a report of the API usage.
Thanks

I see you are using google clouds endpoints, in that case it is easier just to go with the google products:
https://cloud.google.com/monitoring/custom-metrics/reading-metrics
Google cloud already provides all the metrics that you need.

Additionally to #Kram's response, if you need to monitor API usage per client (or not only per API key) you will need to create specific one GCP project per API client to able to track it

Related

Get access to clients data using API

Is it possible to make a platform where client can sign up and log in using their Google accounts, and accept that their Google Analytics data will be used for calculations.
They should accept the use only once, and then the program should download and process the Google Analytics data every day.
Please point me in the correct direction for documentation
Yes, you need to create a project in Google Cloud Platform, then go to : API and Services > Library > Google Analytics API. (This is to get analytics from an user). Then you need to create a project inside Firebase, allowing email authentication and you will be able to do your task.

List of clientIds of active users with Google Analytics API

I'm looking for a way to get the list of client ids of users that are currently on the website. Realtime reporting API seems to be giving just the metrics like the number of currently active users.
Is there any way to get actual client ids?
No, you cannot get that information with the Realtime Reporting API. Here is a list of all the dimensions and metrics that API allows you to query:
https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/
To expand on this a bit, none of the reporting APIs give you access to the client ID. You can, however, store the client ID in a custom dimension and send that along with all your hits. This will give you access to the client ID through the Core Reporting API, but it still won't give you access through the Realtime Reporting API.

How to GET data for multiple profile_ids in Google Analytics Reporting API?

Is there a way to fetch information for multiple ids in a single GA Reporting API query? See here for reference to the tool I am using: http://ga-dev-tools.appspot.com/explorer/
Tthe Google Analtyics core Reporting API is a little confusing. Core Reporting API - Reference Guide - Ids calls the Query Parameter ids but it is in fact singular. You can only send one id at a time.
Anwser: There is no way to send more then one view (profile_id) to the Core reporting api as a single request. You will need to loop over your request and send it multiple times.
Example:
https://www.googleapis.com/analytics/v3/data/ga?ids=ga:34896749&dimensions=ga:date&metrics=ga:entrances&start-date=2014-05-12&end-date=2014-05-22&oauth_token={OauthToken}
https://www.googleapis.com/analytics/v3/data/ga?ids=ga:34896744&dimensions=ga:date&metrics=ga:entrances&start-date=2014-05-12&end-date=2014-05-22&oauth_token={OauthToken}

Do we need to use API key for Google Geocoding API in production

I created a small project. I am using google geocoding API to get the latitude and longitude.
https://developers.google.com/maps/documentation/geocoding
Sample Request:
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true
Now I going to production. I am not using the commercial account. Do i need to add the KEY to my Request or not
Can some one tell whether to use the KEY or NOT
It's not required to use the key, but you should(the explanation may be found in the documentation)
Especially the key-based quota is important. When the domain you are using shares the IP with other domains you will share the quota for geocoding with all the other domains when you don't use a key. Of course this wouldn't be acceptable in production(at least for me)
#andrew
API Keys used for security and Google limits the free quota usage at some level.in production when your traffic gets increase you will need a billing account and billing account only works with API KEYs.
Google Maps Platform products are secured from unauthorized use by restricting API calls to those that provide proper authentication credentials. These credentials are in the form of an API key - a unique alphanumeric string that associates your Google billing account with your project, and with the specific API or SDK.

Google calendar API calls blocked by captcha

I have successfully written a tool to display upcoming calendar events on a website using Google's calendar API (v2). I am using the username/password method outlined at https://developers.google.com/google-apps/calendar/v2/developers_guide_dotnet#AuthClientLogin. Today an instance of this code would not return data or a decent error message. I finally logged into the web server and browsed directly to http://calendar.google.com and logged in using the credentials. I was challenged by Google's captcha and then my code worked.
How do I get around API calls being blocked by Google's captcha security? I don't want to have to re-code for magic cookies but I will if I have to. I have read some about generating tokens but I dont know if that is something I have to do once or every time the code is called.
If your app is a service that is getting used by many people, you might be running into API call bandwidth limitation. That is, google is limiting the number of API requests per time interval.
If this IS getting used by many people, you may have to upgrade to a paid account.

Resources