Back to Advanced Features

API Access

Integrate FameLifter data into your apps

10 min read
Updated January 15, 2024

API Access


Integrate FameLifter's powerful YouTube analytics directly into your applications, dashboards, and workflows with our RESTful API.

Getting Started with API


What is the FameLifter API?


The FameLifter API allows you to:
  • Programmatic Access: Retrieve analytics data via HTTP requests
  • Custom Integrations: Build FameLifter into your own tools
  • Automation: Automate repetitive analysis tasks
  • Data Pipeline: Feed analytics into your data warehouse
  • Custom Dashboards: Create branded analytics interfaces

API Availability

  • Professional Plan: Limited API access (1,000 requests/day)
  • Enterprise Plan: Full API access (unlimited requests)
  • Rate Limits: Tier-based request throttling
  • Documentation: Complete API reference included

Authentication


Getting Your API Key


#### Generate API Credentials
  • Go to Settings: Navigate to Account Settings
  • Select API Access: Find the API section
  • Generate Key: Click "Create New API Key"
  • Store Securely: Save your key in a secure location
  • Never Share: Keep your API key confidential

#### API Key Management

  • Multiple Keys: Create separate keys for different applications
  • Key Rotation: Regenerate keys periodically for security
  • Revocation: Disable compromised keys immediately
  • Usage Tracking: Monitor which keys are being used

Authentication Methods


#### Bearer Token Authentication
Authorization: Bearer YOUR_API_KEY


Include your API key in request headers:
  • Header Name: Authorization
  • Format: Bearer {your-api-key}
  • Required: All API endpoints require authentication
  • Security: Always use HTTPS

API Endpoints


Channel Analytics


#### Get Channel Data
GET /api/v1/channels/{channelId}


Returns:
  • Channel statistics (subscribers, views, video count)
  • Recent video performance
  • Growth metrics
  • Engagement rates

#### Search Channels

GET /api/v1/channels/search?q={query}&country={code}


Parameters:
  • q: Search query (channel name)
  • country: Country code filter (optional)
  • limit: Results per page (max 100)
  • offset: Pagination offset

Video Analytics


#### Get Video Details
GET /api/v1/videos/{videoId}


Returns:
  • View count, likes, comments
  • Engagement metrics
  • Audience retention data
  • Performance scores

#### Bulk Video Analysis

POST /api/v1/videos/bulk

{

"videoIds": ["id1", "id2", "id3"]

}


Analyze multiple videos in one request:
  • Up to 50 videos per request
  • Aggregated statistics
  • Comparative metrics
  • Batch processing

Trending Content


#### Get Trending Videos
GET /api/v1/trending/{countryCode}?date={YYYY-MM-DD}


Returns:
  • Currently trending videos by country
  • Historical trending data
  • Category-specific trends
  • Trend velocity metrics

AI Insights


#### Get AI Analysis
GET /api/v1/ai/analyze/{videoId}


Returns:
  • Content performance prediction
  • Sentiment analysis results
  • Topic extraction
  • Optimization recommendations

Request & Response Format


Request Format


#### JSON Requests
{

"channelIds": ["UCxxxxxx", "UCyyyyyy"],

"metrics": ["subscribers", "views", "engagement"],

"dateRange": {

"start": "2024-01-01",

"end": "2024-01-31"

}

}


Response Format


#### Standard Response Structure
{

"status": "success",

"data": {

// Response data

},

"meta": {

"requestId": "req_123abc",

"timestamp": "2024-01-15T10:30:00Z",

"rateLimit": {

"remaining": 950,

"reset": "2024-01-15T24:00:00Z"

}

}

}


#### Error Response
{

"status": "error",

"error": {

"code": "INVALID_API_KEY",

"message": "API key is invalid or expired",

"details": "Please check your API key and try again"

}

}


Rate Limiting


Request Limits


#### By Plan Tier
  • Professional: 1,000 requests/day
  • Enterprise: Unlimited requests
  • Burst Limit: 100 requests/minute (all plans)
  • Concurrent: 10 simultaneous connections

#### Rate Limit Headers

Every response includes:

X-RateLimit-Limit: 1000

X-RateLimit-Remaining: 950

X-RateLimit-Reset: 1642348800


Handling Rate Limits


#### Best Practices
  • Caching: Cache responses to reduce requests
  • Batch Requests: Use bulk endpoints when possible
  • Retry Logic: Implement exponential backoff
  • Monitor Usage: Track daily request consumption

#### When You Hit Limits

  • 429 Status Code: Too Many Requests
  • Retry-After Header: Wait time in seconds
  • Upgrade Option: Consider Enterprise plan

Code Examples


JavaScript/Node.js


const axios = require('axios');

const API_KEY = 'your-api-key';

const BASE_URL = 'https://api.famelifter.com/v1';


async function getChannelData(channelId) {

try {

const response = await axios.get(

${BASE_URL}/channels/${channelId},

{

headers: {

'Authorization': Bearer ${API_KEY}

}

}

);

return response.data;

} catch (error) {

console.error('API Error:', error.response.data);

}

}


Python


import requests

API_KEY = 'your-api-key'

BASE_URL = 'https://api.famelifter.com/v1'


def get_channel_data(channel_id):

headers = {'Authorization': f'Bearer {API_KEY}'}

response = requests.get(

f'{BASE_URL}/channels/{channel_id}',

headers=headers

)

return response.json()


PHP


$apiKey = 'your-api-key';

$baseUrl = 'https://api.famelifter.com/v1';


function getChannelData($channelId) {

global $apiKey, $baseUrl;


$ch = curl_init("$baseUrl/channels/$channelId");

curl_setopt($ch, CURLOPT_HTTPHEADER, [

"Authorization: Bearer $apiKey"

]);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);


$response = curl_exec($ch);

curl_close($ch);


return json_decode($response, true);

}

?>


Webhooks (Enterprise Only)


Real-Time Notifications


#### Available Webhooks
  • Channel Updates: When channel metrics change significantly
  • Trending Alerts: When content starts trending
  • Milestone Notifications: Subscriber/view milestones reached
  • Performance Alerts: Unusual video performance

#### Webhook Setup

  • Configure Endpoint: Provide your webhook URL
  • Choose Events: Select which events to receive
  • Verify Signature: Validate webhook authenticity
  • Handle Payload: Process incoming notifications

Best Practices


Security


#### Protect Your API Key
  • Environment Variables: Store keys in env files
  • Never Commit: Don't push keys to repositories
  • Rotate Regularly: Change keys every 90 days
  • Use Separate Keys: Different keys for dev/prod

Performance


#### Optimize API Usage
  • Batch Requests: Combine multiple queries
  • Efficient Polling: Use reasonable intervals
  • Compress Responses: Enable gzip compression
  • Minimal Fields: Request only needed data

Error Handling


#### Robust Implementation
  • Retry Logic: Handle temporary failures
  • Timeout Handling: Set appropriate timeouts
  • Logging: Track API interactions
  • Fallback Strategy: Have backup data sources

Troubleshooting


Common Issues


401 Unauthorized
  • Check API key is correct
  • Verify key hasn't expired
  • Ensure proper header format

429 Too Many Requests

  • Slow down request rate
  • Implement rate limit handling
  • Consider upgrading plan

500 Server Error

  • Retry with exponential backoff
  • Check API status page
  • Contact support if persists

API Documentation


Resources


#### Developer Portal
  • Interactive Docs: Try API calls in browser
  • Code Generators: Auto-generate client code
  • Changelog: API version updates
  • Status Page: Real-time API health

#### Support

  • Developer Forum: Community discussions
  • Email Support: [email protected]
  • GitHub Examples: Sample integrations
  • Office Hours: Weekly dev Q&A sessions

Ready to integrate FameLifter API? Access your API dashboard or review the complete API documentation.

Was this article helpful?

Let us know if you found this information useful or if you need additional help.

API Access - Advanced Features | FameLifter Help Center