{"id":15991846,"url":"https://github.com/sinedied/ystats","last_synced_at":"2025-03-17T20:30:21.602Z","repository":{"id":46126164,"uuid":"424989226","full_name":"sinedied/ystats","owner":"sinedied","description":"Simple CLI to quickly get YouTube stats for any video, playlist or channel","archived":false,"fork":false,"pushed_at":"2021-11-12T08:59:37.000Z","size":889,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T00:16:38.153Z","etag":null,"topics":["cli","nodejs","npm","stats","views","youtube"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinedied.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-05T15:06:46.000Z","updated_at":"2024-11-23T16:25:12.000Z","dependencies_parsed_at":"2022-09-11T15:31:31.576Z","dependency_job_id":null,"html_url":"https://github.com/sinedied/ystats","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fystats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fystats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fystats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinedied%2Fystats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinedied","download_url":"https://codeload.github.com/sinedied/ystats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878483,"owners_count":20362433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","nodejs","npm","stats","views","youtube"],"created_at":"2024-10-08T06:03:02.374Z","updated_at":"2025-03-17T20:30:20.948Z","avatar_url":"https://github.com/sinedied.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :tv: ystats\n\n[![NPM version](https://img.shields.io/npm/v/ystats.svg)](https://www.npmjs.com/package/ystats)\n[![Build Status](https://github.com/sinedied/ystats/workflows/build/badge.svg)](https://github.com/sinedied/ystats/actions)\n![Node version](https://img.shields.io/node/v/ystats.svg)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003e Simple CLI to quickly get YouTube stats for any video, playlist, channel or all at once.\n\n## Installation\n\n```bash\nnpm install -g ystats\n```\n\n## Usage\n\n```\nUsage: ys [config_path_or_URL] [options]\n\nOptions:\n  -i, --ids \u003cvideo_ids\u003e         Coma separated list of video IDs\n  -p, --playlist \u003cplaylist_id\u003e  Playlist ID\n  -c, --channel \u003cchannel_id\u003e    Channel ID\n  -t, --token \u003capi_token\u003e       Use specified API token\n  -o, --output \u003cfile\u003e           Write result to output file\n  -a, --append                  Append to output file (requires -o)\n  -f, --format \u003cname\u003e           Output format (json, yml, csv, txt, basic)\n  -t, --total                   Add section with total stats\n  -v, --version                 Show version\n  --help                        Show help\n```\n\nTo use this tool, you need a YouTube Data API key. You can get one by looking at [the instructions here](https://developers.google.com/youtube/v3/getting-started). You can provide it with the `--token` option, setting the `YT_API_TOKEN` environment variable or adding `YT_API_TOKEN=\u003ckey\u003e` into a `.env` file in the current directory.\n\nIf you don't provide a config file path or URL, the tool will try to load a `ystats.yml` config file in the current directory.\n\nPlease note that the YouTube data API have [quota limits](https://developers.google.com/youtube/v3/getting-started#quota). If you are getting rate limited, you can try to use a different API token.\n\n## IDs format\n\nThe various IDs (video, playlista and channel) can be provided in any of the following formats:\n- raw id (e.g. `video_id`)\n- YouTube browser URL (e.g. `https://www.youtube.com/watch?v=video_id`)\n- YouTube share URL (e.g. `https://youtu.be/video_id`)\n\n## Config file\n\nThe config file is a YAML file with the following structure:\n\n```yaml\n# List of videos IDs to get stats for\nvideos:\n  - https://youtu.be/w-tLZjO6XMc\n  - https://www.youtube.com/watch?v=FeJVdCz_uco\n\n# List of playlist IDs to get stats for\nplaylists:\n  - https://www.youtube.com/playlist?list=PLlrxD0HtieHje-_287YJKhY8tDeSItwtg\n  - https://www.youtube.com/playlist?list=PLlrxD0HtieHgMPeBaDQFx9yNuFxx6S1VG\n\n# List of channels IDs to get stats for\nchannels:\n  - https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g\n```\n\nEach of these sections are completely optional.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedied%2Fystats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinedied%2Fystats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinedied%2Fystats/lists"}