How to get the exact subscribers of own youtube channel throughout API - google-apps-script

i'm trying to retrieve the number of subscribers, but the number that I received was rounded, not correct number.
By seeing the API docs, it is impossible to get exact subscribers number throughout youtube data API. So, I came up with the idea that using Analytics API, However there is no way to fetch the number of subscribers. Is there any way to do this?? thanks.
(It is possible to see the subscribers number by opening youtube but I can't do this throughout API)

These are the only metrics that the analytics api provides:
annotationClickThroughRate
annotationCloseRate
verageViewDuration
comments
dislikes
estimatedMinutesWatched
estimatedRevenue
likes
shares
subscribersGained
subscribersLost
viewerPercentage
views
Source: https://developers.google.com/youtube/analytics/metrics
Also See: https://stackoverflow.com/a/63537230/12772716

You can get the current subscribers via the YouTube Data API:
https://developers.google.com/youtube/v3/docs/channels
under statistics.subscriberCount
Additionally you could calculate the historical subscribercount by combining YouTube Data and Analytics API:
subscriberCount - (SUM(subscribersGained) - SUM(subscribersLost))

Related

Getting storage usage from Google Contact/People API?

I am trying to get the remaining space of one's Google Contact.
This FAQ says every account has 20MB / 25000 contacts. But the People API does not have any REST resource to list one's storage.
How can I get the storage usage/space through People API?
Answer:
This information is not available to People API nor the deprecated Contacts API.
Workaround:
In order to see how many contacts you can still add, you can check how many contacts you currently have via people.connections.list and deduct that from the contact limit (25,000).
File a feature request:
If you think this functionality could be useful, I'd suggest you to file a feature request.

Monitor Google API usage programmatically?

https://console.cloud.google.com/apis/dashboard
If we open google console we see how many requests per every service has been done. Is there any way to export these counters? I was not able to find any API which is responsible for these counters.
Get google maps api usage info
Detect Google Maps Javascript API limit for map loads
Many years passed, still no way to setup alerting for API usage? If there is no programmatic access may be there is some way to setup alerts when API usage is above threshold?
As mentioned by the first answer, there's no such API to monitor these usages but there are couple of ways to monitor your usage which are:
Setup Budget Alerts, this will trigger notification if you've reached a certain amount of your specified budget for a month, but please note that this will only notify you and will not actually stop the usage after the specified amount.
If you would like to monitor or get an overview of your daily usage, you may implement what we call channels with the help of BigQuery Export. This will give you a breakdown report of daily usage. The standard SQL code you can use to retrieve such report using the BigQuery export is:
SELECT Date(usage_start_time, "America/Los_Angeles") AS billing_day,
invoice.month AS invoice_month,
service.description AS service,
sku.description AS sku,
(
SELECT l.value
FROM Unnest(labels) AS l
WHERE l.KEY = 'goog-maps-channel' ) AS goog_maps_channel,
Round(Sum(usage.amount), 2) AS usage_amount,
usage.unit AS usage_unit,
Round(Sum(cost), 2) AS cost,
cost_type,
currency
FROM `PROJECT_ID.DATASET_NAME.gcp_billing_export_v1_BILLING_ACCOUNT_ID`
WHERE invoice.month = '201906' -- Change the invoice month with the same format as the example.
GROUP BY billing_day,
invoice_month,
service,
sku,
goog_maps_channel,
usage_unit,
cost_type,
currency
ORDER BY billing_day,
service,
sku
You may learn more on how to setup the BigQuery export here.
If you want to restrict your usage up to a certain amount per day, you may also implement the Capping of API usage wherein it will only allow an API to call a specific amount of requests per day.
If you would ever need help in the correct calculation of requests per day for each API to be on a certain budget, you may reach to the support team of the Google Maps Platform APIs here.

Google Maps API - Number of customers for places

I'm reading the documentation of GM-APIs, I found the section relative to "Places", but I can't find anything to get the information about the per-hour number of customers for a certain place.
Do you know whenever you search a place on GMaps, there is an indication of the frequency of customers, in that way you can know if the place will be busy or empty.
Is there any way to retrieve that information through Google Maps API?
Currently, there is no available feature in Google Maps API that could get the exact number or the of people in an establishment to determine its busiest time of the day.
However, there is an existing Feature Request in Google Map Platform's Public issue tracker to expose the place's popular times which seems to be related to the feature you are looking for.
Here's the link to that feature request: https://issuetracker.google.com/35827350. You can star/favorite this feature request and feel free to leave a comment there regarding your use case for additional information as well.

Google Places API - downloading user reviews and star ratings

TL;DR - I need help using Google Places API to download star ratings and user reviews of multiple stores and I am too dumb to figure out what I am suppose to be doing. Please help!
For the life of me, this has been hard to find any sort of useful info or documentation in terms of trying to download user ratings and star reviews from multiple locations. Just to give you a bit of info, I work for a company that has three major brands with over 500 stores across the country. We have multiple listings and our senior stakeholders are wanting to get their hands on what our customers are saying about our brand and particularly see who are top performing stores are (and who are NOT are top performers) in the form of star ratings and user reviews.
Now to get those sorts of insights is pretty easy to do for one location, but for multiple? It seems Google doesn't have that feature on hand.
According to the Google Community, I would need to use Google My Business API (see thread 1) However Google Support told me that for what I am looking to do required Google Places API. So after heading over there, I found this which makes this the most possible way I can get what I need Google Places API
Now I am stuck at the part about loading libraries. Darnit, surely there is a way I can just make an API request to get what I want, no?
I am throwing myself on the mercy of you smart people (I have the basic knowledge and I am a person who learns by doing) so your assistances will be deeply appreciated.
Using Places API web service you can get up to 5 reviews when you execute a place detail request. Rating is also available in the response.
Please have a look at the documentation:
https://developers.google.com/places/web-service/details#PlaceDetailsResults
Currently, there is no way to get more than 5 reviews in Places API. You can see a feature request in the public issue tracker, however, it looks like Google didn't set a high priority on this task:
https://issuetracker.google.com/issues/35825957
If you are the owner of the place in Google My Business, you can use Google My Business API to retrieve a list of all reviews for your place:
https://developers.google.com/my-business/content/review-data
Hope it helps!

Can users rate a restaurant by using google places API?

I am able to get restaurants list, timings, rating and displaying them in my Android application by using Google places API. This is API
https://maps.googleapis.com/maps/api/place/search/json?location=13.0104611,80.2086226&
radius=10000&types=cafe|restaurant&hasNextPage=true&nextPage()=true&sensor=false&key=MY_API_KEY
As per my client requirement, Users should be able to give rating to a specific restaurant from my application, this restaurant got from above Googel API.
Kindly tell me whether possible or not giving rating to a restaurant from above API . Thanks in advance.
According to the documentation, using the Google Places API Web Service, the following place requests are available:
Place Searches return a list of places based on a user's location or search string.
Place Details requests return more detailed information about a specific Place, including user reviews.
Place Add allow you to supplement the data in Google's Places database with data from your application.
Place Photos gives you access to the millions of Place related photos stored in Google's Place database.
Place Autocomplete can be used to automatically fill in the name and/or address of a place as you type.
Query Autocomplete can be used to provide a query prediction service for text-based geographic searches, by returning suggested queries as you type.
The only request that allows to put data is Place Add, but according to the documentation it adds a place that is available immediately in Nearby Searches initiated by your application and also enters a moderation queue to be considered for Google Maps.
So the answer is that for the time being it's not possible to add reviews to Places using the Google Places API Web Service.