> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supadata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Channel

> Get metadata for a YouTube channel.



## OpenAPI

````yaml v1-openapi GET /youtube/channel
openapi: 3.1.0
info:
  title: Supadata
  description: Web & Social Media Content API for Developers
  version: 1.3.0
servers:
  - url: https://api.supadata.ai/v1
security:
  - apiKeyAuth: []
paths:
  /youtube/channel:
    get:
      description: Get metadata for a YouTube channel.
      operationId: getYoutubeChannel
      parameters:
        - in: query
          name: id
          schema:
            type: string
            description: >-
              YouTube channel URL, handle or ID. See [supported URL
              formats](https://supadata.ai/documentation/youtube/supported-url-formats).
            examples:
              - https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw
              - https://youtube.com/c/rickastley
              - UCuAXFkgsw1L7xaCfnd5JJOw
              - '@rickastley'
              - rickastley
          required: true
      responses:
        '200':
          description: Successfully fetched channel metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YoutubeChannel'
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: TypeScript
          label: Node.js
          source: |-
            import { Supadata } from '@supadata/js';

            const supadata = new Supadata({
              apiKey: 'YOUR_API_KEY',
            });
            const channel = await supadata.youtube.channel({
              id: 'RickAstleyVEVO', // can be url, id, handle
            });
            console.log(channel.name);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata

            supadata = Supadata(api_key="YOUR_API_KEY")
            channel = supadata.youtube.channel(
                id="RickAstleyVEVO" # can be url, id, handle
            )
            print(f"Channel name: {channel.name}")
        - lang: Shell
          label: cURL
          source: >-
            curl -X GET
            "https://api.supadata.ai/v1/youtube/channel?id=RickAstleyVEVO" \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    YoutubeChannel:
      type: object
      properties:
        id:
          type: string
          description: YouTube channel ID
          example: UCuAXFkgsw1L7xaCfnd5JJOw
        name:
          type: string
          description: Channel name
          example: Rick Astley
        description:
          type: string
          description: Channel description
          example: The official Rick Astley YouTube channel
        subscriberCount:
          type: number
          description: Number of subscribers
          example: 2000000
        videoCount:
          type: number
          description: Number of videos on the channel
          example: 100
        viewCount:
          type: number
          description: Total number of views across all channel videos
          example: 100
        thumbnail:
          type: string
          description: URL to channel thumbnail
          example: https://yt3.ggpht.com/...
        banner:
          type: string
          description: URL to channel banner
          example: https://yt3.ggpht.com/...
      required:
        - id
        - name
    Error:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid-request
            - internal-error
            - forbidden
            - unauthorized
            - upgrade-required
            - transcript-unavailable
            - not-found
            - limit-exceeded
          description: Error code identifying the type of error
          example: invalid-request
        message:
          type: string
          description: Human readable error message
          example: Invalid Request
        details:
          type: string
          description: Detailed error description
          example: The request is invalid or malformed
        documentationUrl:
          type: string
          description: URL to error documentation
          example: https://supadata.ai/documentation/errors#invalid-request
      required:
        - error
        - message
        - details
      description: Standard error response format
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````