Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flickr API get image based on location

Tags:

flickr

Is it possible through flickr api or some other service obtain CC-images taken at the location the user is situated?

Like getting the lat and long from the browser and sending it to flickr and then fetching an image taken there? Similar to how the yahoo app on iOS does.

like image 269
Sam Pettersson Avatar asked Sep 25 '13 13:09

Sam Pettersson


2 Answers

Check out the flickr API documentation for flickr.photos.search.

There are optional lat, lon, radius and geo-context parameters.

like image 112
0xcaff Avatar answered Oct 07 '22 23:10

0xcaff


Here is an example url showing the format for an endpoint to search for photos at a specific location:

https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=e693af3d1f05789dfaad53030d8ba9e2&lat=37.7994&lon=122.3950&format=rest&api_sig=b5935d841e55cb4281b9c84701422ae8

I tested the endpoint in postman and in my browser, and it returns an xml including photos tagged to the lat and lon I specified.

The example was created thanks to some documentation here: https://www.flickr.com/services/api/flickr.photos.geo.photosForLocation.html

And the ever handy Flickr api explorer tool: https://www.flickr.com/services/api/explore/flickr.photos.search

like image 34
Tristan Angieri Avatar answered Oct 07 '22 23:10

Tristan Angieri