API Reference

Complete reference documentation for the TubeRaker REST API.

Base URL

https://api.tuberaker.com/v1

Authentication

Bearer Token (API Key)

Format

JSON Request/Response

Authentication

TubeRaker API uses Bearer token authentication. Include your API key in the Authorization header of every request.

Example Request

curl -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     https://api.tuberaker.com/v1/analytics/video/dQw4w9WgXcQ
Security Notice

Never expose your API key in client-side code. Always make API calls from your server.

Video Analytics

GET /analytics/video/{video_id}

Retrieve comprehensive analytics data for a specific video including views, engagement metrics, audience retention, and performance insights.

Path Parameters

Parameter Type Description
video_id string YouTube video ID (e.g., "dQw4w9WgXcQ")

Query Parameters

Parameter Type Default Description
timeframe string 30d Time period: 7d, 30d, 90d, 365d
include_predictions boolean false Include AI growth predictions
metrics array all Specific metrics to return

Example Response

{
  "success": true,
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up",
    "channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "published_at": "2009-10-25T06:57:33Z",
    "duration": "PT3M33S",
    "view_count": 1234567890,
    "like_count": 12345678,
    "dislike_count": 456789,
    "comment_count": 1234567,
    "engagement_rate": 0.085,
    "retention_rate": 0.72,
    "click_through_rate": 0.045,
    "average_view_duration": 142,
    "subscriber_gain": 15234,
    "revenue_estimate": {
      "min": 12500,
      "max": 45000,
      "currency": "USD"
    },
    "audience_demographics": {
      "age_groups": {
        "13-17": 0.08,
        "18-24": 0.24,
        "25-34": 0.31,
        "35-44": 0.22,
        "45-54": 0.11,
        "55-64": 0.04
      },
      "gender": {
        "male": 0.62,
        "female": 0.38
      },
      "top_countries": [
        {"country": "US", "percentage": 0.35},
        {"country": "UK", "percentage": 0.12},
        {"country": "CA", "percentage": 0.08}
      ]
    },
    "performance_score": 87,
    "optimization_suggestions": [
      {
        "type": "title",
        "priority": "high",
        "suggestion": "Consider adding trending keywords to increase discoverability"
      },
      {
        "type": "description",
        "priority": "medium", 
        "suggestion": "Add timestamps and call-to-action for better engagement"
      }
    ]
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "rate_limit_remaining": 99,
    "request_id": "req_abc123def456"
  }
}
POST /analytics/videos/batch

Get analytics data for multiple videos in a single request. Maximum 50 videos per request.

Request Body

{
  "video_ids": [
    "dQw4w9WgXcQ",
    "9bZkp7q19f0",
    "kXYiU_JCYtU"
  ],
  "timeframe": "30d",
  "metrics": ["views", "likes", "engagement_rate"]
}

Title Optimization

POST /optimization/title

Generate optimized title suggestions using AI analysis of trending topics, keywords, and engagement patterns.

Request Body

{
  "current_title": "My Gaming Setup Tour 2025",
  "description": "Check out my new gaming setup with RGB lighting and custom PC build",
  "category": "gaming",
  "target_audience": "gamers_18_35",
  "tone": "excited",
  "include_keywords": ["gaming setup", "RGB", "PC build"],
  "max_length": 60
}

Response

{
  "success": true,
  "data": {
    "suggestions": [
      {
        "title": "INSANE Gaming Setup Tour 2025 - RGB PC Build Reveal!",
        "score": 94,
        "predicted_ctr": 0.087,
        "trending_keywords": ["gaming setup", "RGB", "2025"],
        "reasons": [
          "Uses high-engagement words (INSANE, Reveal)",
          "Includes year for recency",
          "Optimal length for mobile display"
        ]
      },
      {
        "title": "Ultimate Gaming Setup 2025 | Custom RGB PC Build Tour",
        "score": 89,
        "predicted_ctr": 0.081,
        "trending_keywords": ["ultimate", "gaming setup", "RGB"],
        "reasons": [
          "Structured format performs well",
          "Clear value proposition",
          "Good keyword density"
        ]
      }
    ],
    "original_score": 76,
    "improvement_potential": "+18% CTR"
  }
}

Keyword Research

GET /keywords/research

Research trending keywords and get detailed analytics including search volume, competition, and optimization opportunities.

Query Parameters

Parameter Type Description
query string Seed keyword or phrase
country string Country code (US, UK, CA, etc.)
language string Language code (en, es, fr, etc.)
limit integer Maximum results (1-100, default: 50)

Example Request

GET /v1/keywords/research?query=gaming+setup&country=US&limit=10

Error Responses

The API uses standard HTTP status codes and returns detailed error information in JSON format.

400 - Bad Request

{
  "success": false,
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "The video_id parameter is required",
    "details": {
      "parameter": "video_id",
      "expected": "string",
      "received": null
    }
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

401 - Unauthorized

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

429 - Rate Limit Exceeded

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "API rate limit exceeded",
    "retry_after": 60
  }
}

Official SDKs

Use our official SDKs to integrate TubeRaker API into your applications quickly and easily.

JavaScript/Node.js

npm install @tuberaker/api-client
View Documentation →

Python

pip install tuberaker-client
View Documentation →

PHP

composer require tuberaker/api-client
View Documentation →

Java

Coming Soon - Join our mailing list for updates