Setting a Google Places API quota? - google-maps

I'm working on a project using the places api and I'm trying to stay in the free tier. The docs mention setting a daily limit, but the free-tier counts monthly quotas. If I set a 10k daily quota and I use it across different days in the month, will my 10k limit be enforced for the whole month or will I still be able to go over budget?

For questions such as these that doesn't involve coding issues/errors, it is best if you file a support ticket to them directly here. So moving forward, please use their channel instead. They will be able to address all your concerns regarding billing, pricing, free trial, setting limits and API level errors.
Now, if you wish to stay within, say, the $200 free credit you get per month upon enabling billing, there are a couple of things you can do.
Budget Alerts
Set a budget alert to warn you when you exceed your budget.
Note: this is not a hard cap on your bill, but an alert mechanism. The steps to do that are on the Billing documentation
To set up actual limits:
Set a Per API Daily Limit
For each API, you can set limits that are handled on a daily not monthly basis. The full guide can be found here. For the calculation on what the right limit should be, please take note of the tip in the link above.
You can use a simple equation to determine your daily cap depending on how much you want to spend. For example:
(Monthly spend / price per each )/30 = requests per day cap (for one API).
Note that your implementation may use multiple billable APIs, so adjust your equation as needed.
For instance, if you only use, say, the Maps JavaScript API, which has a cost of $7 per 1,000 loads, see this pricing sheet for your reference, you can issue 28,000 free loads per month. If you cap your Maps JavaScript API daily quota to 903 (i.e. 28,000 / 31), you will not be charged. Note that your application will run into errors once that limit is reached. Here are the steps for your convenience:
Go to your dashboard: https://console.cloud.google.com/home/dashboard and click "Go to API's overview"
Select the API
Click quotas
Under the Map Loads or Requests or Elements section (depending on the API you chose) at the very bottom, set your daily limits

Related

Spring Boot application payment method

I am currently the back-end part of a Spring Boot application and i am willing to integrate a payment method. But I can't seem to find the right payment option. I am a beginner in app development and working solo. Do you have any suggestions?
APPLICATION:
I am developing a platform where users can rent a car for a certain period of time. The application will have a react and android application on the frontend. The users can see the different locations of the available cars on a map within the react and android app. They can make a reservation for a car and unlock, drive and lock it after usage.
PAYMENT METHOD:
I am looking for a payment where the users admits to the payment when unlocking the car, but the price of the ride is not known yet. When the user is finished using the car, the price of the ride will be determined by the distance and time driven by the user.
POSSIBLE SOLUTIONS:
-PayPal: there is a possibility to let the user authorize a payment, but capture the funds later. The funds can be altered but only after three days and with a maximum value of 115 percent.
-CreditCard: I read in a lot of posts that storing creditcard information in a database is a big NO.
-Stripe: Don't really know, possible option?
Are there any solutions/examples of how this problem can be solved.
PayPal: there is a possibility to let the user authorize a payment, but capture the funds later. The funds can be altered but only after three days and with a maximum value of 115 percent.
There is no need to wait 3 days, that is a misreading of the authorization and capture documentation. If you have a need to capture over 115% of the initial authorization, contact PayPal about this. But a simple solution is to authorize something close to the maximum value of what you will need to dependably capture.
Stripe has the ability to place a hold on a card and then capture funds up to 7 days later for the amount you captured or less.
Place a hold on a card to reserve funds now but only capture them after your business completes the service. For example, a hotel may authorize a payment in full prior to a guest’s arrival, then move the money when the guest checks out.
When a payment is authorized, the bank guarantees the amount and holds it on the customer’s card for up to seven days.
You could place a hold for the maximum amount you expect to charge for the ride (say $50) then capture the actual amount when the ride completes (perhaps $23.50).

How to apply the filter in the Jobpayment.json service of the ServiceM8 Api

I need to apply the multiple filter in the
Jobpayment.json
https://api.servicem8.com/api_1.0/JobPayment.json
service how can I apply
Also I need to remove the allow maximum time to access the service limit per minute in the ServiceM8 Api.
Please help
I need to apply the multiple filter in the Jobpayment.json
https://api.servicem8.com/api_1.0/JobPayment.json service how can I
apply
TLDR; You can't use multiple filters through the API. If you want to filter by multiple criteria, you need to retrieve the whole endpoint and filter it locally.
Refer to this answer for more information:
https://stackoverflow.com/a/40400817/3544399
Also I need to remove the allow maximum time to access the service
limit per minute in the ServiceM8 Api.
You can e-mail ServiceM8 support, who can adjust the daily limit (quota) in certain circumstances. Regardless, they will inform you that their system automatically adjusts the limits for each user as it sees valid usage of the API. The exact thresholds of these increase triggers are not publicly documented, but supposedly the system would aim to achieve a certain amount of headroom and automatically make adjustments as usage is consistent and increase is gradual.
At the time of writing this, the per-minute limit is 60 (1 request per second). This is fixed, and not subject to increase. Attempting to exceed this limit will result in requests being throttled.

How to get public transport time schedule from The Google Maps Directions API?

I am trying to make public transport time schedule app using google maps directions api.
Whats the best way to get all of the possible departure_time's for a specific route from one place to another from a specific time?
The problem is, the server is always responding with only one route for one specific time. How can I get all of the following departure_times?
The worst way to do this is asking server every minute if there is some new travel link. But hey, its gonna take a lot of time!
So I thought google might be providing some kind of transport schedules but I can't find any info on google developers webs. I saw only the way to give google schedule information with the help of General Transit Feed Specification (GTFS) here or here.
But I can't find the way to get it from them.
I don't believe google maps directions api will return the information you are looking for as a collection.
The problem with transit data is that calculating a future schedule can require a lot of processing (especially if there are multiple routes involved in the rider reaching their destination) because, basically, the system needs to do a trip plan for each scheduled trip at starting point for the time range.
Google hints at this in their API regarding the alternatives parameter
alternatives — If set to true, specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server.
Also, the different future departure times may actually be different routes or combination of routes (e.g. where multiple routes may come together on the same street for a while - for instance, near a college campus or other transit hub)
In order to get the underlying route data that would have the actual stop times you are looking for you would need to download the transit agencies' GTFS data directly and process it yourself (check our GTFS Data Exchange). This is what your competitors are already doing (e.g. Transit App, Moovit, etc.). There are packages that will do some of this processing for you (e.g. One Bus Away). However, even with the use of existing libraries, there is some heavy lifting involved here (from a development point of view).
As a final note, if you want to pursue using google maps directions api you wouldn't need query it for each minute within a time-range in order to get a series of departure times. You should be able to make a series of calls with the departure time set just past the departure time you got back in the previous call. For example, if the first trip time was 1:00pm set departure_time to 1:05pm and request again, then if the second trip time was 1:20pm set the next departure_time to 1:25pm and request again, and so on to build your list of future trips.
Okay. Firstly your question is not in the right spirit as stackoverflow demands. Check at google's developer console , API section and check if they offer any such API to give you all transport schedules in 24hrs or not ? If there is any such API then good, you can hit that but if not then I am afraid you wont be able to get it unless you hit API after some intervals.
Another suggestion is that , you can try yahoo or bing maps and check if they have any such API for your query.

Routing around a set time on one or more of the waypoints

This is using either Bing Maps API or Google Maps API.
Problem: I am trying to create a route for a salesperson that may have 1 or more meetings that day plus visit selections from a pool. Meaning the salesperson has 1 meeting at a client and they want to stop by some leads but around that meeting time.
I doubt either service can handle this problem directly.Is their as way to get a "table of time between destinations" from these services, without running up my requests.
The only way I know how is to submit each variation on the route, store in a table or array, then based on the services "time to get there", calculate the best order. Then resubmit again. My client could easily burn off 20 - 30 requests per try.
Is there any other option? Maybe an free open source one with sh*ty algorithm then submit the final list to one of the above?
You can use the distance matrix service, see the documentation here:
https://developers.google.com/maps/documentation/distancematrix/
In this way, you will be able to compute multiple route between multiple points and certainly reduce the number of requests overall.
If your request is just to get an optimization for a sales man, you can also check the option on Routing service and its optimize option, see: https://developers.google.com/maps/documentation/directions/#Waypoints
On Bing, route optimization (waypoint reordering) is not available yet but you can achieve this with the Route Matrix API.

Google Elevation API - limits

I'm developing a map application that uses Google Elevation API. Today I spotted that I get
OVER_QUERY_LIMIT response. It is clear that I have reached my quota. Of course I have read documentation: http://code.google.com/apis/maps/documentation/elevation/#Limits.
There is a one thing I cannot understand though. Thus I have a question for you.
I pass only two points as a path but I want it to be divided into 250 steps. Does the following query gets info about 250 locations or two only?
http://maps.googleapis.com/maps/api/elevation/json?path=90.828934,-33.938923|92.983400,-2.552155&mapclient=flashapi&sensor=false&samples=250&key=KEY=xt&url=URL
I think it was impossible for me to check 25 000 locations in one day but if the above mentioned query gets 250 locations instead of two, then I have a problem :)
Thanks
In my experience, and according to the documentation, your request does count as 250 locations. Maybe you should use a lower number of steps and interpolate.
Keep in mind that even if it wouldn't, you are also subjected to a 2,500 requests per day limit.
A bit late, but someone might find it useful...
From the API documentation:
"Use of the Google Elevation API is subject to a limit of 2,500 requests per day... In each given request you may query the elevation of up to 512 locations"
I read that as saying a batch request counts as a single request so that shouldn't be the problem.
However, the Google Elevation API (and their other map APIs) also return OVER_QUERY_LIMIT if you access them to often in a short period of time.
"Additionally, we enforce a request rate limit to prevent abuse of the service."
To deal with this, in my functions I build in a wait parameter. This progressively increases the length of time between calls until either a response which isn't until OVER_QUERY_LIMIT is received, or until the wait is >500 ms (or other duration, depending on the application). If it's still returning OVER_QUERY_LIMIT I return OVER_HARD_QUERY_LIMIT to show that I've reached the limit for the day.