Sam Pettersson
Sam Pettersson

Reputation: 3227

Flickr API get image based on location

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.

Upvotes: 10

Views: 9586

Answers (2)

Tristan Angieri
Tristan Angieri

Reputation: 93

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

Upvotes: 3

0xcaff
0xcaff

Reputation: 13681

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

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

Upvotes: 5

Related Questions