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

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!

Related

Amadeus Flight Inspiration Search not working properly

I've already tested the Flight Inspiration Search on test mode and worked fine with the restricted data, so I've decided to move to live with the API. Anyway, it looks like I'm still getting restricted data, because I've got errors (code 500 - not supported origin and destination) for airports like JFK, LTN, etc.
I've changed the base URL and the credentials, so it should retrieve the proper data. Do you have any suggestions for this?
The Flight Inspiration Search API is built on top of a pre-computed cache this is why, even in production, you don't return all possible options. The API computes every day the most trending options based on past searches and bookings and fills the cache, which means that the cache is dynamic. That's why you don't return anything with your defined criteria.
For real-time data you should use the Flight Offers Search API.

Cache strategy for google places api nearby result.

Im trying to figure out how i would go about caching the result i get back from a nearby search. So i can get upto 60 places based upon my current long lat position.
So im thinking that if user1 ask google for nearby places within a radius of 1km from position long: xxx lat: xxx. And i get a result back with places. And then user2 is asking for nearby places 500m away from user1. Then i would like to be able to use the cached data that user1 already fetched from google.
Any suggestion on how i would go about implement this kind of functionality?
Or should i just cache each place by their long,lat and implement my own geosearch?
I'm not aware of any built in google maps library that allows you to do radius search without calling the server. Best bet would be to make your own geosearch on the fetched points or use an open source library to help you.
If you do use cached data but remember that there's no guarantee how much of the 60 places fetched in a 1km radius are also within the 500m radius. If you did another query for 60 places within a 500m radius you'd get more accurate information.
Disclaimer: Google has certain rules in place about caching data. 10.5 d) https://developers.google.com/maps/terms#section_10

What is the maximum results returned for YouTube Data API v3 call

Context
I am in the process of providing some consultancy on doing a HTTP GET using YouTube Data API V3; in order to develop a Windows based application to GET a list of results from Youtube, for say a specific CATEGORY, or a specific TAG.
We are open to using any programming language(I'm from a C++ background and am hoping You tube will support direct HTTP connections without using Google client SDK and so on) to connect to YouTube and (HTTP) GET data.(Once a month or so, so YouTube API quotas should not be problem).
The Issue
We are being told by some of my client's web developers that YouTube API v3 will only return a maximum of 500 records/results, for say a query that returns JUST the Total viewers, the Video's link, and basic meta data such as that.
S, say I wish to find 5,000 results for category "House music" or "basketball" - and I have the Developer Key etc are all set up, would that be possible?
If so, what GET fields would I need to populate(such as "max_results_per_page")?
Thank you.
The API won't provide more than ~500 search results for any arbitrary query. It's by design. Technically, it means that the nextPageToken field won't be returned once you hit ~500 results. No additional parameter can change that.
If you want more than ~500 results for a query, you have to split it into more specific sub-queries. I'd suggest using the publishedAfter and publishedBefore parameters to achieve that, but feel free to experiment with the other ones here.
This only holds for the search-Query. Other queries like "PlaylisItem:list" deliver more results. I have tested with 100.000 items to get the videos of a playlist.

Why do I get the 'Oops' error from Instagram API location search (when using coordinates)?

I'm tring to search locations with the Instagram API in my application but also when testing with Apigee, I get 500 Internal server error, and Oops, an error occurred.
Apigee: https://apigee.com/console/instagram
Authenticate yourself and add this URL: https://api.instagram.com/v1/locations/search?lat=40.758896&lng=-73.985131
It should return Time Square locations. It worked a few times in the past, but currently it doesn't.
It would be an overkill to use the Foursquare api to search for locations, then pass the location id to Instagram. Is that the only way to get around this? Because once you know the location's ID it works ok.
My possible solution would be to let the user find the desired location here: http://worldc.am/id/47383924f964a520444c1fe3
And use the v2 foursquare API location ID for Instagram.
The Instagram API is pretty bad in that regards - it often just says "Oops an error occured!", without giving you any more info.
I believe their servers have a really low time out limit. Add the parameter distance=500, or even less, and you won't get this error any more. Basically, in a high density area (like a big city), you need to specify a small distance number, otherwise Instagram's server just times out while serving your request.

What's wrong with my Twitter stream bounding boxes?

Given this url, I should see tweets around London, right?
http://stream.twitter.com/1/statuses/filter.json?locations=51.23,-0.28,51.68,0.25
But nothing happens :(
I tried different areas but I couldn't get nothing at all, although I'm trying areas given in the doc, neither using cURL / POST.
When I add a keyword track parameter, I get ton of tweets -- but it doesn't mean that location works (location bounding boxes are logical ORs w/ other filtering params).
http://stream.twitter.com/1/statuses/filter.json?track=royalwedding&locations=51.23,-0.28,51.68,0.25
Thanks !
In my experience with the Streaming API, I have found that there's a surprisingly small amount of geotagged tweets. And, it's possible your locations are too restrictive. But when you add the keyword parameter, as you state, you're getting OR'd results back for both searches -- Twitter does this so you can perform multiple streaming queries on the same connection.
If you try
http://stream.twitter.com/1/statuses/filter.json\?locations\=-180,-90,180,90
You get all sorts of responses back.
EDIT: oops, also, you have your longitude and latitude backwards. longitude comes first in their API. This URL works:
http://stream.twitter.com/1/statuses/filter.json\?locations\=-0.28,51.23,0.25,51.68