{"id":18075738,"url":"https://github.com/miguelo981/viewstats-api","last_synced_at":"2026-01-27T17:03:39.841Z","repository":{"id":259223179,"uuid":"877346121","full_name":"Miguelo981/viewstats-api","owner":"Miguelo981","description":"Unofficial viewstats API wrapper for Nodejs and Deno.","archived":false,"fork":false,"pushed_at":"2024-10-23T14:59:07.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T03:43:20.375Z","etag":null,"topics":["api","deno","mrbeast","nodejs","viewstats"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/viewstats-api","language":"TypeScript","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/Miguelo981.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T13:50:21.000Z","updated_at":"2025-05-05T05:20:31.000Z","dependencies_parsed_at":"2024-10-23T17:03:47.840Z","dependency_job_id":"3fe4840f-071b-4b4d-997c-17d172ba5a45","html_url":"https://github.com/Miguelo981/viewstats-api","commit_stats":null,"previous_names":["miguelo981/viewstats-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Miguelo981/viewstats-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miguelo981%2Fviewstats-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miguelo981%2Fviewstats-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miguelo981%2Fviewstats-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miguelo981%2Fviewstats-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Miguelo981","download_url":"https://codeload.github.com/Miguelo981/viewstats-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miguelo981%2Fviewstats-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28816571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","deno","mrbeast","nodejs","viewstats"],"created_at":"2024-10-31T11:07:07.150Z","updated_at":"2026-01-27T17:03:39.826Z","avatar_url":"https://github.com/Miguelo981.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# viewstats-api\n \n`viewstats-api` is an unofficial wrapper for the ViewStats API, designed to work with both Node.js and Deno. It provides easy-to-use methods to interact with ViewStats, retrieve channel data, and perform advanced searches.\n\n## Features\n\n- Retrieve channel statistics, averages, and rankings\n- Fetch featured videos and popular channels\n- Advanced search capabilities for YouTube channels\n\n## Installation\n\n### Node.js\n\nInstall the package via npm:\n\n```bash\nnpm install viewstats-api\n```\n\n### Deno\n\nImport the package from your repository URL:\n\n```typescript\nimport { ViewStatsAPI } from \"https://github.com/Miguelo981/viewstats-api/raw/main/index.ts\";\n```\n\n### API Key\n\nTo use the `viewstats-api`, you'll need to obtain an API key. This can be done by inspecting the network requests in your browser.\n\n#### Steps to get your API Key:\n\n1. Open your browser and navigate to the ViewStats website.\n2. Open the **Developer Tools** (usually by pressing `F12` or `Ctrl+Shift+I`).\n3. Go to the **Network** tab and perform any action that makes a request to the ViewStats API (e.g., searching for a channel).\n4. Look for the request in the **Network** tab and select it.\n5. Under the **Headers** section, find the **Authorization** header.\n6. Copy the value of the **Bearer token**. This is your API key.\n\n### Usage\n#### Basic Example\n\n```typescript\nimport { ViewStatsAPI } from \"viewstats-api\";\n\nconst apiToken = \"your_api_token\";\nconst api = new ViewStatsAPI(apiToken);\n\n// Retrieve channel data by ID\nconst channel = await api.getChannel(\"mrbeast\");\n```\n\n## API Methods\n\n| Method | Description |\n|--------|-------------|\n| `getChannel(channelId: string): Promise\u003cChannelResponse\u003e` | Fetch channel details by channel ID. |\n| `getChannelStats(channelId: string, params: ChannelStatsParams): Promise\u003cChannelStatsResponse[]\u003e` | Retrieve detailed statistics for a channel, including views, subscribers, and video counts. |\n| `getChannelAverage(channelId: string): Promise\u003cChannelAverageResponse\u003e` | Get average stats such as views and estimated revenue over a period of time. |\n| `getChannelLongAndShort(channelId: string): Promise\u003cChannelLongAndShortResponse\u003e` | Retrieve long and short video statistics for a channel. |\n| `getChannelFeaturedVideo(channelId: string): Promise\u003cChannelFeaturedVideoResponse\u003e` | Fetch the featured video of a channel. |\n| `advancedChannelSearch(params: ChannelAdvancedSearchParams): Promise\u003cChannelAdvancedSearchResponse\u003e` | Perform an advanced search for channels based on specific criteria. |\n| `getRankingChannels(params: RankingChannelsParams): Promise\u003cChannelRankingResponse[]\u003e` | Fetch the rankings of channels based on subscribers or views. |\n| `getPopularChannels(length: number = 10): Promise\u003cPopularChannelsResponse[]\u003e` | Retrieve a list of popular channels. |\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nFeel free to open issues and pull requests on the [GitHub repository](https://github.com/Miguelo981/viewstats-api/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelo981%2Fviewstats-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelo981%2Fviewstats-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelo981%2Fviewstats-api/lists"}