Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.0%) to scientific vocabulary
Keywords
Repository
R Client for the Youtube Analytics and Reporting API
Basic Info
- Host: GitHub
- Owner: gojiplus
- License: other
- Language: R
- Default Branch: master
- Homepage: https://soodoku.github.io/tubern/
- Size: 137 KB
Statistics
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
tubern: R Client for the YouTube Analytics and Reporting API
tubern provides an R interface to the YouTube Analytics API v2, allowing you to retrieve YouTube Analytics data for channels and content owners. The package supports authentication via OAuth 2.0 and provides functions for getting analytics reports and managing channel groups.
Features
- Analytics Reports: Retrieve detailed analytics data including views, likes, dislikes, watch time, and more
- OAuth 2.0 Authentication: Secure authentication with YouTube Analytics API
- Group Management: Create, list, update, and delete channel groups
- Flexible Querying: Support for dimensions, filters, sorting, and date ranges
- Content Owner Support: Access analytics for channels you manage as a content owner
Installation
From CRAN
r
install.packages("tubern")
Development version from GitHub
```r
install.packages("devtools")
devtools::installgithub("soodoku/tubern", buildvignettes = TRUE) ```
Quick Start
1. Authentication
First, you need to set up OAuth 2.0 authentication. You'll need to create a Google Cloud project and obtain OAuth 2.0 credentials:
```r library(tubern)
Set up authentication (you'll need your own client ID and secret)
ytoauth(appid = "yourclientid.apps.googleusercontent.com", appsecret = "yourclient_secret") ```
2. Get Analytics Reports
```r
Get basic view statistics for your channel
report <- getreport( ids = "channel==MINE", metrics = "views,likes,dislikes,shares", startdate = "2024-01-01", end_date = "2024-12-31" )
Get data with dimensions
reportbyvideo <- getreport( ids = "channel==MINE", metrics = "views,averageViewDuration", dimensions = "video", startdate = "2024-01-01", enddate = "2024-12-31", maxresults = 25 ) ```
3. Manage Channel Groups
```r
List your channel groups
groups <- list_groups(filter = c(mine = TRUE))
Create a new group
newgroup <- addgroups( snippet = list( title = "My Channel Group", description = "A group for organizing my channels" ) ) ```
API Reference
Core Functions
yt_oauth(): Set up OAuth 2.0 authenticationget_report(): Retrieve YouTube Analytics reportslist_groups(): List channel groupsadd_groups(): Create new channel groupsupdate_group(): Modify existing groupsdelete_group(): Remove groupslist_group_items(): List items in a groupadd_group_item(): Add channels to groupsdelete_group_item(): Remove channels from groups
Available Metrics
Common metrics you can request include:
- views: Number of times videos were viewed
- likes, dislikes: Engagement metrics
- shares: Number of times videos were shared
- comments: Number of comments
- subscribersGained, subscribersLost: Subscriber changes
- estimatedMinutesWatched: Total watch time in minutes
- averageViewDuration: Average time spent watching
For monetary metrics (requires monetary-analytics scope):
- estimatedRevenue: Estimated revenue
- adEarnings: Revenue from ads
- impressionBasedCpm: Cost per thousand impressions
Available Dimensions
Dimensions allow you to segment your data:
- video: Individual video performance
- day: Daily breakdowns
- country: Geographic data
- deviceType: Desktop, mobile, tablet, etc.
- operatingSystem: OS breakdowns
- ageGroup, gender: Demographic data (limited availability)
Authentication Setup
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Analytics API
- Create OAuth 2.0 credentials (Desktop application type)
- Use the client ID and secret in
yt_oauth()
For detailed authentication instructions, see the YouTube Analytics API documentation.
Important Notes
- API Changes: This package has been updated to use YouTube Analytics API v2. Some parameter names and behaviors may have changed from previous versions.
- Rate Limits: The YouTube Analytics API has usage quotas. See the quota usage documentation for details.
- Data Freshness: Analytics data typically has a delay of 24-72 hours.
Related Resources
- YouTube Analytics API Documentation
- YouTube Data API R Client (for video metadata, not analytics)
- Google APIs R Client (for general Google API authentication)
License
Released under the MIT License.
Contributing
Contributions are welcome! Please read the Contributor Code of Conduct and submit issues or pull requests on GitHub.
Support
For bug reports and feature requests, please use the GitHub issue tracker.
Owner
- Name: goji+
- Login: gojiplus
- Kind: organization
- Repositories: 2
- Profile: https://github.com/gojiplus
Useful tools for everyone
GitHub Events
Total
- Push event: 5
Last Year
- Push event: 5
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 2
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 0.5
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 197 last-month
- Total docker downloads: 21,247
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: tubern
R Client for the YouTube Analytics and Reporting API
- Homepage: https://github.com/gojiplus/tubern
- Documentation: http://cran.r-project.org/web/packages/tubern/tubern.pdf
- License: MIT + file LICENSE
-
Latest release: 0.2.1
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.2.0 depends
- httr * imports
- jsonlite * imports
- knitr >= 1.11 suggests
- lintr * suggests
- rmarkdown * suggests
- testthat * suggests
- xml2 * suggests
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- r-hub/actions/checkout v1 composite
- r-hub/actions/platform-info v1 composite
- r-hub/actions/run-check v1 composite
- r-hub/actions/setup v1 composite
- r-hub/actions/setup-deps v1 composite
- r-hub/actions/setup-r v1 composite