Google Places API Search, Instead of 20 Results can I get lower than 20 so 10 etc? - api

So i'm currently loading in the places from the google places API, and obtaining the 20 results with the next page token. However is it possible to obtain say 10 results instead of 20?
Thanks!

Related

Api call to all itunes stores

I'm looking to forward information to my google spreadsheet. Using the documentation for Itunes search on a specific movie, for example I tried, https://itunes.apple.com/search?term=AvengersEndgame&country=US&entity=movie and using a API connector add-on for google spreadsheet, this returned one result for the US store only, based on this movie.
Now adding the same parameters but changing the country code to CA would show the information for the Canada store. https://i.imgur.com/SPEdQj5.jpg
Now using them together as in
https://itunes.apple.com/search?term=AvengersEndgame&country=US&entity=movie
https://itunes.apple.com/search?term=AvengersEndgame&country=CA&entity=movie
https://i.imgur.com/X2GgUhL.jpg
it shows two results, nicely, but not always. Somehow it returns an empty .JSON request and I end up questioning why.
When I try to go furthur and add more stores by adding parameters but changing country letters, I end up recieving more and more empty .JSON requests.
That's when I realized I can only get about 20 calls a minute, I did end up being able to call for about 19 stores.
https://imgur.com/K52onOh with good results.
As there are about a 155 stores in Itunes, I'm looking for a faster way without the hassle of adding 155 of these parameters knowing it will not work as i can only call about 20 results a minute. Could I maybe call in a function to have it search 20 calls every minute untill all 155 are done for which then will be placed in different tabs in a google spreadsheet?
when i try a different movie on Annabelle Comes Home, i end up getting these errors when trying multiple stores.
https://i.imgur.com/CSvMbVu.jpg
using only 1 store for example US, shows a correct result. So what causes the error?
Hope someone can help me with this, as I have the parameters but looking for a way to cover all stores and get them on a spreadsheet which i can then furthur edit for a nice list. As not all stores have to be covered, i've broken down the list to 55 stores.

Any way to get random places from Facebook Search Places API?

I have been working with the Places Search API in Facebook's API Explorer. Currently I am returning results limited to 20 per page, with countless pages. For my application I would like to retrieve 20 random places.
I have tried using the offset pagination to specify a random offset, but the offset parameter doesn't seem to be working, as it is returning the same ordered results. I could just iterate through each page using cursor pagination, but this would return every result and seems illogical. Any ideas on how to this can be done?
My current call: https://graph.facebook.com/v3.2/search?pretty=0&fields=name%2Ccheckins&type=place&center=40.7304%2C-73.9921&categories=[%22FOOD_BEVERAGE%22]&distance=10000&limit=20

Youtube data API version 3 pagination

I understand that youtube response contains the next and previous page tokens and we can use those to go to previous and next pages.
eg :
https://www.googleapis.com/youtube/v3/search?&key={key}&part=snippet&maxResults=20&order=viewCount&q=abc&type=video&videoDuration=long&videoType=movie&pageToken=Cd323A
My question is how can I navigate to nth page of particular search?
Please note that some people may see this is impossible. But I have seen some site implemented this.
Youtube API only provides NextPageToken and PreviousPageToken, that's it, sorry: see documentation here: https://developers.google.com/youtube/v3/docs/videos/list
You can still make a pagination item but you will have to implement it by calling multiple times the URL, passing the NextPageToken as pageToken in your requestion every time, and caching results.
By the way, this question is already answered here (see the 1st point of the answer): youtube data api v3 php search pagination?
Quoting them:
In particular your case where you need 50 pages per page and you are
showing 3 pagination like (1,2,NEXT) then you need to fetch results
two times. Both the results you will keep in cache so for page 1 and 2
results will be retrieved from cache. For next you make it sure that
you are making query google again by sending nextPageToken.
Thus to show pagination 1-n and every page 50 results then you need to
make n-1 queries to google api. But if you are showing 10 results per
page then you cane make single query of 50 results using which you can
show first 5 pages (1-5) with the help of retrieved results and at
next you should again send next page token like above.
NOTE- Google youtube api provide 50 results max.
nextPageToken and prevPageToken comes with the api request.
Now you save the token in an array and then insert it as a nextPageToken in another api call and you will get the next page. The same way you will get a prevPageToken when u get the next page results.
Hope it helps.

Why Google Places API not showing all photos?

When I do a request like this it show me 1 photo_reference but in the url of this site in Google + there are 12 photos.
How I get all the photos from Google +?
You have to request the "place/details" to get all the details about it.
something like this.
https://maps.googleapis.com/maps/api/place/details/json?reference=Image_ref&key=YourKey
It's probably lat XD, it was asked two years ago.
From the manual here:
Note: The number of photos returned varies by request.
A Find Place, Nearby Search, or Text Search request returns at most one photo element in the array.
A Place Details request returns up to ten photo elements.
It is unclear to me if you can get more than 10 photos.

Twitter Search API - Unusable?

After many tests, I've been unable to get the Twitter Search API to return more than 80% of tweets containing a specific keyword or hashtag. This is not related to the maximum number of results, one test involved a hashtag which had been tweeted 50 times and only 15 of them were returned by the Twitter Search API. The same results were returned when using Twitter's own search tool.
Is the Twitter Search API simply a tool for getting estimates and trends, rather than accurate data?
Has anyone found a way to capture 100% of tweets containing a specific keyword or hashtag?
Twitter filters search api for better results. Here is a quote from developer site:
Both the Streaming API and the Search
API filter, and on some end-points,
discard, statuses created by a small
proportion of accounts based upon
status quality metrics. For example,
frequent and repetitious status
updates may, in some instances, and in
combination with other metrics, result
in a different status quality score
for a given account.
Search api simply returns a subset of the found tweets.