youtube-channel-info
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

Youtube Channel Info

The easiest way to instantly know your youtube channel info.

🦀 Example Usage

const { getChannelInfo, getChannelStatistics } = require("youtube-channel-info");

(async () => {
const channelId = ""
const apiKey = ""

const info = await getChannelInfo({ videoId: channelId, apiKey: apiKey })
const stat = await getChannelStatistics({ videoId: channelId, apiKey: apiKey })
try {
console.log(`
  Channel Infos:
  title: ${info.title}
  description: ${info.description}
  customUrl: ${info.customUrl}
  publishedAt: ${info.publishedAt}
  thumbnails (default, medium, high): ${info.thumbnails.default.url}
  defaultLanguage: ${info.defaultLanguage}
  country: ${info.country}

  Channel Statistics:
  viewCount: ${stat.viewCount}
  subscriberCount: ${stat.subscriberCount}
  hiddenSubscriberCount: ${stat.hiddenSubscriberCount}
  videoCount: ${stat.videoCount}
  `)
} catch (console.error)
})();

Result

{
  info: {
  title: '{channel title}',
  description: '{channel description}',
  customUrl: '{channel customUrl}',
  publishedAt: '{channel publishedAt}',
  thumbnails.(object).url: '{channel (object) thumbnail}' => Objects: [ default, medium, high ],
  defaultLanguage: '{channel defaultLanguage}',
  country: '{channel country}'
  },

  stat: {
  viewCount: '{channel viewCount}',
  subscriberCount: '{channel subscriberCount}',
  hiddenSubscriberCount: {false or true},
  videoCount: '{channel videoCount}'
  }
}

Get API Key

  1. Sign in to Google Developer Console:

    • Log in to Google Developer Console to generate your YouTube API key. If you don't have a Google account, create one.
  2. Create a New Project:

    • Click on "Create Project" button at the top left corner of Developer Console to create a new project. You can name the project as you like.
  3. Enable the API:

    • Go to "APIs & Services" section from the left-hand menu.
    • Select "Library" under "APIs & Services".
    • Type "YouTube Data API v3" in the search bar and display the results.
    • Click on "Enable" button to activate the API.
  4. Generate Key:

    • Navigate to "Credentials" section from the left-hand menu.
    • Go to "API Keys" tab and click on "Create Credentials" button.
    • You'll have the option to name your key and set API restrictions if necessary. Set the restrictions if needed and click on "Create" button.
  5. Copy Your Key:

    • Once your key is created, you'll be provided with an API key. Copy this key.
  6. Use Your Key:

    • Use your API key to make calls to the YouTube API in your application or service. Integrate your API key in appropriate places and start using it.

Note: Keep your API key secure and avoid sharing it publicly. Your key can be misused by malicious individuals. Also, read the API usage limits and policies carefully, and implement them appropriately.

🐞 I found a bug!

📱 If you want to reach me, you can reach me via Discord!

Readme

Keywords

Package Sidebar

Install

npm i youtube-channel-info

Weekly Downloads

0

Version

1.5.0

License

MIT

Unpacked Size

6.28 kB

Total Files

5

Last publish

Collaborators

  • iqojs