API Direct
Endpoints
YouTube Videos

YouTube Videos

GET /v1/youtube/posts
Documentation

Search YouTube videos by keyword. Returns video title, URL, channel name, publication date, description, view count, video length, thumbnail, and more. Supports filtering by upload date and fetching multiple pages in a single API call.

Cost
$0.005 per page
Free tier
50 requests/month

Parameters

query *
Search keyword (max 500 characters)
pages
Number of pages to fetch, 1-10 (default: 1)
upload_date
Filter: last_hour, today, this_week, this_month, this_year
get_sentiment
Set to true to add AI emotion analysis (+$0.001/page)

Example Request

curl "https://apidirect.io/v1/youtube/posts?query=tutorial&pages=2&upload_date=this_week" \
  -H "X-API-Key: YOUR_API_KEY"

Example Response

{
  "posts": [
    {
      "title": "Tutorial Video Title",
      "url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
      "date": "2024-01-15 14:30:00",
      "author": "Channel Name",
      "source": "YouTube",
      "domain": "youtube.com",
      "snippet": "Video description...",
      "views": 86979,
      "video_length": "14:45",
      "video_id": "dQw4w9WgXcQ",
      "channel_id": "UCeMcDx6-rOq_RlKSPehk2tQ",
      "is_live": null,
      "type": "NORMAL",
      "keywords": [],
      "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq720.jpg",
      "sentiment": {
        "emotions": {
          "joy": 40,
          "trust": 55,
          "fear": 0,
          "surprise": 10,
          "sadness": 0,
          "disgust": 0,
          "anger": 0,
          "anticipation": 30
        },
        "dominant_emotion": "trust",
        "emotional_intensity": 5,
        "polarity": "positive"
      }
    }
  ],
  "pages": 2,
  "count": 20
}

Your Usage

Free tier this month
Loading...
Recent Activity