对于我们的客户,我们使用 Youtube API v2 来获取带有特定标签的最新视频。我们在没有开发人员 key 的情况下获取了 URL 的响应。直到几天前,这一切都完美无缺。突然,我们没有得到任何结果。我们没有得到错误,而是得到了 0 个结果。
经过一番摸索,我们发现这是因为我们可能超出了请求的限制。这是基于以下事实得出的结论:当我们使用 3G 移动设备访问与连接 WiFi 的笔记本电脑相同的 URL 时,我们得到了结果。
我的问题是:
- 如果我们超过了限制,是否有可能在我们的请求中出现错误?
- 不使用开发者 key 时的限制到底是多少?
- 是否有高级帐户可用于获取更多请求?
提前致谢!
[编辑] 当我们请求 URL https://gdata.youtube.com/feeds/api/users/AEGON/uploads?category=2012Q4&alt=json ,我们得到以下 JSON 格式的响应:
(由于 Stack Overflow 上的声誉,我删除了一些链接)
{
"version": "1.0",
"encoding": "UTF-8",
"feed": {
"xmlns": "",
"xmlns$openSearch": "",
"id": {
"$t": ""
},
"updated": {
"$t": "2013-03-12T08:35:47.226Z"
},
"category": [{
"scheme": "",
"term": ""
}],
"title": {
"$t": "Uploads by AEGON",
"type": "text"
},
"logo": {
"$t": ""
},
"link": [{
"rel": "related",
"type": "application/atom+xml",
"href": ""
},
{
"rel": "alternate",
"type": "text/html",
"href": ""
},
{
"rel": "",
"type": "application/atom+xml",
"href": ""
},
{
"rel": "",
"type": "application/atom+xml",
"href": ""
},
{
"rel": "self",
"type": "application/atom+xml",
"href": "https://gdata.youtube.com/feeds/api/users/AEGON /uploads?alt=json&start-index=1&max-results=25&category=%7Bhttp://gdata.youtube.com/schemas/2007/keywords.cat%7D2012Q4"
}],
"author": [{
"name": {
"$t": "AEGON"
},
"uri": {
"$t": ""
}
}],
"generator": {
"$t": "YouTube data API",
"version": "2.1",
"uri": ""
},
"openSearch$totalResults": {
"$t": 0
},
"openSearch$startIndex": {
"$t": 1
},
"openSearch$itemsPerPage": {
"$t": 25
}
}
}
最佳答案
回答您的问题,
您将收到一个代码为 403 的 HTTP 响应和一个响应 正文包括
[<errors><error><domain>yt:quota</domain><code>too_many_recent_calls</code></error></errors>]
过度请求。
没有这个限制,你需要停止请求10到15分钟。收到错误后。
对此一无所知。
引用:http://apiblog.youtube.com/2010/02/best-practices-for-avoiding-quota.html
关于youtube-api - Youtube API - 没有开发人员 key 的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15356151/