Youtube搜索API准确性

时间:2013-02-05 17:26:36

标签: youtube-api

我正在尝试制作一个简单的脚本,使用它的v3 API搜索youtube,但对于特定的关键字,我不会获得与youtube.com相同的视频。

这是我使用的网址:https://www.googleapis.com/youtube/v3/search?order=relevance&regionCode=US&type=video&part=snippet&maxResults=10&q=test&key=*****

任何想法API与youtube.com相比有多准确?

2 个答案:

答案 0 :(得分:0)

API应与网站具有相同的准确性。您使用相同的用户帐户进行测试吗?你能举一些具体的例子来跟进吗?

答案 1 :(得分:0)

我正在使用我的代码测试其他地区的搜索过滤器,因为我在阿根廷,并试图只获得3个视频。

我在API和YouTube页面中获得了相同的结果。

GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=3&order=relevance&q=test&regionCode=AR&type=video&key={YOUR_API_KEY}

我收到了这个回复:

200 OK

- Show headers -

{
 "kind": "youtube#searchListResponse",
 "etag": "\"GGhQgtOz7wdV-KaTX3akpjqktXI/ZQcMULMzhl7jNZmXCsem5ycElvI\"",
 "pageInfo": {
  "totalResults": 1000000,
  "resultsPerPage": 3
 },
 "nextPageToken": "CAMQAA",
 "items": [
  {
   "id": {
    "kind": "youtube#video",
    "videoId": "nCgQDjiotG0"
   },
   "kind": "youtube#searchResult",
   "etag": "\"GGhQgtOz7wdV-KaTX3akpjqktXI/4xgmXYRPkRjv8kxP_M5CKZQM2GM\"",
   "snippet": {
    "publishedAt": "2010-05-04T00:49:30.000Z",
    "channelId": "UCL8ZULXASCc1I_oaOT0NaOQ",
    "title": "Google Chrome Speed Tests",
    "description": "These speed tests were filmed at actual web page rendering times. If you're interested in the technical details, read on! Equipment used ...",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/nCgQDjiotG0/default.jpg"
     },
     "medium": {
      "url": "https://i.ytimg.com/vi/nCgQDjiotG0/mqdefault.jpg"
     },
     "high": {
      "url": "https://i.ytimg.com/vi/nCgQDjiotG0/hqdefault.jpg"
     }
    }
   }
  },
  {
   "id": {
    "kind": "youtube#video",
    "videoId": "N7-T53_pOSM"
   },
   "kind": "youtube#searchResult",
   "etag": "\"GGhQgtOz7wdV-KaTX3akpjqktXI/T1_ucgK_momRYuuh8o4LvRpJHWM\"",
   "snippet": {
    "publishedAt": "2012-10-03T21:40:01.000Z",
    "channelId": "UCOmcA3f_RrH6b9NmcNa4tdg",
    "title": "Always On - Torture testing the iPhone 5 Ep 16",
    "description": "cnet.com The iPhone 5 enters the torture chamber, the Tesla S gets unboxed, the Galaxy S3 is thrown in the washing machine, and Molly Wood sets ...",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/N7-T53_pOSM/default.jpg"
     },
     "medium": {
      "url": "https://i.ytimg.com/vi/N7-T53_pOSM/mqdefault.jpg"
     },
     "high": {
      "url": "https://i.ytimg.com/vi/N7-T53_pOSM/hqdefault.jpg"
     }
    }
   }
  },
  {
   "id": {
    "kind": "youtube#video",
    "videoId": "ubNF9QNEQLA"
   },
   "kind": "youtube#searchResult",
   "etag": "\"GGhQgtOz7wdV-KaTX3akpjqktXI/NM08y0TtHGe2IYmzq8XNDhy6WhY\"",
   "snippet": {
    "publishedAt": "2008-11-03T17:49:54.000Z",
    "channelId": "UCFsK_jxE6BghGx4d2QJLJzQ",
    "title": "Test Your Awareness : Whodunnit?",
    "description": "Test your Awareness with Do The Test's Whodunnit. Who Killed Lord Smithe? TFL cycling safety advert! How observant are you? How did you do? www ...",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/ubNF9QNEQLA/default.jpg"
     },
     "medium": {
      "url": "https://i.ytimg.com/vi/ubNF9QNEQLA/mqdefault.jpg"
     },
     "high": {
      "url": "https://i.ytimg.com/vi/ubNF9QNEQLA/hqdefault.jpg"
     }
    }
   }
  }
 ]
}

在YouTube页面中,我得到了相同的结果:

Google Chrome Speed Tests
by Google Chrome•2 years ago•6,721,020 views
These speed tests were filmed at actual web page rendering times. If you're interested in the technical details, read on ...
HDCC
31:01  
Always On - Torture testing the iPhone 5 Ep 16
by CNETTV•4 months ago•267,084 views
Season 2•Episode 16•Always On
cnet.com The iPhone 5 enters the torture chamber, the Tesla S gets unboxed, the Galaxy S3 is thrown in the washing machine ...
HD
1:55  
Test Your Awareness : Whodunnit?
by dothetest•4 years ago•3,477,032 views
Test your Awareness with Do The Test's Whodunnit. Who Killed Lord Smithe? TFL cycling safety advert! How observant are you ...
HD