Different responses when using Google Distance Matrix API - api

I have two postcodes (A) and (B) and I am seeing different distances and durations between A to B and B to A and while this matches the Google Maps website, we have seen the distance and duration between A to B in that direction change from one day to the next.
I don't believe the API request URL is set to include traffic so I don't know why Google has altered the primary preferred route between when we first ran this request and the second request.
I hope that makes sense.

I did my research and I found that both Distance Matrix API and Directions API alters their duration_in_traffic value for my requests with periods which is about 30 seconds. It just gives me 1 of 2 possible values with difference of couple seconds. So obvious solution is API response local caching.

Related

Get different results every time when call google places API based on lat long and radius

I'm getting different results every time when I call google places API. I'm using https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=1500&keyword=cruise&key=YOUR_API_KEY API and put location lat & long & radius dynamically and call multiple times back to back. So I get different output every time. It gives me Zero results or 2-3 places on same API.
Check below images.
You are getting different results because Nearby Search responses may be missing a few results occasionally; this is intended behavior for the API due to the distributed and constantly evolving nature of Google Maps.
Check out this issue reported in Google's Issue Tracker for reference https://issuetracker.google.com/issues/119250563
Hope this helps!

Enterprise or Self-Service API - Request suggestion

I'm in the process of devolving a new tool for a company app. The tool will be sending homogeneous number of searches to amadeus API. Is every search result is considered as a request? A sample search of a user will have to search the api 1000 times are these searches considered as requests? Because if the company has 10000 request limit per month it's going to be over by 10 users! I need to understand this please.
Every time you call an API (every time you use GET/POST verb) you do a "request".
The limitation (quota) is only in the test environment, you don't pay for it but you have a limited number of calls and you only have access to a subset of data.
In production, you don't have any limitation on the total number of queries you can do. You get access to our full set of data (live) but you pay per use (you pay for each request you do).
You have a limitation on the number you can do per second (TPS: 10 in production / 5 in test).

FogBugz api request for flat time estimates

I have a FogBugz application which gets data from their api and generates some reports. I need to get the hours estimate for each individual case I search for. From their API I can see that you get the hours, however those hours include all the ones of the child/dependent cases. I do not want those included in my results.
How can you request the time estimates for a specific case in fogBugz? As an analogy, If I do the current request with hrsEstimate I get a result which In FogBugz's WebApp equivalates to Grid View- Outline. I need to get the result that equivalates to Grid View - Flat.
Does column hrsCurrEst work better?
http://help.fogcreek.com/the-fogbugz-api/cases#Column_Titles

Many requests in an API vs Many separate requests

I am making an application based on Google maps API. This requires requesting for distance between two cities. Now I want distances between many cities.
So should I use "for loop" and make many requests separately or should I send all the cities names in one link. Which one will work faster? And which one will be better?
For sure you should avoid sending multiple requests, because each roundtrip to a server takes time.
However when you are grouping many requests this can also take a long time (both to send, and to process on the server), and affect the user experience (long waiting time).
In your case I suspect that the "for loop" will not load to a lot of data, and server side processing will also not be too heavy, so sending a grouped single request should be the way to go.
You can use the "DirectionService" sevices ,which is providing by Google i.e "api3".
You can find the distance between the Many cities ,it takes one origin point ,destination point and 8 way points (total 10 places) for one request and it provides a JSON file
in return ,which contains all the information (distance in KM,value meters,city names and lot more) .Please check this link, https://developers.google.com/maps/documentation/javascript/directions . i hope this answer will meet your requirement,otherwise don't mind.

Calculate actual distance between two points using Google Directions API

In my iphone application i am creating a route between two points and using the google directions api to show the html instructions, step distance for each turn in text format.
When using the Directions API i had observed that when the user moves from location A to location D and there is a turn at location B, then the user is notified regarding the turn (i.e in the step of the json response from the direction api ) at point A' (consider A' between A and B). Now the distance of this step should be till location B, but i had found that it is till location B' (which appears after B), now again if i have a turn at location C
then the start location of step should start from location B, instead it starts from B'.
So my question is how would the user know the actual length of the step. Kindly help.
Thanks in advance
This doesn't really answer your question, but I thought I should mention it anyway.
Once iOS 6 rolls out in a few months, you won't be able to use Google's services to do this. Not for any technical reason, but in their TOS, they explicitly state that if you use their mapping services, they must be used in conjunction with their maps. Since Apple is using a different map provider come iOS 6, you would be in violation of their terms.
I had solved the issue related to calculate the actual length of the step.
Actually i was simulating the current location by taking fake locations and testing it.
In live mode (i.e while testing the application on the road) it works perfectly fine.