searching query in whole of world by foursquare venue api - search

I take an string from user and must search its places in whole of world.
I want to use foursquare venues api.
but in that endpoint I must set search ranges by (ll and radius) or (sw and ne) or (near and radius).
now how search places for an string in whole of world ?

You can set the intent parameter to "global":
intent=global
See Venue Search Parameters:
global
Finds the most globally relevant venues for the search, independent of location.
Ignores all parameters other than query and limit.
For example:
https://api.foursquare.com/v2/venues/search?intent=global&query=apple+store&oauth_token=(YOUR_TOKEN)&v=20150721
If you use the global value, all other parameters except query and limit are ignored.

Related

How to setup Solr search across REST urls

We are implementing an API Portal and have a field named basePath to hold the base part of the api's rest url. Currently the field is defined as a string mapped to solr.StrField but we have search problems with this.
The problem right now is that in order to find an API by the basePath, we need double quote the value in the search. For example name:"/v1/api-proxy/generator" We cannot use name:/v1/api-proxy/* to see other apis that might have clashing urls. We know we have other urls like '/v1/api-proxy/validator' but something like name:/v1/api-proxy/* doesn't return any hits.
I am guessing a first step is to change away from 'string' to text or text_general, but how can search and find other hits that closely match the provided basePath?

how to list all places within 20 KM from point A

my goal is simply list all the places within 20 KM from point A, Im using Google Maps API to help me with this
I use node.js/Express + mongoose for the backend part.
For example, If i live at Point A, and if I open up my phone, it would show all the list of places nearby my location which is Point A within 20 KM
How would I achieve this in the backend?
What are the condition should I pass to mongoose to find the list of places, or my approach is wrong?
Place.find({}, function(err, places) {
res.json(places);
});
Use Place Search - Nearby Search request for places within a specified area. You can refine your search request by supplying keywords or specifying the type of place you are searching for.
Here's a sample Nearby Search request:
https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
Include rankby parameter to specifiy the order in which results are listed. Possible values are prominence, distance and location.
Here's a related SO ticket:
Google Nearby places search
An alternative is to use Places API Web services.
You have 2 aptions to search 1) Nearby search returns complete information of each place but it returns up to 20 results on each query and if more places available, it returns a "next page" token.
url="https://maps.googleapis.com/maps/api/place/nearbysearch/json?location="+lat+","+long+"&radius=" +radius+"&types=" + types + "&key=<PUT_YOUR_API_KEY_HERE>";
lat and long are your center coordinates. radius is measured in meters and is a value up to 50000. types is the type of Place you are searching according to this listing: https://developers.google.com/places/supported_types . Example: "atm"
2) Radar search that returns a reduced set of information of each place but it returns up to 200 on each query
url="https://maps.googleapis.com/maps/api/place/radarsearch/json?location="+lat+","+long+"&radius=" +radius+"&types=" + types + "&key=<PUT_YOUR_API_KEY_HERE>";
lat and long are your center coordinates. radius is measured in meters and is a value up to 50000. types is the type of Place you are searching according to this listing: https://developers.google.com/places/supported_types . Example: "atm"
You have more options to search, keyword & name appart from type. Keep in mind that you must specify at least one of them.
You can have your results on xml or json format.
Full definition of nearby and radar search is here: https://developers.google.com/places/web-service/search

Twitterizer Hashtags and metions search

I would like to do a search in twitterzer that allows me to get all the tweets with a particular hashtag mentioning a particular user on twitter. I used the .Search method but it only works for one query word (a mention or a Hashtag but no both). is that possible?
Thanks...
The Search method allows a string as input, so you're not limited to one word.
TwitterResponse<TwitterSearchResultCollection> searchResults = TwitterSearch.Search("#thisis40 to:conanobrien");
If you are not sure about the syntax of the query, you can use the advanced search on the Twitter website. Just fill in your parameters and copy the query.

Getting the location distance in a multi request

In trying to get a list of foursquare venues by id, I ended up using the multi endpoint.
However, the venues returned do not have a distance value from my current lat long
So, as an example I can use the venue endpoint
https://api.foursquare.com/v2/venues/43f9b9aaf964a520d12f1fe3?ll=47.62330382444445,-122.33604573666668
This will return a venue which has a distance value
However, trying to do the same using the multi endpoint
https://api.foursquare.com/v2/multi?requests=/venues/43f9b9aaf964a520d12f1fe3,/venues/40a55d80f964a52020f31ee3&ll=47.62330382444445,-122.33604573666668
This does not return a distance value
Any idea how to use the lat long parameter on a multi request?
I couldn't find much documentation on this
You need to pass the "ll" parameter as part of each of the requests listed out in "requests". Currently, the "ll" parameter is being interpreted as an argument to the "multi" endpoint, when you actually want it to be a parameter on each of the two "venues" requests.
You should URL encode the both of the full requests (including the ll parameter) and set that as the value of the "requests" parameter.

Using Flickr API to search photos by location or language

Some popular words, like "food," are used all over the world as loan words.
I am trying to use flickr.photos.search to get photos from one specific language or region.
I didn't find a setting for this in http://www.flickr.com/services/api/flickr.photos.search.html
I tried these two ways, but neither worked:
http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=XXXXXXXXXX&tags=food&format=json&location=japan
//lang=jp
I searched in Google and only found that YQL can search by location. (I will use YQL in another way, too many calls will over the api will be limited.)
I also found that in flickr.photos.search one can set a lat, lon, and radius, but the range is a circle, so this will not limit a search to a specific country.
None of these are good choices for me. Can anyone help?
There are actually a few interesting ways to do this.
The way I would do it is to first find the place you are looking for by using the place API:
flickr.places.find: http://www.flickr.com/services/api/flickr.places.find.html This will return a list of WOE (Where on Earth) ids for a given query. Your query can be anything from a street address to a country.
Once you have the WOE id, you could then submit a flickr.photos.search query including the optional place_id or WOE id.
Another fun way to do this would be to call the flickr.places.tagsForPlace method once you have a WOE id, and then search for your photos by these tags. This might produce more interesting results and also weed out the users who didnt specify a place, but did specify tags.

Resources