How do the limits work for the Google Javascript Places Library? - meteor

I'm working on building my first web/mobile app with Meteor, using Javascript for both the client and server.
Essentially, the app will allow users to rate restaurants based on a variety of factors, such as how loud it is or how nice it smells. The averages of each of these attributes would then be stored in my database along with the Google ID of the associated restaurant. Other users can then search for places near them and sort the results based on any of the rated attributes.
So if a user requests a list of places and a request is made to the Google places library API, and then those places are matched against data in my database, how are the limits applied? Since the server is also running with Javascript, can I call the API with the server? And if I do, is the API able to distinguish between different users and apply the individual limits? Or if it's all coming from a single server will it give me a total limit equivalent to a single user?
Thanks for any help and guidance.

The Google Maps JavaScript Places Library does not have a documented limit. However, if you perform request that have gone over its request quota, you will get OVER_QUERY_LIMIT. So maybe the Javascript API Usage Limits can help you to know more about limits by using this API.
Check also this related SO ticket.

Related

Automate API key generation on Google Cloud

We're currently working on our API based on Google Cloud Functions together with Google's API Gateway.
As every customer who buys access to our API should get their own API key, I'm wondering if there's a ways to create those API keys using and API. What I want to achieve is that a customer is able to request an API key in their own settings, so klick a button, this triggers a function, generates a key and shows it to the customer in front end.
After searching for quite some time, I didn't find anything about how this could be built. It could also be that my approach to this is totally wrong - if that's the case, please roast me and give me some advice with it!
Thanks in advance for your answers!
Google credentials can not be created programmttlcy they must be created manually.
In fact, there is something. A while in beta (more than 1 years ago) and quickly back in alpha, and undocumented (or pretty bad)
As you can see in the gcloud alpha command, you can use API Keys with CLI and API. Use this command to test and discover more how you can use API keys.
gcloud alpha services api-keys create --display-name="created by API" --log-http
USE WITH CAUTION
Firstly, I have no update on this API, will it survive or not? The lifecycle and the "no news" from Google is strange and keep in mind that the API can be removed at any time.
Secondly, API Keys is a long lived token and it's not recommended for security reason. But sometime, it's better than nothing, so to use it when no others solution are possible, it's acceptable. Else, prefer OAuth .
Eventually, API Keys authenticate a project, not a customer/user. You won't have it in header data after the API Gateway request forward. Only the Project ID (or Number, I don't remember). Thus, if you want to differentiate each customer/user, you need to create different projects, and generate a keys in each project. Same thing if you implement rate limit on API Gateway: Quotas are per project and not per API Keys.

How to set "Advertising Features" and other settings through Google Analytics Management API?

I'm trying to use the Google Analytics Management API to automate the management of a large amount of GA Properties, which is what it's for according to the docs.
However, I'm having trouble with a lot of settings, that it seems like are not available through the API. The expected format of a GA property resource is quite limited in the fields you can set, and it seems to not allow specifying other fields.
Specifically, I am interested in setting the "Advertising features", aka whether to enable the Demographics and Interest Reports:
When updating this setting through the GA UI, the field within the request seems to be called demographicsEnabled, but I cannot set or retrieve this value when using the Management API.
How can I set this and other values through the Management API, or other means? If only a small fraction of the settings for a property can be set through the API, that seems kinda useless for managing large accounts, as the docs claim you can do - so I assume there has to be a way I'm just not seeing here.
How can I set this and other values through the Management API, or other means?
You cant the management api is very limited in what fields you are able to update. Unfortunately unlike a number of other google apis documentation it doesn't actually tell you which fields are writeable. I will mention that to the team.
If only a small fraction of the settings for a property can be set through the API, that seems kinda useless for managing large accounts, as the docs claim you can do - so I assume there has to be a way I'm just not seeing here.
The API was not intended for managing large accounts IMO. It was probably only intended for getting information about what accounts a current user has access to.
What i suggest that you do is create a feature request asking for the ability to update the fields that you are trying to update. The team is normally very open to those types of requests.
Link it here and i will be happy to bring it to the teams attention next time i speak with them.
AFAIK this and many other features are not available in Management API.

Querying Link Over REST API

I'm running a few car simulations using the HERE Routing REST API, and I'd like to be able to get the accurate speed limit for where the car is so that it doesn't go too quickly or slowly for the simulation.
I can see that the speed limit is included within a link.
However, I can't seem to find how to get a link given its Link ID, or if that's even possible with the current API.
In the old API it seems like there was a getlinkinfo.json endpoint which ought to do what I need, but using it on my current freemium account says that I'm unauthorized.
Is this a feature tied only to pro accounts, is it deprecated, or is there just some other way I have to go about this?
As mentioned in the comment above getlinkinfo.json from Routing API has been depricated for sometime now and the alternative is to use HERE Telematics Advanced Data Sets API (https://developer.here.com/documentation/platform-data/dev_guide/topics/quick-start-view-map-data.html) The data is split into different layers and tiles which could be queried for link attribute information.

Will Google block my access if I use their features without token?

I'm using this link https://www.google.com/reader/api/0/stream/contents/feed/FEEDHERE?output=json&n=20
to fetch feeds using Google's algorithm. As you can see I'm not adding any other parameters, just fetching the returned data in JSON format. My app will be heavily used hopefully and if I send a lot of requests to this link, will Google block my access or something?
Is there anything I can include, like userip, url for my app (so if they have problem to just contact me) or something else?
The most basic answer to your question is that Google will change its Terms of Service whenever it likes, and you've got no say in the matter. So if it's allowed today, it might not be allowed tomorrow, at Google's whim.
On this issue, though, you seem fairly safe. From the Terms of Service (these is the general document, since Reader doesn't seem to have a specific one):
Don’t misuse our Services. For example, don’t interfere with our Services or try to access them using a method other than the interface and the instructions that we provide.
Google provides RSS and Atom. They provide these feeds, so I assume they expect that they'll be used. They don't say that it's a misuse to point someone else at those feeds, so it looks OK for now, but they could add such a clause at any time.
All online services are subject to the terms and conditions of the providers of those services. So, as others have said, they may be ok with your use today, but they can change their mind any time down the line. I doubt including a URL or email or contact info will help anything, because when these services change, they don't notify every user of the service, they just announce the change publicly, and usually they give several month's notice in order to give users a chance to adapt their applications, but this is not standardized or enforced so there is no guarantee. One example would be the fairly recent discontinuance of the Google Finance API (for which no replacement has been announced).
The safest approach would be to design your app such that this feature that uses google's functionality is decoupled as much as possible from the rest of your app, so that, when or if the availability of the service changes (ie it's no longer available at all) you can adapt your app to use some other source for the feeds with minimal impact to the rest of the app. Design for change and plan for the worst.

Fastest way to get basic information from google analytics api

My GA Account has a number(50) of profiles associated with it and I am trying to build an api which shows me the basic information like visits, bounce rates etc. for each profile.
This query gets me what I want from GA, but for each profile:
URL ="https://www.google.com/analytics/feeds/data?ids=ga:11111&start-date=2011-07-01&end-date=2011-07-02&metrics=ga:visitors&prettyprint=true&alt=json"
The id is table id and the metrics gives me the information I want.
Now the problem is, I want to show all the information together. So, everytime I will have to send 50 requests to the API, which just doesn't work out. Is there a way I can get the information for all the profiles associated with me in a single request?
You unfortunately will be required to perform 50 requests if you want metrics for 50 different profiles. You can easily automate this, however, by using a combination of the Management API and the Data Export API.
The Management API allows you to pull information about the account. For example, you can very easily pull all profile IDs and names associated with an Analytics account through this API for use in an automated query.
The Data Export API, which I am sure you already are familiar with, is the only way to pull collected data/statistics for individual profiles.
If you are concerned about speed, you might want to build an automated process that uses both the Management API and the Data Export API. Pull all of the profiles associated with your account with the Management API, then loop through each and pull the basic data you'd like through the Data Export API. Have this run at regular intervals based on your needs and cache it between runs. This way it won't execute every time the page is hit (though you honestly might be fine, depending on your traffic - I've found it to be extremely quick).

Resources