# Quickstart



**YTAPI** lets you extract transcripts, video metadata, playlists, channel details and search results from YouTube with simple HTTP requests. It supports word-level timestamps, multiple output formats (JSON, text, Markdown, SRT, VTT), and high-concurrency batch processing.

<Callout type="info" title="Base URL">
  All API endpoints are versioned under the `/v1` prefix.

  **Production:** `https://api.ytapi.dev/v1`
</Callout>

Explore the API [#explore-the-api]

<Cards>
  <Card title="Transcripts" description="Fetch captions and transcripts in JSON, Markdown, text, SRT, or VTT." href="/transcripts" />

  <Card title="Video Metadata" description="Video details, view counts, upload dates, and channel information." href="/videos" />

  <Card title="Playlists" description="Playlist details and video listings with cursor pagination." href="/playlists" />

  <Card title="Channels" description="Channel profiles, subscriber counts, uploads, and playlists." href="/channels" />

  <Card title="Search" description="Search YouTube videos, channels, and playlists with autocomplete." href="/search" />

  <Card title="Batch Processing" description="Extract transcripts for up to 100 videos in a single request." href="/batch" />

  <Card title="SDKs" description="Official Python and JavaScript/TypeScript clients with typed errors and retries." href="/sdks" />

  <Card title="Pricing" description="Pay-as-you-go credit packs. Credits never expire." href="/pricing" />

  <Card title="Credits & Billing" description="Per-request credit costs, rate limits, and error codes." href="/credits" />
</Cards>

***

30-Second Quickstart [#30-second-quickstart]

<Steps>
  <Step>
    Get Your API Key [#get-your-api-key]

    Generate an API key from the [Developer Dashboard](https://ytapi.dev/app/api-keys?utm_source=docs).
  </Step>

  <Step>
    Make Your First Request [#make-your-first-request]

    <Tabs items={["cURL", "Python", "TypeScript", "Go"]}>
      <Tab value="cURL">
        ```bash
        curl -X POST https://api.ytapi.dev/v1/transcripts \
          -H "Authorization: Bearer YOUR_API_KEY" \
          -H "Content-Type: application/json" \
          -d '{
            "video_id": "dQw4w9WgXcQ",
            "format": "markdown"
          }'
        ```
      </Tab>

      <Tab value="Python">
        ```python
        import requests

        response = requests.post(
            "https://api.ytapi.dev/v1/transcripts",
            headers={"Authorization": "Bearer YOUR_API_KEY"},
            json={
                "video_id": "dQw4w9WgXcQ",
                "format": "markdown"
            }
        )

        # Text formats (markdown, srt, vtt) return raw text directly
        print(response.text)
        ```
      </Tab>

      <Tab value="TypeScript">
        ```typescript
        const res = await fetch("https://api.ytapi.dev/v1/transcripts", {
          method: "POST",
          headers: {
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
          },
          body: JSON.stringify({
            video_id: "dQw4w9WgXcQ",
            format: "markdown"
          })
        });

        // Text formats (markdown, srt, vtt) return raw text directly
        const markdown = await res.text();
        console.log(markdown);
        ```
      </Tab>

      <Tab value="Go">
        ```go
        package main

        import (
        	"bytes"
        	"encoding/json"
        	"fmt"
        	"io"
        	"net/http"
        )

        func main() {
        	payload, _ := json.Marshal(map[string]any{
        		"video_id": "dQw4w9WgXcQ",
        		"format":   "markdown",
        	})

        	req, _ := http.NewRequest("POST", "https://api.ytapi.dev/v1/transcripts", bytes.NewBuffer(payload))
        	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
        	req.Header.Set("Content-Type", "application/json")

        	resp, err := http.DefaultClient.Do(req)
        	if err != nil {
        		panic(err)
        	}
        	defer resp.Body.Close()

        	body, _ := io.ReadAll(resp.Body)
        	fmt.Println(string(body))
        }
        ```
      </Tab>
    </Tabs>

    Prefer a client library? `pip install ytapi-sdk` or `npm install @ytapi/sdk`. See [SDKs](/sdks).
  </Step>

  <Step>
    Parse the Response [#parse-the-response]

    Every response includes telemetry headers for observability:

    | Header             | Description                                                     |
    | :----------------- | :-------------------------------------------------------------- |
    | `X-Cache`          | `HIT`, `MISS`, `BYPASS`, or `STALE` — whether served from cache |
    | `X-Track-Kind`     | `asr` (auto-generated) or `manual` (creator-uploaded)           |
    | `X-Track-Language` | Negotiated ISO language code (e.g. `en`, `zh-Hans`)             |
    | `X-Request-Id`     | Unique request tracking identifier                              |
  </Step>
</Steps>

***

Features at a Glance [#features-at-a-glance]

| Feature              | Description                                                                                                         |
| :------------------- | :------------------------------------------------------------------------------------------------------------------ |
| **Transcripts**      | Sub-400ms median latency with automatic language fallback. Outputs JSON, plain text, Markdown, SRT, and VTT.        |
| **Word Timestamps**  | Set `word_level=true` for millisecond-level start and end timestamps for each word.                                 |
| **Video Metadata**   | Titles, descriptions, view counts, duration, publication dates, and channel details.                                |
| **Playlists**        | Complete playlist details and paginated video lists using continuation tokens.                                      |
| **Channels**         | Channel profiles, subscriber counts, uploads, and playlists.                                                        |
| **Search**           | Query YouTube videos, channels, and playlists with type and upload date filters.                                    |
| **Batch Processing** | Submit up to 100 tasks in a single asynchronous job, executed across a concurrent worker pool (default 10, max 20). |
