Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Flickr API to search photos by location or language

Tags:

flickr

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?

like image 917
yuli chika Avatar asked Jun 24 '11 22:06

yuli chika


People also ask

How do I search by location on Flickr?

Open up the Map tab, find the place you took the photo, or shot the video - either by searching for an address, or dragging and zooming the map around - and then drop your photo on the place you took it.

What provides an efficient way to find Flickr images?

Flickriver Flickriver is another simple Flickr search engine. You can search photos, groups, users, tags, and even places.


1 Answers

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.

like image 155
citizen conn Avatar answered Sep 28 '22 18:09

citizen conn