2013-03-12 54 views
3

对于我们的客户,我们使用Youtube API v2以特定标记获取最新视频。我们在没有开发人员密钥的情况下获取了URL的响应。直到几天前,这个工作完美。突然之间,我们没有得到任何结果。我们没有收到错误,而是获得了0个结果。Youtube API - 没有开发人员密钥的限制

经过一番困惑之后,我们发现这是因为我们可能超过了请求的限制。这是基于这样一个事实的结论:当我们使用3G上的移动设备作为与WiFi连接的笔记本电脑访问相同的URL时,我们得到了结果。

我的问题是这样的:

  1. 是否有可能,如果我们过了一个限度,以获得我们的要求一个错误?
  2. 什么是不使用开发人员密钥的限制?
  3. 是否有一个高级帐户可用于获取更多的请求?

在此先感谢!

[编辑] 当我们请求URL https://gdata.youtube.com/feeds/api/users/AEGON/uploads?category=2012Q4&alt=json,我们得到的JSON以下响应:

(我删除,因为堆栈溢出的声誉的一些链接)

{ 
    "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 
     } 
    } 
} 
+0

当你达到极限,您应该得到一个配额错误:https://developers.google.com/youtube/2.0/developers_guide_protocol?hl=nl-NL#Quota%5Ferrors – 2013-03-12 08:34:03

+0

奇怪的是,我们没有得到任何错误。我将在原始帖子中插入JSON响应。 – 2013-03-12 08:36:21

+0

我不认为配额达到了相同的结果。 – 2013-03-12 08:54:24

回答

0

根据youtube文档,您将收到一条错误消息,通知您超出配额。

检查Operation limits

1

回答您的问题,

  1. 您会收到的403码和响应 体,包括

    [<errors><error><domain>yt:quota</domain><code>too_many_recent_calls</code></error></errors>] 
    

    过多的HTTP响应请求。

  2. 有没有这样的限制,你需要停止请求10至15分钟。收到错误后。

  3. 不知道这个。

参考:http://apiblog.youtube.com/2010/02/best-practices-for-avoiding-quota.html

相关问题