如何使用数据API获取最近28天的YouTube频道统计数据? [英] How to get YouTube channel statistics like last 28 days using data api?

查看:15
本文介绍了如何使用数据API获取最近28天的YouTube频道统计数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取最近28天的YouTube频道统计数据,如

  1. 总视图
  2. 平均日浏览量
  3. 渠道国家/地区
  4. 持续28天的浏览量
  5. 日均订阅者
  6. 列表项

我得到了所有其他东西,但这些没有。

我目前正在使用此

https://www.googleapis.com/youtube/v3/videos?id=PBrEq9Wd6_U&key=[API_KEY]&part=snippet,contentDetails,statistics,status

已收到回复

    {
  "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!

00:00 Introduction
01:37 Setting up our project
07:25 Creating our Game Board
24:48 Checking for matches
42:46 Moving Candies down
48:42 Dragging and Dropping in React
01:07:20 Adding Images in React
01:11:43 Adding the score
01:17:25 Checking for blanks
01:19:23 Suggestions for refactoring
01:20:00 Where to go next? Saving High Scores (https://youtu.be/ARL0NuIQNjY)

Final code available here: https://github.com/kubowania/candy-crush-reactjs
Learn how to add Game State in a database: https://youtu.be/ARL0NuIQNjY
___
⭐ 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

⭐ 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.

⭐ 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!

00:00 Introduction
01:37 Setting up our project
07:25 Creating our Game Board
24:48 Checking for matches
42:46 Moving Candies down
48:42 Dragging and Dropping in React
01:07:20 Adding Images in React
01:11:43 Adding the score
01:17:25 Checking for blanks
01:19:23 Suggestions for refactoring
01:20:00 Where to go next? Saving High Scores (https://youtu.be/ARL0NuIQNjY)

Final code available here: https://github.com/kubowania/candy-crush-reactjs
Learn how to add Game State in a database: https://youtu.be/ARL0NuIQNjY
___
⭐ 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

⭐ 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.

⭐ 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
  }
}

推荐答案

AFAIK您不能向Youtube data API v3请求过去的数据。但是,通过定期从YouTube检索数据,您将来将能够获得这些统计数据。

  1. 总视图:使用Channels: list确保包括part中的statistics
  2. 平均每日视图:我让您在定期检索所需数据后进行计算。
  3. 频道国家:并不是所有YouTube频道都定义了AFAIK频道国家,但如果定义了,您可以使用Channels: listChannels: listsnippetpart中获取
  4. 查看持续28天:我让您算算
  5. 平均每日订阅者:如果您在part中使用statistics,则可以使用Channels: list取回subscriberCount。警告:众所周知,这个数字是由YouTube和AFAIK四舍五入的,没有任何方法可以获得更准确的计数器
  6. 列表项:我不明白您的意思,您能否添加精确度作为备注,我将编辑我的答案?您是说列出您的视频吗?

这篇关于如何使用数据API获取最近28天的YouTube频道统计数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆