soundcloud search api ignoring duration filter?

I'm experimenting a bit with the soundcloud api... Cool stuff, however:

It looks like when I try to apply a filter to search for tracks, the api ignores the duration...

See code snipper below. The purpose is to search for (10) trance tracks in the last 2 months, ordered by popularity, that have a duration of more than an hour.... As far as I know, the duration has to be specified in milliseconds (hence the * 100) Btw, The soundcloud object is SC, initialised with my API key

Am I doing something wrong, because then I look at the console, most tracks are less then an hour?



Soundcloud.get("/tracks", {
   genres: "Trance,trance",
   order: "hotness",
   limit: 10,
   created_at: {
       from: moment().subtract(2, 'months').format("YYYY-MM-DD") 
   duration: {
       from: 3600 * 1000 // seconds * 1000
}, function(tracks) {
   console.log('tracks', tracks);



I'd recommend you to use "duration[from]" instead of your object definition. It's what I use and SoundCloud gives me consistently matching results.

Secondly, change your format in the created_at param to .format("YYYY-MM-DD HH:mm:ss").


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.