### Make GET Request to Hashtags Endpoint (Python) Source: https://dev.virlo.ai/docs/quickstart Provides a Python example for making a GET request to the Virlo API's Hashtags endpoint to obtain hashtag analytics. It uses the 'requests' library and requires an API key for authorization. ```python import requests def get_hashtag_analytics(): api_key = "virlo_tkn_" url = "https://api.virlo.ai/v1/hashtags" headers = { "Authorization": f"Bearer {api_key}" } params = { "limit": 50, "order_by": "views", "sort": "desc" } try: response = requests.get(url, headers=headers, params=params) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) return data except requests.exceptions.RequestException as e: print(f"Error fetching hashtag analytics: {e}") get_hashtag_analytics() ``` -------------------------------- ### Make GET Request to Hashtags Endpoint (JavaScript) Source: https://dev.virlo.ai/docs/quickstart Shows how to make a GET request to the Virlo API's Hashtags endpoint using JavaScript to retrieve hashtag analytics. This example utilizes the fetch API and requires an API key for authentication. ```javascript async function getHashtagAnalytics() { const apiKey = "virlo_tkn_"; const url = "https://api.virlo.ai/v1/hashtags"; try { const response = await fetch(`${url}?limit=50&order_by=views&sort=desc`, { method: 'GET', headers: { 'Authorization': `Bearer ${apiKey}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error("Error fetching hashtag analytics:", error); } } getHashtagAnalytics(); ``` -------------------------------- ### Make GET Request to Hashtags Endpoint (cURL) Source: https://dev.virlo.ai/docs/quickstart Demonstrates how to send a GET request to the Virlo API's Hashtags endpoint using cURL to fetch hashtag analytics. Requires an API key for authorization and allows specifying parameters like limit, order_by, and sort. ```cURL curl -G https://api.virlo.ai/v1/hashtags \ -H "Authorization: Bearer virlo_tkn_" \ -d limit=50 \ -d order_by=views \ -d sort=desc ``` -------------------------------- ### GET /v1/hashtags Source: https://dev.virlo.ai/docs/quickstart Retrieve hashtag analytics data. This endpoint allows you to fetch information about hashtags, with options to limit the results, specify ordering, and set the sort direction. ```APIDOC ## GET /v1/hashtags ### Description Retrieve hashtag analytics data. This endpoint allows you to fetch information about hashtags, with options to limit the results, specify ordering, and set the sort direction. ### Method GET ### Endpoint /v1/hashtags ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. - **order_by** (string) - Optional - The field to order the results by (e.g., 'views'). - **sort** (string) - Optional - The sort direction ('asc' or 'desc'). ### Request Example ```json { "example": "curl -G https://api.virlo.ai/v1/hashtags \ -H \"Authorization: Bearer virlo_tkn_\" \ -d limit=50 \ -d order_by=views \ -d sort=desc" } ``` ### Response #### Success Response (200) - **data** (array) - An array of hashtag analytics objects. - **pagination** (object) - Pagination information for the results. #### Response Example ```json { "example": "{\"data\": [{\"hashtag\": \"#example\", \"views\": 1000000}], \"pagination\": {}}" } ``` ``` -------------------------------- ### Example Paginated API Response Structure Source: https://dev.virlo.ai/docs/pagination Illustrates the structure of a paginated response from the Virlo API. The `data` object contains the requested items (e.g., `videos`) along with pagination metadata: `total` (total items), `limit` (items per page), and `offset` (starting position of the current page). ```json { "data": { "total": 97, "limit": 25, "offset": 25, "videos": [ { "id": "WAz8eIbvDR60rouK", "..." }, { "id": "hSIhXBhNe8X1d8Et", "..." } ] } } ``` -------------------------------- ### Get YouTube Hashtags Data (Java) Source: https://dev.virlo.ai/docs/youtube-hashtags This Java code example uses the Apache HttpClient library to make a GET request to the YouTube hashtags API. It demonstrates how to set up the request, include the authorization token, and send query parameters for fetching hashtag analytics. ```java import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import java.net.URI; public class YouTubeHashtagsClient { public static void main(String[] args) { String token = "YOUR_API_TOKEN"; String baseUrl = "https://api.virlo.ai/v1/youtube/hashtags"; try { URIBuilder builder = new URIBuilder(baseUrl); builder.addParameter("start_date", "2025-01-01"); builder.addParameter("end_date", "2025-03-31"); builder.addParameter("limit", "50"); builder.addParameter("order_by", "views"); builder.addParameter("sort", "desc"); URI uri = builder.build(); try (CloseableHttpClient client = HttpClients.createDefault()) { HttpGet request = new HttpGet(uri); request.setHeader("Authorization", "Bearer " + token); try (CloseableHttpResponse response = client.execute(request)) { System.out.println("Status Code: " + response.getStatusLine().getStatusCode()); System.out.println(EntityUtils.toString(response.getEntity())); } } } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Get Videos Digest using Node.js Source: https://dev.virlo.ai/docs/videos This Node.js example demonstrates fetching video data using the 'node-fetch' library. It makes a GET request to the API endpoint, including the authorization token and query parameters for filtering. Replace '{token}' with your actual API key. ```javascript import fetch from 'node-fetch'; async function getVideosDigest(token, limit = 50, niche = 'anime') { const url = `https://api.virlo.ai/v1/videos/digest?limit=${limit}&niche=${niche}`; try { const response = await fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } catch (error) { console.error('Error fetching videos digest:', error); throw error; } } // Example usage: // const apiKey = 'YOUR_API_KEY'; // getVideosDigest(apiKey, 15, 'horror-scary') // .then(data => console.log(data)) // .catch(err => console.error('Failed to get videos:', err)); ``` -------------------------------- ### List Searches (JavaScript) Source: https://dev.virlo.ai/docs/orbit Retrieves a paginated list of keyword search jobs using JavaScript. This example shows how to construct a GET request to the /v1/orbit endpoint with query parameters for limiting and paginating results. ```javascript const url = 'https://api.virlo.ai/v1/orbit'; const token = '{token}'; const limit = 50; const page = 1; const params = new URLSearchParams({ limit: limit, page: page }); fetch(`${url}?${params}`, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Comet Configuration Response (JSON) Source: https://dev.virlo.ai/docs/comet Example JSON response for retrieving a specific comet configuration by ID. It includes all details of the configuration, such as name, keywords, platforms, and scheduling. ```json { "data": { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Tech Reviews", "keywords": ["tech review", "gadget review"], "platforms": ["youtube", "tiktok"], "cadence": "0 0 * * *", "min_views": 10000, "time_range": "this_week", "is_active": true, "is_processing": false, "meta_ads_enabled": false, "last_run_at": "2025-01-15T00:00:00.000Z", "next_run_at": "2025-01-16T00:00:00.000Z", "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z" } } ``` -------------------------------- ### Comet API (Automated Niche Monitoring) Source: https://dev.virlo.ai/docs/index Create automated niche monitoring configurations with scheduled scraping, ads, and creator outlier detection. ```APIDOC ## POST /v1/comet/config ### Description Creates a new configuration for automated niche monitoring. ### Method POST ### Endpoint /v1/comet/config ### Request Body - **niche_name** (string) - Required - The name of the niche to monitor. - **keywords** (array of strings) - Required - Keywords associated with the niche. - **schedule** (string) - Required - The scraping schedule (e.g., 'daily', 'weekly'). - **monitoring_types** (array of strings) - Optional - Types of data to monitor (e.g., 'ads', 'creator_outliers'). - **platforms** (array of strings) - Optional - Platforms to monitor (e.g., 'tiktok', 'instagram', 'youtube'). ### Request Example ```json { "niche_name": "Fitness Influencers", "keywords": ["#fitnessmotivation", "workout tips"], "schedule": "daily", "monitoring_types": ["creator_outliers"], "platforms": ["tiktok", "instagram"] } ``` ### Response #### Success Response (200) - **config_id** (string) - The unique identifier for the monitoring configuration. - **message** (string) - A confirmation message. #### Response Example ```json { "config_id": "com_xyz789", "message": "Niche monitoring configuration created successfully." } ``` ``` -------------------------------- ### Get TikTok Hashtag Analytics (cURL) Source: https://dev.virlo.ai/docs/tiktok-hashtags Example cURL request to fetch TikTok hashtag analytics. It requires start and end dates, with optional parameters for limit, order_by, and sort. The date range is limited to a maximum of 90 days. ```shell curl -G https://api.virlo.ai/v1/tiktok/hashtags \ -H "Authorization: Bearer {token}" \ -d start_date=2025-01-01 \ -d end_date=2025-03-31 \ -d limit=50 \ -d order_by=views \ -d sort=desc ``` -------------------------------- ### Creator Outreach Configuration and API Call Source: https://dev.virlo.ai/docs/comet Illustrates the process for discovering breakout creators for partnership opportunities. It first shows how to create a 'comet' to track a niche using keywords, platforms, cadence, min_views, and time_range. Subsequently, it provides an example of fetching creator outliers based on the created comet ID. ```json // 1. Create a comet to track your niche // POST /v1/comet { "name": "Fitness Creator Discovery", "keywords": ["home workout", "fitness routine", "gym tips"], "platforms": ["youtube", "tiktok", "instagram"], "cadence": "weekly", "min_views": 5000, "time_range": "this_month" } // 2. After data is collected, fetch creator outliers // GET /v1/comet/:id/creators/outliers?order_by=outlier_ratio&sort=desc&limit=10 ``` -------------------------------- ### Pagination Parameters Source: https://dev.virlo.ai/docs/pagination This section details the query parameters used for pagination: `limit` and `page`. It also explains the pagination metadata returned in the response: `total`, `limit`, and `offset`. ```APIDOC ## Pagination Parameters ### Description Controls the number of items per page and the specific page to retrieve. The API response includes metadata about the pagination. ### Query Parameters - **limit** (integer) - Optional - Number of items per page. Value between 1 and 100. Default is 50. - **page** (integer) - Optional - The page number to fetch. 1-indexed. Default is 1. ### Response Body (Data Object) - **total** (integer) - Total number of items across all pages. - **limit** (integer) - The number of items per page (requested via `limit` parameter). - **offset** (integer) - The starting position for the current page (e.g., page 1 = offset 0, page 2 with limit 50 = offset 50). ### Request Example (cURL) ```bash curl -G https://api.virlo.ai/v1/videos \ -H "Authorization: Bearer virlo_tkn_" \ -d limit=25 \ -d page=2 ``` ### Response Example (Success) ```json { "data": { "total": 97, "limit": 25, "offset": 25, "videos": [ { "id": "WAz8eIbvDR60rouK", "..." }, { "id": "hSIhXBhNe8X1d8Et", "..." } ] } } ``` ``` -------------------------------- ### Get YouTube Videos Digest (Node.js) Source: https://dev.virlo.ai/docs/youtube-videos Example Node.js code using 'node-fetch' to get the YouTube videos digest. It shows how to set the Authorization header and query parameters for limit and niche. ```javascript import fetch from 'node-fetch'; const url = 'https://api.virlo.ai/v1/youtube/videos/digest'; const token = '{token}'; const limit = 50; const niche = 'anime'; fetch(`${url}?limit=${limit}&niche=${niche}`, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Retrieve Creator Data with Videos and Outliers (cURL) Source: https://dev.virlo.ai/docs/satellite This cURL command fetches creator data, including associated videos and outlier content, from the Virlo AI API. It specifies the platform, username, and includes optional parameters for filtering and outlier detection. ```bash curl -G https://api.virlo.ai/v1/satellite/creator/tiktok/khaby.lame \ -H "Authorization: Bearer {token}" \ -d include=videos,outliers \ -d max_videos=30 \ -d outlier_threshold=2.5 ``` -------------------------------- ### Get Instagram Hashtag Analytics (Node.js) Source: https://dev.virlo.ai/docs/instagram-hashtags Example Node.js code using the 'axios' library to make a GET request to the Instagram hashtags API. It includes setting the authorization header and query parameters. ```javascript const axios = require('axios'); const token = "YOUR_API_TOKEN"; const url = "https://api.virlo.ai/v1/instagram/hashtags"; const params = { start_date: "2025-01-01", end_date: "2025-03-31", limit: 50, order_by: "views", sort: "desc" }; const headers = { "Authorization": `Bearer ${token}` }; axios.get(url, { params, headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error:', error.response ? error.response.data : error.message); }); ``` -------------------------------- ### Convert Markdown Analysis to HTML in Python Source: https://dev.virlo.ai/docs/orbit This Python example shows how to convert the markdown-formatted analysis text into HTML using the 'markdown' library. This HTML can then be rendered in a web application. ```python import markdown def display_analysis(analysis_text): html = markdown.markdown(analysis_text) return html ``` -------------------------------- ### Render Markdown Analysis in React Source: https://dev.virlo.ai/docs/orbit This JavaScript example demonstrates how to use the 'react-markdown' library to render the markdown-formatted analysis output within a React component. It assumes the analysis text is passed as a prop. ```javascript import ReactMarkdown from 'react-markdown' function AnalysisDisplay({ analysis }) { return (
{analysis}
) } ``` -------------------------------- ### Get YouTube Videos Digest (Python) Source: https://dev.virlo.ai/docs/youtube-videos Example Python code to retrieve the top YouTube videos digest from the Virlo AI API. This demonstrates using the 'requests' library to send a GET request with parameters. ```python import requests url = "https://api.virlo.ai/v1/youtube/videos/digest" headers = { "Authorization": "Bearer {token}" } params = { "limit": 50, "niche": "anime" } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") ``` -------------------------------- ### Get TikTok Videos Digest (Java) Source: https://dev.virlo.ai/docs/tiktok-videos This Java example uses the Apache HttpClient library to make a GET request to the TikTok videos digest endpoint. It shows how to set the authorization header and include query parameters. ```java import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import java.io.IOException; public class TikTokApi { public static void main(String[] args) { String token = "YOUR_API_TOKEN"; String url = "https://api.virlo.ai/v1/tiktok/videos/digest?limit=50&niche=brainrot"; try (CloseableHttpClient client = HttpClients.createDefault()) { HttpGet request = new HttpGet(url); request.addHeader("Authorization", "Bearer " + token); String responseBody = client.execute(request, httpResponse -> { return EntityUtils.toString(httpResponse.getEntity()); }); System.out.println(responseBody); } catch (IOException e) { e.printStackTrace(); } } } ``` -------------------------------- ### Get TikTok Videos Digest (PHP) Source: https://dev.virlo.ai/docs/tiktok-videos This PHP example shows how to make a GET request to the TikTok videos digest endpoint using cURL. It includes setting the necessary headers for authorization and passing query parameters. ```php ``` -------------------------------- ### Queue Keyword Search Job (JavaScript) Source: https://dev.virlo.ai/docs/orbit Queues a new keyword-based video discovery job for social listening using JavaScript. This example shows how to make a POST request to the /v1/orbit endpoint with the necessary authentication and JSON payload. ```javascript const url = 'https://api.virlo.ai/v1/orbit'; const token = '{token}'; const data = { "name": "NYC Mayoral Race Social Listening", "keywords": ["NYC mayor election 2025", "Eric Adams", "Scott Stringer"], "platforms": ["youtube", "tiktok"], "min_views": 10000, "time_period": "this_week", "run_analysis": true, "enable_meta_ads": false, "exclude_keywords": ["spam", "irrelevant"], "exclude_keywords_strict": false }; fetch(url, { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Today's Trends Digest - JavaScript Source: https://dev.virlo.ai/docs/trends Fetches today's trend groups using JavaScript. This example makes a GET request to the `/v1/trends/digest` endpoint. Ensure you replace `{token}` with your valid API token for authentication. ```javascript async function getTrendsDigest() { const token = "{token}"; // Replace with your actual token const url = "https://api.virlo.ai/v1/trends/digest"; try { const response = await fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching trends digest:', error); } } // Example usage: // getTrendsDigest(); ``` -------------------------------- ### Get YouTube Videos Digest (JavaScript) Source: https://dev.virlo.ai/docs/youtube-videos Example JavaScript code to fetch the top YouTube videos digest using the Virlo AI API. This snippet shows how to make a GET request with query parameters for limit and niche. ```javascript const options = { method: 'GET', headers: { 'Authorization': 'Bearer {token}' } }; fetch('https://api.virlo.ai/v1/youtube/videos/digest?limit=50&niche=anime', options) .then(response => response.json()) .then(response => console.log(response)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Instagram Videos Digest (JavaScript) Source: https://dev.virlo.ai/docs/instagram-videos Retrieves trending Instagram videos using JavaScript. This example demonstrates making a GET request to the API endpoint with optional limit and niche parameters. Ensure proper handling of the API token. ```javascript const token = "{token}"; const limit = 50; const niche = "anime"; fetch(`https://api.virlo.ai/v1/instagram/videos/digest?limit=${limit}&niche=${niche}`, { method: "GET", headers: { "Authorization": `Bearer ${token}` } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error)); ``` -------------------------------- ### Monitor Product Mentions with JavaScript Source: https://dev.virlo.ai/docs/orbit This JavaScript code snippet demonstrates how to monitor product mentions using the fetch API to send a POST request to the Virlo AI API's orbit endpoint. It includes parameters for product keywords, platforms, time period, and enabling analysis. ```javascript // Monitor product mentions const response = await fetch('https://api.virlo.ai/v1/orbit', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'Product Sentiment - Weekly Check', keywords: ['your product', 'product reviews', 'unboxing'], platforms: ['youtube', 'tiktok'], time_period: 'this_week', run_analysis: true, }), }) ``` -------------------------------- ### Get Instagram Videos Digest (Java) Source: https://dev.virlo.ai/docs/instagram-videos A Java example for calling the Instagram Videos API. This code demonstrates using Apache HttpClient to send a GET request with the authorization token and query parameters. It includes basic error handling for the HTTP request. ```java import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class InstagramVideos { public static void main(String[] args) { String token = "{token}"; int limit = 50; String niche = "anime"; try (CloseableHttpClient httpclient = HttpClients.createDefault()) { URIBuilder builder = new URIBuilder("https://api.virlo.ai/v1/instagram/videos/digest"); builder.addParameter("limit", String.valueOf(limit)); builder.addParameter("niche", niche); HttpGet httpGet = new HttpGet(builder.build()); httpGet.setHeader("Authorization", "Bearer " + token); try (CloseableHttpResponse response = httpclient.execute(httpGet)) { System.out.println(EntityUtils.toString(response.getEntity())); } } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Create Comet Configuration Source: https://dev.virlo.ai/docs/comet Creates a new custom niche configuration for scraping videos. This endpoint requires parameters such as name, keywords, platforms, cadence, minimum views, and time range. It can also optionally enable Meta ads collection and exclude specific keywords. ```curl curl -X POST https://api.virlo.ai/v1/comet \ -H "Authorization: Bearer {token}" \ -H "Content-Type: application/json" \ -d '{ "name": "Tech Reviews", "keywords": ["tech review", "gadget review", "product review"], "platforms": ["youtube", "tiktok"], "cadence": "daily", "min_views": 10000, "time_range": "this_week", "is_active": true, "meta_ads_enabled": false, "exclude_keywords": ["spam", "clickbait"], "exclude_keywords_strict": false }' ``` ```javascript const createCometConfig = async (token, config) => { const response = await fetch('https://api.virlo.ai/v1/comet', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify(config) }); return await response.json(); }; const config = { name: "Tech Reviews", keywords: ["tech review", "gadget review", "product review"], platforms: ["youtube", "tiktok"], cadence: "daily", min_views: 10000, time_range: "this_week", is_active: true, meta_ads_enabled: false, exclude_keywords: ["spam", "clickbait"], exclude_keywords_strict: false }; // Usage: // createCometConfig('YOUR_API_TOKEN', config).then(console.log); ``` ```python import requests def create_comet_config(token, config): url = "https://api.virlo.ai/v1/comet" headers = { "Authorization": f"Bearer {token}", "Content-Type": "application/json" } response = requests.post(url, headers=headers, json=config) return response.json() config = { "name": "Tech Reviews", "keywords": ["tech review", "gadget review", "product review"], "platforms": ["youtube", "tiktok"], "cadence": "daily", "min_views": 10000, "time_range": "this_week", "is_active": True, "meta_ads_enabled": False, "exclude_keywords": ["spam", "clickbait"], "exclude_keywords_strict": False } # Usage: # print(create_comet_config('YOUR_API_TOKEN', config)) ``` -------------------------------- ### Get Today's Trends Digest - Java Source: https://dev.virlo.ai/docs/trends Fetches today's trend groups using Java's HttpURLConnection. This example shows how to make a GET request to the `/v1/trends/digest` endpoint, including the authorization header. Replace `{token}` with your valid API token. ```java import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class TrendsDigestApiClient { public static void getTrendsDigest() { String token = "{token}"; // Replace with your actual token try { URL url = new URL("https://api.virlo.ai/v1/trends/digest"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", "Bearer " + token); int responseCode = connection.getResponseCode(); System.out.println("GET Response Code :: " + responseCode); if (responseCode == HttpURLConnection.HTTP_OK) { // success BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; StringBuilder response = new StringBuilder(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } else { System.out.println("GET request not worked"); } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { // Example usage: // getTrendsDigest(); } } ``` -------------------------------- ### GET /v1/satellite/creator/:platform/:username Source: https://dev.virlo.ai/docs/satellite Look up a creator's profile, computed video stats, and top hashtags by platform and username. Optionally include their recent videos and content outliers. ```APIDOC ## GET /v1/satellite/creator/:platform/:username ### Description Look up a creator's profile, computed video stats, and top hashtags by platform and username. Optionally include their recent videos and content outliers. ### Method GET ### Endpoint `https://api.virlo.ai/v1/satellite/creator/:platform/:username` ### Parameters #### Path Parameters - **platform** (string) - Required - Social media platform. One of: `youtube`, `tiktok`, `instagram` - **username** (string) - Required - Creator's handle (with or without leading `@`). Example: `mkbhd`, `khaby.lame`, `therock` #### Query Parameters - **include** (string) - Optional - Comma-separated optional sections to include in the response: `videos`, `outliers`. Example: `include=videos,outliers` - **max_videos** (integer) - Optional - Number of videos to fetch and analyze (1-100). Default is `20`. More videos = better stats but slower response. - **outlier_threshold** (number) - Optional - Multiplier for outlier detection. A video is an outlier when `views > median_views * threshold`. Default is `2.0`. Only relevant when `include=outliers`. ### Response #### Success Response (200) - **username** (string) - The looked-up username. - **platform** (string) - The platform queried. - **profile** (CreatorProfile) - Creator's profile data. Omitted if the profile API call fails. - **stats** (CreatorStats) - Computed statistics from analyzed videos. - **hashtags** (HashtagStats[]) - Top 10 hashtags by total views (descending). - **videos** (CreatorVideo[]) - Only present when `include=videos`. - **outliers** (OutliersResponse) - Only present when `include=outliers`. ### Response Example ```json { "data": { "username": "mkbhd", "platform": "youtube", "profile": { "followers": 18000000, "following": 0, "avatar_url": "https://example.com/avatar.jpg", "url": "https://www.youtube.com/channel/UCBJycsm/featured", "description": "Tech reviews, news, and more.", "is_verified": true, "total_videos": 1500, "total_likes": null, "total_views": 5000000000, "total_posts": null }, "stats": { "videos_analyzed": 20, "avg_views": 1000000, "median_views": 800000, "avg_likes": 50000, "avg_comments": 2000, "engagement_rate": 0.05, "top_performing_views": 5000000, "lowest_performing_views": 10000, "posting_frequency_days": 3.5 }, "hashtags": [ { "hashtag": "#tech", "views": 100000000 }, { "hashtag": "#review", "views": 80000000 } ] } } ``` ### CreatorProfile Unified across all platforms. Fields unavailable for a given platform return `null`. * **followers** (number) - Follower/subscriber count. * **following** (number) - Following count (`0` for YouTube). * **avatar_url** (string | null) - Profile picture URL. * **url** (string) - Full profile URL. * **description** (string | null) - Bio/description. * **is_verified** (boolean | null) - Verified badge status. * **total_videos** (number | null) - Total video count on the account. * **total_likes** (number | null) - Total likes received (TikTok only). * **total_views** (number | null) - Total channel views (YouTube only). * **total_posts** (number | null) - Total posts/media count (Instagram only). ### CreatorStats Computed from the fetched videos. * **videos_analyzed** (number) - Number of videos used to compute stats. * **avg_views** (number) - Mean view count. * **median_views** (number) - Median view count. * **avg_likes** (number) - Mean like count. * **avg_comments** (number) - Mean comment count. * **engagement_rate** (number) - `(total_likes + total_comments) / total_views`, rounded to 2 decimals. * **top_performing_views** (number) - Highest view count among analyzed videos. * **lowest_performing_views** (number) - Lowest view count among analyzed videos. * **posting_frequency_days** (number | undefined) - Average days between posts. Only present if 2+ videos have publish dates. ``` -------------------------------- ### Get Today's Trends Digest - Node.js Source: https://dev.virlo.ai/docs/trends Fetches today's trend groups using Node.js. This example utilizes the 'https' module to send a GET request to the `/v1/trends/digest` endpoint, including the required authorization header. Replace `{token}` with your API key. ```javascript const https = require('https'); function getTrendsDigest() { const token = "{token}"; // Replace with your actual token const options = { hostname: 'api.virlo.ai', path: '/v1/trends/digest', method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { if (res.statusCode >= 200 && res.statusCode < 300) { const result = JSON.parse(data); console.log(result); return result; } else { console.error(`HTTP Error: ${res.statusCode}`); console.error(data); } }); }); req.on('error', (error) => { console.error('Error fetching trends digest:', error); }); req.end(); } // Example usage: // getTrendsDigest(); ``` -------------------------------- ### Scheduling Options: Simple Cadences (Text) Source: https://dev.virlo.ai/docs/comet This section outlines the predefined scheduling options available for tasks in the Virlo AI system. It includes shortcuts for daily, weekly, and monthly executions. ```text * "daily" - Runs once per day at midnight UTC (equivalent to "0 0 * * *"') * "weekly" - Runs once per week on Sunday at midnight UTC (equivalent to "0 0 * * 0"') * "monthly" - Runs once per month on the 1st at midnight UTC (equivalent to "0 0 1 * *"') ``` -------------------------------- ### Get Today's Trends Digest - PHP Source: https://dev.virlo.ai/docs/trends Fetches today's trend groups using PHP. This example uses cURL to make the GET request to the `/v1/trends/digest` endpoint, including the authorization header. Ensure `{token}` is replaced with your valid API token. ```php = 200 && $httpCode < 300) { $data = json_decode($response, true); print_r($data); return $data; } else { echo "HTTP Error: " . $httpCode . "\n"; echo "Response: " . $response . "\n"; } } curl_close($ch); return null; } // Example usage: // getTrendsDigest(); ?> ``` -------------------------------- ### Get Trends by Date Range - JavaScript Source: https://dev.virlo.ai/docs/trends Fetches trend groups within a specified date range using JavaScript. This example demonstrates how to make a GET request with query parameters for date range and limit. Ensure to replace `{token}` with your actual API token. ```javascript async function getTrends(startDate, endDate, limit) { const token = "{token}"; // Replace with your actual token const url = `https://api.virlo.ai/v1/trends?start_date=${startDate}&end_date=${endDate}&limit=${limit}`; try { const response = await fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching trends:', error); } } // Example usage: // getTrends('2025-10-14', '2025-10-16', 50); ```