我正在用我的代码测试其他地区的搜索过滤器,因为我在阿根廷,并且试图只获取 3 个视频。
API 和 YouTube 页面的结果相同。
GET https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=3&order=relevance&q=test®ionCode=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