How to search specific user's tracks by tag with the Sound Cloud API? How to search specific user's tracks by tag with the Sound Cloud API? json json

How to search specific user's tracks by tag with the Sound Cloud API?


I haven't used this API before, but after a few tests i think i've found your problem.

You shouldn't use users as the first url segment because you aren't searching for users, you are searching for tracks filtered by username and tags.

Instead use tracks as the first url segment, and use the q parameter to filter the username. Then you can use use the tags parameter as well.

Test this url: http://api.soundcloud.com/tracks?q=username&tags=tag

SC.get('/tracks/', {q:'royaloperahouse', tags: 'insights' },  function(result) {     console.log(result[0].tag_list);});

To be honest i still do not understand the q parameter. In API documentation you find references about it in tracks, users, etc and in search page they talk about it too but i haven't found any documentation about what the q parameter is filtering in each query type. In tracks is the username (and possible user id)

If you are consuming this API, you should ask soundcloud team in their google group more the meaning of this parameter.


Try this (you'll have to check my syntax):

SC.get('/tracks/',array('user_id' => 'YOUR_ID', q:'royaloperahouse', tags: 'insights' ),  function(result) {     console.log(result[0].tag_list);});

or

SC.get('users/YOUR_ID/tracks/', {q:'royaloperahouse', tags: 'insights' },  function(result) {     console.log(result[0].tag_list);});


First, understand the difference between the user "id" and the user "permalink". They're both unique user identifiers, but they're separate things with different purposes. You can use the former, but not the latter, to access tracks. So instead of

http://.../users/royaloperahouse/...

you should be using

http://.../users/12127832/...

substituting 12127832 for the appropriate ID if you're looking for a different artist. Also, you should probably specify JSON as the return type. To conclude, your server call should look like this:

http://api.soundcloud.com/users/12127832/tracks.json?client_id=238947HSGDHSDG&tags=eric

Also: don't post your client ID on Stack Overflow!!!