I am trying to get next page of results from textSearch call using next_page_token parameter but always get REQUEST DENIED error. According to Accessing Additional Results in google places search there is bug in documentation and pagetoken should be used instead of page_token. I tried both and it does not work for me. I can't find anywhere in documntation if multiple pages results available for textSearch.
"sensor" parameter should be specified for next page query. According to documentation "Setting pagetoken will cause any other parameters to be ignored" and this is not true, you have to specifiy "sensor" and "key" parameters.
Related
I want to get share count for a particular url from Google Plus.I tried by passing activity id in Activities: get to get share count. It is working fine but I want the same by passing only url alone.
In Facebook I passed only the Url as input in query url with input url and i got share counts for an url.Is there any ways available in Google Plus to get the share count by passing only url.
Referred site:
jonathanmoore/gist:2640302
Welcome to the world of Google APIs. The method in question
Activites.get
GET https://www.googleapis.com/plus/v1/activities/activityId
Takes a single parameter
activityId string The ID of the activity to get.
This is how this method works you must pass an activityId to it you can not pass a url. I can suggest running an Activies.list first in order to find the activity you seek.
You're best option is to use the Search API. Use the URL as the search term and page through all of the results until no more are found. You then have a number for how many times the URL has been shared publicly on Google+.
The documentation says how I can limit searches to a country by using componentRestrictions. However, the documentation apparently only relates
to JavaScript.
I'm doing a regular request from a PHP application, and need to limit a place
search to a country. However, I can't see how I can limit search results to a country using a regular GET request.
I believe you can just add components=country:XX to your request URL :)
I want to get all the restaurants near my location order by distance.
I am using textsearch with google places api using this url : https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurants&location=32.16107,34.806618&radius=200&sensor=true&key=api_key. The results that I am getting are sparse with no order what so ever. I tried rankby=distance but accurding to the documentation (https://developers.google.com/places/documentation/) you can use it only with regular search,means that when using textsearch there is no such parameter option (I tried it anyway -> not working).
I am using textsearch because regular search returns only "types" : [ "establishment" ].
How can I order by distance the textsearch of google place api ? I can't believe that google didn't create a way to do it...
You are correct, Places API Textsearch does not support the rankBy=distance parameter. If you believe that this would be a useful feature, please submit a Places API Feature Request.
You can however obtain the result you are looking for by performing a Places API Search Request using the rankBy=distance parameter and the keyword=restaurant parameter:
https://maps.googleapis.com/maps/api/place/search/json?keyword=restaurant&location=32.16107,34.806618&rankBy=distance&sensor=false&key=YOUR_API_KEY
The keyword parameter is matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content.
I'm basically querying the google places API for stores in atlanta.
https://maps.googleapis.com/maps/api/place/search/json?location=33.7488,-84.3874&radius=50000&sensor=false&key=YOUR_KEY_HERE&types=amusement_park|art_gallery|bakery|bar|beauty_salon|bicycle_store|book_store|bowling_alley|cafe|car_repair|car_wash|clothing_store|florist|furniture_store|gym|hair_care|home_goods_store|jewelry_store|laundry|liquor_store|museum|night_club|pet_store|pharmacy|restaurant|shoe_store|spa|store|veterinary_care|zoo
This as expected returns a result with a page token to get another page of data with the same query.
https://maps.googleapis.com/maps/api/place/search/json?key=YOUR_KEY_HERE&page_token=PAGE_TOKEN_HERE
According to their API this second URL is all I need to get the 2nd page of data. But it ALWAYS returns "REQUEST_DENIED".
"{\n \"html_attributions\" : [],\n \"results\" : [],\n \"status\" : \"REQUEST_DENIED\"\n}\n"
It's not clear WHY I'm getting request denied. I'm nowhere NEAR my daily limit. If I try to run the 2nd URL with ALL the given parameters from the first URL with the Token Included it acts as if I'm requesting the 1st page all over again and ignores the page_token entirely.
Has anybody gotten this page_token to work?!?!?!?!?!
This is a bug in the documentation and will be fixed asap. The correct parameter to use is pagetoken NOT page_token.
I'm basically querying the google places API for stores in atlanta.
https://maps.googleapis.com/maps/api/place/search/json?location=33.7488,-84.3874&radius=50000&sensor=false&key=YOUR_KEY_HERE&types=amusement_park|art_gallery|bakery|bar|beauty_salon|bicycle_store|book_store|bowling_alley|cafe|car_repair|car_wash|clothing_store|florist|furniture_store|gym|hair_care|home_goods_store|jewelry_store|laundry|liquor_store|museum|night_club|pet_store|pharmacy|restaurant|shoe_store|spa|store|veterinary_care|zoo
This as expected returns a result with a page token to get another page of data with the same query.
https://maps.googleapis.com/maps/api/place/search/json?key=YOUR_KEY_HERE&page_token=PAGE_TOKEN_HERE
According to their API this second URL is all I need to get the 2nd page of data. But it ALWAYS returns "REQUEST_DENIED".
"{\n \"html_attributions\" : [],\n \"results\" : [],\n \"status\" : \"REQUEST_DENIED\"\n}\n"
It's not clear WHY I'm getting request denied. I'm nowhere NEAR my daily limit. If I try to run the 2nd URL with ALL the given parameters from the first URL with the Token Included it acts as if I'm requesting the 1st page all over again and ignores the page_token entirely.
Has anybody gotten this page_token to work?!?!?!?!?!
This is a bug in the documentation and will be fixed asap. The correct parameter to use is pagetoken NOT page_token.