从 soundcloud 获取多个轨道的统计信息 [英] Fetching stats on multiple tracks from soundcloud

查看:27
本文介绍了从 soundcloud 获取多个轨道的统计信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得所有播放次数为 0 到 1 的曲目,并且正在查看 http://api.soundcloud.com/tracks/90891876.json?client_id=XXX URL,其中播放计数包含在 json 响应中.我们有将近 1500 个声音片段,是否有可能制作一个脚本来获取这些数据~1500 次,否则我会因为向 API 发送垃圾邮件而受到限制?我们只会多次使用此统计数据来衡量我们的广告系列如何尝试增加播放量.或者是否可以在一个请求中获取这些数据?

I want to get all tracks with 0 to 1 plays and am looking at the playback_count stats from http://api.soundcloud.com/tracks/90891876.json?client_id=XXX URL, where playback_count is included in the json response. We have almost 1500 sound snippets, is it possible to make a script that fetches this data ~1500 times or will I get throttled for spamming the connection to the API? We will only use this stats a couple of times to measure how our campaign is going trying to increase plays. Or is it possible to get this data in just one request?

推荐答案

我看到这个问题刚刚获得了风滚草"徽章,我感觉很糟糕.

I saw this question just earned the "Tumbleweed" badge and I felt bad.

如果曲目都归同一个用户所有,您可以使用此端点:

If the tracks are all owned by the same user, you can use this endpoint:

http://api.soundcloud.com/users/{id}/tracks

如果你只有一个曲目列表,你可以使用这个端点:

If you just have a list of tracks, you can use this endpoint:

http://api.soundcloud.com/tracks?ids=123,234,765,456,etc

在此处查看文档的过滤器"部分:http://developers.soundcloud.com/docs/api/reference#tracks

See the "filters" section of the docs here: http://developers.soundcloud.com/docs/api/reference#tracks

但请记住,尽管 HTTP 规范没有对查询字符串的长度施加限制,但默认的 apache 设置将返回大约 4000 个字符的错误.这个端点可能有大约 400 条轨道.玩弄它.也许 soundcloud 对每个查询的曲目数量有限制.

But keep in mind that although the HTTP spec does not impose a limit on the length of the querystring, the default apache settings will return an error somewhere around 4000 characters. That's probably around 400 tracks for this endpoint. Play around with it. Maybe soundcloud has a limit on the number of tracks per query.

这篇关于从 soundcloud 获取多个轨道的统计信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆