Search by geo filter with soundcloud api

2020-07-17 16:48发布

问题:

When attempting to search for tracks based on 'geo' filter I always get back zero results. According to the documentation you can use ***** as a wildcard to search lat/lon ranges that exist in the 'tag-list' of each track in the server response. And we use the 'tags' filter when issuing our POST request.

For example

HttpResponse response = api.get("/tracks?tags=geo:lat%3D52.0*", null);

returns zero results.

I have also tried omitting the 'geo:' namespace reference, tried all sorts of variations of the lat/lon string for example 'lat=52.0' 'geo:lat=52.0*'. Tried both urlencoded and non urlencoded values, nothing seems to work.

If i just do

HttpResponse response = api.get("/tracks?tags=geo:", null);

This will bring back results that have a geo location referenced in the tag list, so there are tracks in the data base that have been geo tagged for sure! I have copied one of these geo: locations from a random track into the POST params of the api request and it doesnt find the track.

One more person to my knowledge has filed this issue on SO a month ago, using JQuery Soundcloud api: Geo Tag search not working

Any help would be greatly appreciated.

(FYI the null parameter in the code I use above is just another option of passing The post parameters, you have the choice to use A NameValuePair Object, Ive tried it this way too but had no success [when searching on geo filter])

回答1:

This should work

HttpResponse response = api.get("/tracks?geo:lat%3D52.0*", null);