500px / legacy-api-documentation

This is the 500px API documentation.
22 stars 9 forks source link

Geo search requirements? #185

Open jmbillings opened 8 years ago

jmbillings commented 8 years ago

I'm playing around with geo search.

If I search for an image using "term", and grab the lat/long values in one of the images, it works (in the format ?geo=1111111,2222222,10, for example)

If I replace the lat/long with ones from, say, the url of google maps, I get no results though.

Example:

I wondered if it was to do with the number of decimal places, but padding out the gmaps co-ordinates to the same length didn't help: https://api.500px.com/v1/photos/search?geo=51.5048413000001,-0.0728062000001,5 - NO results.

Any ideas?

vishna commented 8 years ago

@jmbillings API documentation states radius is either 'km' or 'mi' units so if you add km it starts to return some results.

https://api.500px.com/v1/photos/search?geo=51.5048413,-0.0728062,5km

I presume if you don't specify the unit the 500px backend defaults to meters as

https://api.500px.com/v1/photos/search?geo=51.5048413,-0.0728062,5000

will give you the same result set.

jmbillings commented 8 years ago

Ah- that might be it, I think I'd assumed it defaulted to km or something, I shall give that a try. Thanks!