---
title: "Search YouTube Videos"
method: GET
path: "/v1/youtube/posts"
tags: ["YouTube"]
---

# Search YouTube Videos

`GET /v1/youtube/posts`

## Request

- Base URL: `https://apidirect.io`
- URL: `https://apidirect.io/v1/youtube/posts`
- Auth: API key in header `X-API-Key`

Search for YouTube videos by keyword. Returns video title, URL, channel name, channel ID, video ID, publication date, description snippet, view count, video length, thumbnail, and a flag for live content. Supports filtering by upload date and fetching up to 20 pages in a single call. Set get_sentiment=true to add AI emotion analysis to each result.

**Price:** $0.005 per page. **Free tier:** 50 requests/month.

## Query parameters

- `query` string, required
- `pages` integer
- `upload_date` 'last_hour' | 'today' | 'this_week' | 'this_month' | 'this_year'
- `get_sentiment` boolean

## Response `200`

Successful response

- SearchYoutubeResponse: Inferred from a live response. Any field can be null or absent, and new fields may be added at any time.
  - `count` number, nullable
  - `pages` number, nullable
  - `posts` object[], nullable
    - `author` string, nullable
    - `channel_id` string, nullable
    - `date` string, nullable
    - `domain` string, nullable
    - `is_live` unknown
    - `keywords` unknown[], nullable
      - unknown
    - `snippet` string, nullable
    - `source` string, nullable
    - `thumbnail` string, nullable
    - `title` string, nullable
    - `type` string, nullable
    - `url` string, nullable
    - `video_id` string, nullable
    - `video_length` string, nullable
    - `views` number, nullable

## Other responses

- `400`: Bad request: missing or invalid parameters
- `401`: Unauthorized: invalid or missing API key
- `402`: Free tier used up for this endpoint and no payment method on file (`payment_required`).
- `403`: Account blocked after a failed payment (`account_blocked`).
- `429`: Rate limit exceeded or too many concurrent requests
- `500`: Internal server error
- `502`: Temporary failure retrieving YouTube data. Please retry shortly.
- `503`: Service temporarily unavailable. Please retry shortly.
- `504`: The request timed out

---

[API](https://skmtc.dev/apidirect/apis/api-direct.md) · [All operations](https://skmtc.dev/apidirect/apis/api-direct/llms.txt) · [OpenAPI document](https://skmtc.dev/apidirect/apis/api-direct/revisions/fa8c68d70bd0?raw)
