我正在尝试获取过去 28 天的 YouTube 频道统计数据,例如
我得到了所有其他的东西,但这些没有。
目前我正在使用这个
并收到回复
{
"kind": "youtube#videoListResponse",
"etag": "xdV7ewWgCsOTS7cf0XUF8Fp9Xg4",
"items": [
{
"kind": "youtube#video",
"etag": "dZDlRrNH8pJOOeV8rPpuQcUaeKU",
"id": "PBrEq9Wd6_U",
"snippet": {
"publishedAt": "2021-10-20T16:00:12Z",
"channelId": "UC5DNytAJ6_FISueUfzZCVsw",
"title": "Candy Crush in React",
"description": "In this video I show you how to make a game of Candy Crush in React!\n\n00:00 Introduction\n01:37 Setting up our project\n07:25 Creating our Game Board\n24:48 Checking for matches\n42:46 Moving Candies down\n48:42 Dragging and Dropping in React\n01:07:20 Adding Images in React\n01:11:43 Adding the score\n01:17:25 Checking for blanks\n01:19:23 Suggestions for refactoring\n01:20:00 Where to go next? Saving High Scores (https://youtu.be/ARL0NuIQNjY)\n\nFinal code available here: https://github.com/kubowania/candy-crush-reactjs\nLearn how to add Game State in a database: https://youtu.be/ARL0NuIQNjY\n___\n⭐ Use promo code ANIAKUBOW for 3 months free of WebStorm IDE here (I get no commission from this link, but am in a partnership): https://jb.gg/get_webstorm\n\n⭐ New to code and none of this is making sense? Watch my '12hr+ YouTube Coding Bootcamp' in which you will learn HTML, CSS and JavaScript Fundamentals completely from scratch. It's on my channel and its 100% free.\n\n⭐ In most videos I use Tabnine as my A.I autocompletion tool. You can download it for free here (I get no commission from this link, but am in a partnership): ",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/PBrEq9Wd6_U/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/PBrEq9Wd6_U/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/PBrEq9Wd6_U/hqdefault.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/PBrEq9Wd6_U/sddefault.jpg",
"width": 640,
"height": 480
},
"maxres": {
"url": "https://i.ytimg.com/vi/PBrEq9Wd6_U/maxresdefault.jpg",
"width": 1280,
"height": 720
}
},
"channelTitle": "Code with Ania Kubów",
"tags": [
"candy crush",
"react tutorial",
"react game",
"gamedev",
"software engineering",
"software development",
"learn to code",
"coding bootamp",
"100daysOfcode",
"javascript tutorial for beginners",
"javascript tutorial",
"react for beginners",
"candy crush development"
],
"categoryId": "27",
"liveBroadcastContent": "none",
"localized": {
"title": "Candy Crush in React",
"description": "In this video I show you how to make a game of Candy Crush in React!\n\n00:00 Introduction\n01:37 Setting up our project\n07:25 Creating our Game Board\n24:48 Checking for matches\n42:46 Moving Candies down\n48:42 Dragging and Dropping in React\n01:07:20 Adding Images in React\n01:11:43 Adding the score\n01:17:25 Checking for blanks\n01:19:23 Suggestions for refactoring\n01:20:00 Where to go next? Saving High Scores (https://youtu.be/ARL0NuIQNjY)\n\nFinal code available here: https://github.com/kubowania/candy-crush-reactjs\nLearn how to add Game State in a database: https://youtu.be/ARL0NuIQNjY\n___\n⭐ Use promo code ANIAKUBOW for 3 months free of WebStorm IDE here (I get no commission from this link, but am in a partnership): https://jb.gg/get_webstorm\n\n⭐ New to code and none of this is making sense? Watch my '12hr+ YouTube Coding Bootcamp' in which you will learn HTML, CSS and JavaScript Fundamentals completely from scratch. It's on my channel and its 100% free.\n\n⭐ In most videos I use Tabnine as my A.I autocompletion tool. You can download it for free here (I get no commission from this link, but am in a partnership):"
},
"defaultAudioLanguage": "en-GB"
},
"contentDetails": {
"duration": "PT1H21M1S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": true,
"contentRating": {},
"projection": "rectangular"
},
"status": {
"uploadStatus": "processed",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": true,
"madeForKids": false
},
"statistics": {
"viewCount": "150594",
"likeCount": "5017",
"favoriteCount": "0",
"commentCount": "232"
}
}
],
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
}
}
据我所知,您无法向 YouTube Data API v3 请求过去的数据。然而,通过定期从 YouTube 检索数据,您将来将能够获得这些统计数据。
statistics
中包含part
。Channels: list
在
snippet
part
subscriberCount
中使用 statistics
,则可以使用 Channels: list检索
part
。警告:众所周知,这个数字是由 YouTube 四舍五入的,据我所知,没有任何方法可以获得更准确的计数器您可以查看 YouTube Analytics API。您所寻求的内容将归入Metrics。
此外,您还可以查看相关视频:https://www.youtube.com/watch?v=WtsS8sEzEeY