# Get audience analysis Source: https://docs.streamforge.com/api-reference/advanced/get-audience-analysis GET /platforms/{platform}/profiles/{profile_id}/audience Retrieve AI-enriched audience intelligence for a creator profile, including audience demographics, interests, community health, and brand-safety statistics. Supply the platform and its platform-specific profile ID. Audience analysis is returned only when available. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Get profile analysis Source: https://docs.streamforge.com/api-reference/advanced/get-profile-analysis GET /platforms/{platform}/profiles/{profile_id}/analysis Retrieve AI-enriched intelligence for a creator profile, including demographics, classifications, interests, and business data. Supply the platform and its platform-specific profile ID. Analysis is returned only when it is available for that creator. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Get profile email Source: https://docs.streamforge.com/api-reference/advanced/get-profile-email GET /platforms/{platform}/profiles/{profile_id}/email Retrieve a discovered email address for a creator profile when one is available. Supply the platform and its platform-specific profile ID. An email is not guaranteed for every creator. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Get profile socials Source: https://docs.streamforge.com/api-reference/advanced/get-profile-socials GET /platforms/{platform}/profiles/{profile_id}/socials Retrieve cross-platform profile links that Streamforge has matched to the same creator. The response identifies related accounts across supported platforms rather than returning a full creator profile. Social-linking data is returned only when a confident match is available. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Get brand Source: https://docs.streamforge.com/api-reference/brands/get-brand GET /brands/{brand_id} One brand's creator sponsorships over the trailing year of published Market Intelligence data: sponsored posts, distinct creators, platforms, booking cadence and repeat rate, its share of voice in its industry over the last 90 days, and the creators it booked most. Posts are counted when a creator's post was detected as a sponsorship of the brand. Affiliate (commission) posts are reported separately in `affiliate_posts` and not counted as sponsorships, and posts from brand accounts (the brand's own, another brand's, or one the creator analysis classifies as brand-owned) are left out. Share of voice follows the Industry Explorer measure: the brand's posts over every sponsored post in its industry in the same 90 days. Costs 0.1 credit. Available with a Streamforge API key only. # List brands Source: https://docs.streamforge.com/api-reference/brands/list-brands GET /brands Brands with creator sponsorship activity in the trailing year of published Market Intelligence data, most sponsored posts first. Optionally filtered to one industry. Use it to walk the brands you want profiles for, then call `GET /brands/{brand_id}` for each. Costs 0.01 credit per call, whatever the `limit`. Available with a Streamforge API key only. # Search brands Source: https://docs.streamforge.com/api-reference/brands/search-brands GET /brands/search Search the Market Intelligence brand catalogue by name or domain. Matching ignores case, accents and punctuation ("radio canada" finds "Radio-Canada"). Results are ranked by match quality: exact names first, then name prefixes, then word-start and substring matches. Costs 0.01 credit per request, whatever the `limit`. Available with a Streamforge API key only. # Get multiple content items Source: https://docs.streamforge.com/api-reference/content/bulk-content POST /platforms/{platform}/content Fetch multiple content items in a single request. Accepts up to 25 content IDs; more returns a `400` validation error. Costs 0.01 credit per call, whatever the number of IDs. # Get single content item Source: https://docs.streamforge.com/api-reference/content/get-content GET /platforms/{platform}/content/{content_id} Retrieve a content item with the Streamforge API using its platform and content ID. Explore parameters, response fields, statistics, and error responses. # List content Source: https://docs.streamforge.com/api-reference/content/list-content GET /platforms/{platform}/content List content for a platform with the Streamforge API. Explore filters, sorting options, request limits, and cursor pagination to retrieve the results you need. # List content by profile Source: https://docs.streamforge.com/api-reference/content/list-content-by-profile GET /platforms/{platform}/profiles/{profile_id}/content List a creator's content with the Streamforge API using a platform and profile ID. Explore date filters, sorting, request limits, and cursor pagination options. # Request a creator Source: https://docs.streamforge.com/api-reference/creator-requests/create-creator-request POST /creator-requests Ask Streamforge to prepare a creator: fetch the profile and, unless you opt out with `audience: false`, produce the audience analysis. Use it for a creator the profile endpoints answer `404` for, or one that has a profile but no audience analysis yet. Identify the creator in one of three ways: `platform` with `handle`, `platform` with `profile_id`, or a profile `url` on its own. A link that is not a creator profile, such as a video, a post or a search page, is rejected with `unsupported_profile_url` rather than guessed at. The request is asynchronous: - If everything you asked for can already be served, the answer is `200` and the data is in `result`. - Otherwise the answer is `202`, with the request's address in the `Location` header. Read `GET /creator-requests/{request_id}` after `Retry-After` seconds, and again until it answers `200`. `pending` and `processing` mean the request is in progress. A finished request has one of four statuses: | Status | Meaning | |--------|---------| | `ready` | The profile is in `result`, and so is the audience analysis if you asked for it | | `partial` | The profile is in `result`; the audience analysis is not. `parts.audience` and `audience_reason` say why | | `not_found` | There is no such creator on that platform | | `failed` | The request could not be completed. You can request the creator again | `partial` is an ordinary outcome, not an error. An audience analysis is not always possible: there may not be enough public audience data for the creator (`insufficient_data`), it may not be available for the creator's platform (`unsupported`), the daily capacity for new analyses may be used up (`unavailable`, in which case request the creator again after the daily reset), or the analysis itself may not complete (`failed`). `result.profile` is filled in as soon as the profile can be served, which can be while the audience analysis is still in progress. **Credits**: an accepted request (`200` or `202`) costs 1 credit, once. Sending the same request again while it is in progress returns that request and costs nothing. The credit is returned if the request ends `not_found` or `failed`. `meta.credits_charged` is what the request has cost in total and the `X-Credits-request-cost` header is what this call cost, both in credits. Available with a Streamforge API key only. # Get a creator request Source: https://docs.streamforge.com/api-reference/creator-requests/get-creator-request GET /creator-requests/{request_id} Read a request made with `POST /creator-requests`. The body is the same as that endpoint's. While the request is in progress the answer is `202` with `Retry-After` and `Location`; wait, then read it again. Once the request has finished the answer is `200`, and later reads return the same outcome. See `POST /creator-requests` for what each status and each `parts.audience` value means. `result.profile` is filled in as soon as the profile can be served, which can be while the audience analysis is still in progress. Reading a request costs no credits. Each read does count towards your per-minute rate limit, so wait `poll_after_seconds` between reads. A request can be read only with the API key that created it; with any other key the answer is `404`. A request stays readable for 7 days. Available with a Streamforge API key only. # Get multiple games Source: https://docs.streamforge.com/api-reference/games/bulk-games POST /platforms/{platform}/games Fetch multiple games by platform-specific game IDs or IGDB IDs in a single request. Accepts up to 25 game IDs; more returns a `400` validation error. - For Twitch: provide Twitch game IDs - For YouTube: provide YouTube game channel IDs - For IGDB: provide IGDB game IDs directly Costs 0.01 credit per call, whatever the number of IDs. # Get game by platform ID Source: https://docs.streamforge.com/api-reference/games/get-game GET /platforms/{platform}/games/{game_id} Fetch a game by platform-specific game ID or IGDB ID. - For Twitch: provide Twitch game ID - For YouTube: provide YouTube game channel ID - For IGDB: provide IGDB game ID directly Costs 0.01 credit. # Get content for a game Source: https://docs.streamforge.com/api-reference/games/get-game-content GET /platforms/{platform}/games/{game_id}/content Fetch content (streams/videos) related to a specific game, sorted by creation/publication date. Games only exist on Twitch and YouTube platforms. Costs 0.01 credit per call, whatever the `limit`. # Search games Source: https://docs.streamforge.com/api-reference/games/search-games GET /games/search Search normalized game metadata by name using a 1 to 200 character query. Optionally restrict results to games available on Twitch or YouTube and request 1 to 12 results on paid plans (default 12). Results are ordered by popularity (total rating count) and then by name. BASIC allows up to 5 game search results per request; paid plans allow up to 12. Requests exceeding the limit return a validation error. Each additional batch or page uses another request. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Health check Source: https://docs.streamforge.com/api-reference/health/health-check GET / Check whether the Streamforge API is available. This public endpoint requires no authentication, and returns a ready status when the service is healthy. # Get industry Source: https://docs.streamforge.com/api-reference/industries/get-industry GET /industries/{industry_id} One industry over the trailing 90 days of published data and the 90 days before: totals, platforms, and its brand ranking by estimated creator spend (or by sponsored posts). The ranking covers the 100 brands with the most sponsored posts in the window. Estimated spend prices each valued sponsored post with the product's sponsorship value model and excludes affiliate posts; `spend_coverage` is the share of posts that could be valued. The ranking is returned 25 brands per page. Follow `paging.next_cursor`, with the same `sort`, for the rest. Ranks continue across pages, so the second page starts at rank 26. Every page repeats the industry's totals and platforms. Costs 0.1 credit per call. Available with a Streamforge API key only. # List industries Source: https://docs.streamforge.com/api-reference/industries/list-industries GET /industries The 36 industries Market Intelligence tracks, with brands, sponsored posts, creators and estimated creator spend for the trailing 90 days of published data and the 90 days before. Industries without a current summary are listed with `available: false`. Sorted by estimated spend. The list comes 25 industries per page; follow `paging.next_cursor` for the rest. Costs 0.1 credit per call. Available with a Streamforge API key only. # Get multiple profiles Source: https://docs.streamforge.com/api-reference/profiles/bulk-profiles POST /platforms/{platform}/profiles Retrieve multiple creator profiles in one Streamforge API request. Learn platform and ID requirements, request format, response fields, and missing-ID handling. # Get single profile Source: https://docs.streamforge.com/api-reference/profiles/get-profile GET /platforms/{platform}/profiles/{profile_id} Retrieve a creator profile with the Streamforge API using a platform and profile ID. Explore parameters, profile fields, statistics, and error responses. # List profiles Source: https://docs.streamforge.com/api-reference/profiles/list-profiles GET /platforms/{platform}/profiles Browse creator profiles for a platform with the Streamforge API. Learn to set request limits, use cursor pagination, and read profile data in the response. # Fetch profile IDs by handle Source: https://docs.streamforge.com/api-reference/profiles/lookup-handles POST /platforms/{platform}/profiles/lookup Resolve 1 to 25 creator handles on a single platform to their platform-specific profile IDs. This lightweight endpoint returns handle-to-ID mappings only, not full profile records. Use the returned IDs with the profile, content, analysis, email, social-link, and audience endpoints. BASIC allows up to 5 handles per request; paid plans allow up to 25. Requests exceeding the limit return a validation error. Each additional batch or page uses another request. **RapidAPI billing:** One request per call. This focused listing has no credit weights. Monthly request quotas have hard limits. # Search creators by name Source: https://docs.streamforge.com/api-reference/profiles/search-profiles GET /platforms/{platform}/profiles/search Find creators on one platform by the start of their display name or handle. Matching ignores case and accents, and a handle matches with or without its spaces, so `kai c` finds `KaiCenat` and `mr b` finds `@mrbeast`. The creator whose handle is exactly the query comes first; the rest follow by followers, most followed first. Searches by Discovery's inclusion rule: at least 1,000 followers and content in the last 90 days (180 days on Instagram). Results are full profiles, the same shape `GET /platforms/{platform}/profiles/{profile_id}` returns, so `profile_image` and `statistics.followers` are ready to display. Costs 0.01 credit per request, whatever the `limit`. Available with a Streamforge API key only. # Estimate a rate Source: https://docs.streamforge.com/api-reference/rates/estimate-rate GET /rates/estimate A typical sponsorship rate range for one piece of content, from the published rate snapshot. On-demand content is priced per 1,000 views; live streams per average concurrent viewer. The range widens with the snapshot's confidence in the country and industry (15%, 25% or 40% either side of the estimate) and is rounded outward to two significant figures. Rates are for creators who sell their own sponsorships, and exclude usage rights, exclusivity, agency fees and bundles. Costs 0.01 credit. Available with a Streamforge API key only. # Rate benchmarks Source: https://docs.streamforge.com/api-reference/rates/get-rate-benchmarks GET /rates/benchmarks Unit-rate ranges for every priced format in one industry and country: per 1,000 views for on-demand content and per average concurrent viewer for live streams, rounded as in `GET /rates/estimate`. Costs 0.1 credit. Available with a Streamforge API key only. # Rate dimensions Source: https://docs.streamforge.com/api-reference/rates/get-rate-dimensions GET /rates/dimensions The countries, industries and content formats the published rate snapshot prices, with the snapshot's confidence in each country and industry. Use the ids with `GET /rates/estimate` and `GET /rates/benchmarks`. Costs 0.01 credit. Available with a Streamforge API key only. # Authentication & Rate Limits Source: https://docs.streamforge.com/essentials/authentication Authenticate Streamforge API requests with an API key, read rate-limit headers, handle throttling, and learn how to rotate or revoke access for integrations. Every request must include a valid API key. ## Supplying the API key Use the `x-api-key` header: ```http theme={null} GET /platforms/twitch/profiles/12345 HTTP/1.1 Host: external-api.streamforge.com x-api-key: YOUR_API_KEY ``` Requests without the header return `401 Unauthorized`. Unknown keys return `403 Forbidden`. ## Rate limits Each key is provisioned with a per minute window request limit(defaults shown below; your allocations may differ): | Window | Default allowance | Header for limit | Header for remaining | Reset header | | - | - | - | - | - | | Minute | 1,000 requests | `X-RateLimit-minute-limit` | `X-RateLimit-minute-remaining` | `X-RateLimit-minute-reset` | Every call counts as one request, whatever it costs in credits and however many items it names. Credits are separate; see [Credit Management](/guides/credit-management). When a limit is hit: * The API returns `429 Too Many Requests`. * Response headers still include the remaining limit and a `Retry-After` header indicating seconds until the window resets. ### Interpreting headers Example response headers: ``` X-RateLimit-minute-limit: 1000 X-RateLimit-minute-remaining: 428 X-RateLimit-minute-reset: 1731001800 ``` * `X-RateLimit-minute-limit`: Your maximum total requests per minute window. * `X-RateLimit-minute-remaining`: How many requests you can still make within the 1 minute window. * `X-RateLimit-minute-reset`: UNIX timestamp (seconds) when that window resets. ### Usage logging We log every request to an internal usage stream. If you need exports for billing/reconciliation, contact support. ## Key rotation & revocation * Keys can be rotated by the Streamforge team on request, old keys are immediately invalid. ## Best practices * **Distribute load**: If you run high-concurrency jobs, stagger requests to avoid spikes at window boundaries. * **Handle 429**: Implement an exponential backoff and respect `Retry-After`. * **Monitor usage**: Use the rate-limit headers so you know when you're close to limits. # Advanced Insights Source: https://docs.streamforge.com/guides/advanced-insights Explore Streamforge API creator and audience analysis, email lookups, and linked social profiles, with guidance on available fields, missing data, and usage. Advanced insights provide AI-enriched metadata about creators, including demographics, classifications, interests, and audience analysis. ## Advanced Endpoints Four endpoints provide advanced insights: | Endpoint | Description | Price Tier | Credit Cost | | - | - | - | - | | `/platforms/{platform}/profiles/{profile_id}/analysis` | AI-enriched creator analysis | Premium | 1 credit | | `/platforms/{platform}/profiles/{profile_id}/email` | Creator contact email | Advanced | 0.1 credit | | `/platforms/{platform}/profiles/{profile_id}/socials` | Cross-platform profile linking | Advanced | 0.1 credit | | `/platforms/{platform}/profiles/{profile_id}/audience` | Audience demographics and analysis | Premium | 1 credit | > [!NOTE] > > See the [API Reference](/api-reference/advanced/get-profile-analysis) for complete response schemas and field descriptions. ## When to Use Advanced Insights Use advanced insights for: * **Brand partnership evaluation**: Assess audience alignment and brand safety * **Creator discovery**: Find creators matching specific demographics or interests * **Market research**: Understand audience composition across creators * **Cross-platform matching**: Find creators on multiple platforms using the `/socials` endpoint * **Outreach**: Get a creator's contact information via the `/email` endpoint ## Creator Analysis The `/analysis` endpoint provides AI-enriched creator-level data including: * **Demographics**: Gender, age range, nationality, residence * **Content classification**: Primary topics, categories, content formats * **Interests**: Ranked interests with strength ratings and reasons * **Personal details**: Real name, aliases, birthday (when publicly known) * **Business information**: Collaborations, monetization streams, ventures * **Appearance**: Whether they show their face, VTuber status, etc. ## Creator Email The `/email` endpoint returns the creator's primary contact email address when available. Returns 404 if no email is on file. ## Creator Socials The `/socials` endpoint provides cross-platform linking data that identifies when the same creator has profiles across multiple platforms (YouTube, Twitch, TikTok, Instagram, Twitter, etc.). The response includes an array of profiles with: * Platform identifier * Platform-specific profile ID * Follower count ## Audience Analysis The `/audience` endpoint provides detailed audience demographics including: * **Demographics**: Gender, age, country, language, ethnicity distributions * **Socioeconomic**: Income, education, occupation, family status * **Interests**: Ranked audience interests with sub-interests * **Community health**: Loyalty, cohesion, and toxicity scores with signals * **Brand safety**: Overall risk level and specific risk factors The response includes a `last_updated_at` timestamp indicating when the analysis was generated. ## Best Practices * **Cache results**: Advanced insights are regenerated infrequently. Cache `/analysis` and `/audience` data aggressively. * **Use selectively**: Fetch basic profile data first, then advanced insights only for creators you're evaluating. * **Handle missing data**: Some creators may not have advanced insights available (returns 404). With a Streamforge API key you can ask for a missing profile or audience analysis with a [creator request](/guides/creator-requests). # Bulk Operations Source: https://docs.streamforge.com/guides/bulk-operations Fetch multiple profiles, content items, or games with Streamforge API bulk requests. Learn request formats, batching, credit costs, and handling missing IDs. Bulk endpoints allow you to fetch multiple items (profiles, content, or games) in a single API request. This is more efficient than making individual requests and helps you stay within rate limits. ## When to Use Bulk Operations Use bulk endpoints when you need to: * Fetch **multiple items** (2-25 items per call) * **Reduce HTTP overhead** and improve performance * **Minimize credit usage** for multiple items * **Avoid URL length limits** (POST requests don't have URL length restrictions) ## Bulk Endpoints The API provides bulk endpoints for three resource types: ### Profiles ``` POST /platforms/{platform}/profiles ``` ### Content ``` POST /platforms/{platform}/content ``` ### Games ``` POST /platforms/{platform}/games ``` ## Request Format All bulk endpoints use the same request structure: ```json theme={null} { "profile_ids": ["12345", "67890", "11111"] } ``` or ```json theme={null} { "content_ids": ["abc", "def", "ghi"] } ``` or ```json theme={null} { "game_ids": ["2011938005", "491487", "490377"] } ``` ## Limits * **Minimum**: 1 item * **Maximum**: 25 items per request. More returns a `400` validation error whose `error.details` say, for example, `profile_ids cannot exceed 25 items` * **Credit cost**: 0.01 credit per call, whatever the number of items ## Response Structure Bulk responses include metadata about which items were found and which were missing: ```json theme={null} { "payload": [ { "id": "12345", "name": "creator1", ... }, { "id": "67890", "name": "creator2", ... } ], "meta": { "missing_ids": ["11111"] } } ``` ## Handling Partial Failures Bulk operations are **partial success** operations. If some items are missing: * The request still succeeds (HTTP 200) * Found items are returned in `payload` * Missing items are listed in `meta.missing_ids` * You can check `meta.found_ids` to verify which items were returned ### Example: Handling Missing Items ```javascript theme={null} async function fetchProfiles(profileIds) { const response = await fetch( `/platforms/twitch/profiles`, { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ profile_ids: profileIds }) } ); const data = await response.json(); // Check for missing items if (data.meta.missing_ids.length > 0) { console.warn(`Missing profiles: ${data.meta.missing_ids.join(', ')}`); } return data.payload; } ``` ## Batching Large Requests If you need to fetch more than 25 items, split them into batches: ```javascript theme={null} async function fetchManyProfiles(profileIds) { const batchSize = 25; const batches = []; // Split into batches of 25 for (let i = 0; i < profileIds.length; i += batchSize) { batches.push(profileIds.slice(i, i + batchSize)); } // Fetch all batches const results = await Promise.all( batches.map(batch => fetch('/platforms/twitch/profiles', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ profile_ids: batch }) }).then(r => r.json()) ) ); // Combine results return results.flatMap(r => r.payload); } ``` ## Quota Efficiency A bulk call costs 0.01 credit, whatever the number of items it names: | Operation | Credit Cost | | - | - | | Single profile request | 0.01 credit | | Bulk request (25 profiles) | 0.01 credit | | 25 individual requests | 0.25 credit | Bulk operations also: * Reduce HTTP overhead * Improve performance (single round-trip) * Avoid rate limit spikes from many concurrent requests ## Best Practices > [!TIP] > > Use bulk endpoints whenever you need 2+ items. The performance benefits outweigh the complexity. * **Deduplicate IDs**: Remove duplicate IDs before sending (the API may dedupe, but it's better to do it client-side) * **Handle missing items**: Always check `missing_ids` and handle gracefully * **Batch large requests**: Split requests larger than 25 items into multiple batches * **Monitor quota**: Each batch is one call against your credits and your per-minute rate limit * **Error handling**: Implement retry logic for failed bulk requests ## Example: Bulk Profile Fetch ```bash theme={null} curl -X POST \ -H "x-api-key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "profile_ids": [ "484563826", "775305965", "116216805" ] }' \ https://external-api.streamforge.com/platforms/twitch/profiles ``` ## Comparison: Bulk vs Individual Requests | Aspect | Bulk | Individual | | - | - | - | | HTTP requests | 1 | N (one per item) | | Credit cost | 0.01 credit per call | 0.01 credit per item | | Performance | Faster | Slower | | Error handling | Partial success | All-or-nothing | | URL length | No limit | Limited | > [!WARNING] > > Don't use bulk endpoints for single items. Use the individual GET endpoints instead for better error messages and simpler code. # Content Analysis Source: https://docs.streamforge.com/guides/content-analysis Analyze streams, videos, and posts with the Streamforge API. Explore content endpoints, engagement statistics, date filters, and performance comparisons. Learn how to fetch, filter, and analyze content (streams, videos, and posts) from creators and platforms. ## Content Endpoints The API provides several ways to access content: * `GET /platforms/{platform}/content/{content_id}` - Get single content item * `GET /platforms/{platform}/content` - List all content for a platform * `GET /platforms/{platform}/profiles/{profile_id}/content` - List content by creator * `GET /platforms/{platform}/games/{game_id}/content` - List content for a game * `POST /platforms/{platform}/content` - Get multiple content items ## Content Types Content types vary by platform: | Platform | Content Types | | - | - | | Twitch | `stream`, `video` | | YouTube | `video`, `short` | | TikTok | `video`, `short` | | Instagram | `post`, `video`, `story` | | X (Twitter) | `post`, `repost` | > [!NOTE] > > X content uses the platform key `twitter`. Reposts (retweets) are returned as `repost`. The `shares` statistic maps to reposts, `comments` maps to replies, and a `quotes` statistic is included for quote posts. > [!WARNING] > > Instagram stories are only available via direct ID lookup and are excluded from list operations. Story availability is limited and depends on internal data collection processes - do not expect comprehensive story coverage for any given creator. ## Getting Content by Creator Fetch all content from a specific creator: ```javascript theme={null} async function getCreatorContent(platform, profileId) { let cursor = null; const allContent = []; do { const response = await fetch( `/platforms/${platform}/profiles/${profileId}/content?limit=25${cursor ? `&cursor=${cursor}` : ''}`, { headers: { 'x-api-key': 'YOUR_API_KEY' } } ); const data = await response.json(); allContent.push(...data.payload); cursor = data.paging.next_cursor; } while (cursor !== null); return allContent; } ``` ## Content statistics Content items include detailed statistics: ```json theme={null} { "id": "987654321", "title": "Awesome Stream", "type": "stream", "created_at": "2024-07-04T10:00:00.000Z", "ended_at": "2024-07-04T11:30:00.000Z", "duration": 5400000, "statistics": { "viewers": { "avg": 2345.6, "max": 6789 }, "watched_minutes": { "sum": 123456 }, "views": { "sum": 45678 }, "comments": { "sum": 900 } } } ``` ### Understanding Statistics * **`statistics.views.sum`**: Total view count * **`statistics.viewers.avg`**: Average concurrent viewers (for streams) * **`statistics.viewers.max`**: Peak concurrent viewers * **`statistics.watched_minutes.sum`**: Total watch time in minutes * **`duration`**: Content duration in milliseconds ## Analyzing Content Performance ### Calculate Average Views ```javascript theme={null} function calculateAverageViews(content) { const views = content .map(item => item.statistics?.views?.sum || 0) .filter(views => views > 0); if (views.length === 0) return 0; const sum = views.reduce((a, b) => a + b, 0); return sum / views.length; } ``` ### Find Top Performing Content ```javascript theme={null} function getTopContent(content, metric = 'views', limit = 10) { return content .sort((a, b) => { // Handle nested statistics like views.sum const aValue = metric === 'views' ? (a.statistics?.views?.sum || 0) : (a.statistics?.[metric]?.sum || a.statistics?.[metric] || 0); const bValue = metric === 'views' ? (b.statistics?.views?.sum || 0) : (b.statistics?.[metric]?.sum || b.statistics?.[metric] || 0); return bValue - aValue; }) .slice(0, limit); } // Usage const topVideos = getTopContent(content, 'views', 5); ``` ### Calculate Engagement Rate ```javascript theme={null} function calculateEngagementRate(content) { return content.map(item => { const views = item.statistics?.views?.sum || 0; const comments = item.statistics?.comments?.sum || 0; const engagementRate = views > 0 ? (comments / views) * 100 : 0; return { ...item, engagementRate: engagementRate.toFixed(2) }; }); } ``` ## Time-Based Analysis ### Filter by Date Range ```javascript theme={null} function filterByDateRange(content, startDate, endDate) { const start = new Date(startDate); const end = new Date(endDate); return content.filter(item => { const createdAt = new Date(item.created_at); return createdAt >= start && createdAt <= end; }); } // Usage const recentContent = filterByDateRange( content, '2024-01-01', '2024-12-31' ); ``` ### Analyze Trends Over Time ```javascript theme={null} function analyzeTrends(content) { // Group by month const byMonth = content.reduce((acc, item) => { const date = new Date(item.created_at); const month = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`; if (!acc[month]) { acc[month] = { count: 0, totalViews: 0 }; } acc[month].count++; acc[month].totalViews += item.statistics?.views?.sum || 0; return acc; }, {}); return Object.entries(byMonth).map(([month, stats]) => ({ month, contentCount: stats.count, totalViews: stats.totalViews, averageViews: stats.totalViews / stats.count })); } ``` ## Platform-Specific Features ### Twitch Chapters Twitch streams include aggregated chapter data: ```json theme={null} { "chapters": [ { "id": "chapter-1", "title": "Opening", "created_at": "2024-07-04T10:00:00.000Z", "ended_at": "2024-07-04T10:30:00.000Z", "duration": 1800000, "statistics": { "viewers": { "avg": 2000, "max": 4000 } } } ] } ``` Analyze chapter performance: ```javascript theme={null} function analyzeChapters(stream) { if (!stream.chapters || stream.chapters.length === 0) { return null; } return stream.chapters.map(chapter => ({ title: chapter.title, duration: chapter.duration / 1000 / 60, // minutes avgViewers: chapter.statistics?.viewers?.avg || 0, peakViewers: chapter.statistics?.viewers?.max || 0 })); } ``` ### Categories and Tags Content includes categories (games) and tags: ```json theme={null} { "categories": [ { "id": "1234", "name": "Some Game", "type": "twitch_game", "igdb_id": 5678, "igdb_name": "Some Game", "igdb_slug": "some-game" } ], "tags": ["gaming", "live"] } ``` Find most common games: ```javascript theme={null} function findMostCommonGames(content) { const gameCounts = {}; content.forEach(item => { item.categories?.forEach(category => { if (category.type.includes('game')) { const gameName = category.igdb_name || category.name; gameCounts[gameName] = (gameCounts[gameName] || 0) + 1; } }); }); return Object.entries(gameCounts) .sort(([, a], [, b]) => b - a) .map(([game, count]) => ({ game, count })); } ``` ## Content Comparison ### Compare Creators ```javascript theme={null} async function compareCreators(platform, profileIds) { const results = await Promise.all( profileIds.map(id => fetch(`/platforms/${platform}/profiles/${id}/content?limit=10`) .then(r => r.json()) ) ); return results.map((data, index) => ({ profileId: profileIds[index], contentCount: data.payload.length, totalViews: data.payload.reduce( (sum, item) => sum + (item.statistics?.views?.sum || 0), 0 ), averageViews: calculateAverageViews(data.payload) })); } ``` ### Compare Time Periods ```javascript theme={null} function comparePeriods(content, period1, period2) { const p1 = filterByDateRange(content, period1.start, period1.end); const p2 = filterByDateRange(content, period2.start, period2.end); return { period1: { count: p1.length, totalViews: p1.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0), avgViews: calculateAverageViews(p1) }, period2: { count: p2.length, totalViews: p2.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0), avgViews: calculateAverageViews(p2) }, change: { count: ((p2.length - p1.length) / p1.length * 100).toFixed(1), views: ((p2.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0) - p1.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0)) / p1.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0) * 100).toFixed(1) } }; } ``` ## Best Practices > [!TIP] > > Use bulk endpoints when fetching multiple content items. It's more efficient than individual requests. * **Paginate efficiently**: Use `limit` values up to 25; a page costs the same at any size * **Cache content data**: Content metrics don't change frequently; cache for performance * **Filter client-side**: Use date ranges and filters to reduce unnecessary requests * **Handle missing metrics**: Some content may not have all metrics; handle nulls gracefully * **Monitor quota**: Each page of a list is one call, 0.01 credit whatever its `limit` ## Use Cases ### Content Performance Dashboard ```javascript theme={null} async function buildContentDashboard(platform, profileId) { const content = await getCreatorContent(platform, profileId); return { totalContent: content.length, totalViews: content.reduce((sum, item) => sum + (item.statistics?.views?.sum || 0), 0), averageViews: calculateAverageViews(content), topContent: getTopContent(content, 'views', 10), trends: analyzeTrends(content), commonGames: findMostCommonGames(content) }; } ``` ### Content Discovery ```javascript theme={null} async function discoverTrendingContent(platform, limit = 20) { const response = await fetch( `/platforms/${platform}/content?limit=${limit}&sort=views&order=desc`, { headers: { 'x-api-key': 'YOUR_API_KEY' } } ); return response.json(); } ``` > [!WARNING] > > Content list endpoints return at most 25 items per page and cost 0.01 credit per page, whatever the `limit`. A larger `limit` is lowered to 25. # Creator Discovery Workflow Source: https://docs.streamforge.com/guides/creator-discovery Follow a Streamforge API workflow to look up creator profiles, review content statistics, explore audience analysis, and connect profiles across platforms. This guide walks you through a complete workflow for discovering creators, fetching their data, and analyzing their content and audience. ## Step 1: Find a Creator Profile Start by fetching a creator's profile using their platform-specific ID: ```javascript theme={null} // Fetch a Twitch creator profile const profile = await fetch( '/platforms/twitch/profiles/484563826', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); console.log(profile.payload.display_name); // "Streamer 123" console.log(profile.payload.statistics.followers); // 120000 ``` ### Don't have the ID? Search by name `GET /platforms/{platform}/profiles/search` takes the start of a display name or handle, the way a person types it into a search box. It ignores case and accents, and handles match without their spaces, so `kai c` finds `KaiCenat`. The creator whose handle is exactly what you typed comes first, then the most followed creators: ```javascript theme={null} const results = await fetch( '/platforms/twitch/profiles/search?q=kai%20c&limit=5', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); for (const creator of results.payload) { console.log(creator.display_name, creator.profile_image, creator.statistics.followers); } ``` Search follows Discovery's inclusion rule: at least 1,000 followers and content in the last 90 days (180 on Instagram). Each result is a full profile, so you can show it without a second call. The query needs at least 2 characters besides a leading @. A search costs 0.01 credit per request, whatever the `limit` (1-25, default 10). Results change slowly, so caching a query's answer for a few days is safe. ## Step 2: Get Basic Profile Information The profile response includes essential information: ```json theme={null} { "payload": { "platform_id": "twitch", "id": "484563826", "name": "streamer123", "display_name": "Streamer 123", "url": "https://twitch.tv/streamer123", "description": "Twitch streamer", "profile_image": "https://...", "banner_image": "https://...", "language": "en", "statistics": { "followers": 120000, "views_estimated": 4500000 }, "is_partner": false, "is_affiliate": true, "is_mature": false, "updated_at": "2024-07-04T12:00:00.000Z", "last_active_at": "2024-07-04T10:00:00.000Z" } } ``` **Key fields**: * `statistics`: Follower counts, view counts (YouTube) or estimated views (Twitch) * `statistics.views_estimated`: Estimated total views for Twitch profiles (calculated using our algorithms) * `is_partner`, `is_affiliate`, `is_mature`: Twitch-specific status flags * `last_active_at`: When the creator last posted content * `updated_at`: When the profile data was last refreshed ## Step 3: Fetch Creator Content Get recent content from the creator: ```javascript theme={null} // List content by creator const content = await fetch( '/platforms/twitch/profiles/484563826/content?limit=10', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); content.payload.forEach(item => { console.log(`${item.title}: ${item.statistics.views?.sum || 0} views`); }); ``` ## Step 4: Analyze Content Statistics Content items include detailed statistics: ```json theme={null} { "id": "987654321", "title": "Awesome Stream", "type": "stream", "statistics": { "viewers": { "avg": 2345.6, "max": 6789 }, "watched_minutes": { "sum": 123456 }, "views": { "sum": 45678 }, "comments": { "sum": 900 } } } ``` **Statistics to analyze**: * `statistics.views.sum`: Total views * `statistics.viewers.avg`: Average concurrent viewers * `statistics.watched_minutes.sum`: Total watch time ## Step 5: Get Creator Analysis For deeper analysis, fetch creator analysis (costs 1 credit): ```javascript theme={null} const analysis = await fetch( '/platforms/twitch/profiles/484563826/analysis', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); // AI-enriched data console.log(analysis.payload.age_range); // "25-34" console.log(analysis.payload.primary_language); // "es" console.log(analysis.payload.interests); // Array of interests ``` ## Step 6: Analyze Audience Get detailed audience demographics (costs 1 credit): ```javascript theme={null} const audience = await fetch( '/platforms/twitch/profiles/484563826/audience', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); // Demographics console.log(audience.payload.gender_distribution); console.log(audience.payload.age_ranges); console.log(audience.payload.countries); // Brand safety console.log(audience.payload.brand_safety.overall_risk_level); console.log(audience.payload.community_health); ``` ## Step 7: Cross-Platform Discovery Use socials data to find the same creator on other platforms (costs 0.1 credit): ```javascript theme={null} const socials = await fetch( '/platforms/twitch/profiles/484563826/socials', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); // Find creator on other platforms const socialProfiles = socials.payload; socialProfiles.forEach(profile => { console.log(`${profile.platform_id}: ${profile.id} (${profile.followers} followers)`); }); ``` ## Complete Example Workflow ```javascript theme={null} async function analyzeCreator(platform, profileId) { // 1. Get profile const profile = await fetchProfile(platform, profileId); // 2. Get recent content const content = await fetchContent(platform, profileId, 10); // 3. Calculate content metrics const totalViews = content.payload.reduce( (sum, item) => sum + (item.statistics?.views?.sum || 0), 0 ); // 4. Get advanced insights (if needed) const advanced = await fetchAdvanced(platform, profileId); // 5. Get audience analysis (if needed) const audience = await fetchAudience(platform, profileId); return { profile: profile.payload, contentStats: { totalItems: content.payload.length, totalViews }, insights: advanced.payload.analysis, audience: audience.payload }; } ``` ## Use Cases ### Brand Partnership Discovery ```javascript theme={null} // Find creators matching brand criteria async function findBrandPartners(criteria) { // 1. Search or filter creators // 2. Fetch profiles // 3. Get audience analysis // 4. Check brand safety metrics // 5. Evaluate community health } ``` ### Content Performance Analysis ```javascript theme={null} // Analyze creator's content performance async function analyzeContentPerformance(platform, profileId) { // 1. Fetch all content (paginate) // 2. Calculate average views // 3. Identify top-performing content // 4. Analyze trends over time } ``` ### Multi-Platform Presence ```javascript theme={null} // Find creators with presence on multiple platforms async function findMultiPlatformCreators(twitchProfileId) { // 1. Get advanced insights // 2. Extract social profiles // 3. Fetch profiles from other platforms // 4. Compare metrics across platforms } ``` ## Best Practices > [!TIP] > > Start with basic profile data before fetching expensive advanced insights. Only use advanced/audience endpoints when needed. * **Cache profile data**: Profile data doesn't change frequently; cache it * **Paginate content**: Use cursor pagination to fetch all content efficiently * **Batch operations**: Use bulk endpoints when fetching multiple creators * **Monitor credits**: Analysis and audience endpoints cost 1 credit each * **Handle missing data**: Some creators may not have advanced insights available ## Credit Considerations | Operation | Credit Cost | | - | - | | Get profile | 0.01 credit | | List content (up to 25 items) | 0.01 credit | | Get advanced insights | 1 credit | | Get audience analysis | 1 credit | **Total for full analysis**: about 2 credits per creator Consider caching advanced insights since they're expensive and don't change frequently. # Requesting a Creator Source: https://docs.streamforge.com/guides/creator-requests Ask the Streamforge API to prepare a creator profile and audience analysis that are not available yet, then poll the request until it finishes. The profile and audience endpoints answer from data Streamforge already holds. When they answer `404` for a creator you need, or a creator has a profile but no audience analysis, ask for the creator with a **creator request** and check back for the result. > [!NOTE] > > Creator requests are available with a Streamforge API key only, not through RapidAPI. ## How it works 1. `POST /creator-requests` with the creator you want. 2. If everything you asked for can already be served, the answer is `200` and the data is in `result`. You are done. 3. Otherwise the answer is `202` with a `request_id`. Read `GET /creator-requests/{request_id}` every few seconds until it answers `200`. Both endpoints return the same body, so one piece of code can handle either. ## Step 1: Make the request Name the creator by platform and handle, by platform and profile ID, or with a profile URL: ```bash theme={null} curl -i -X POST https://external-api.streamforge.com/creator-requests \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"platform": "youtube", "handle": "@examplecreator"}' ``` Any one of these bodies names a creator: ```json theme={null} { "platform": "youtube", "handle": "@examplecreator" } { "platform": "youtube", "profile_id": "UCxxxxxxxxxxxxxxxxxxxxxx" } { "url": "https://www.youtube.com/@examplecreator" } ``` Add `"audience": false` if you only need the profile. A URL has to be a creator's profile or channel. A link to a video, a post or a search page is rejected with `400` and the code `unsupported_profile_url`. When there is work to do, the answer is `202`: ``` HTTP/1.1 202 Accepted Location: /creator-requests/cr_3f9a1c2b4d5e6f708192a3b4c5d6e7f8 Retry-After: 3 ``` ```json theme={null} { "payload": { "request_id": "cr_3f9a1c2b4d5e6f708192a3b4c5d6e7f8", "status": "pending", "stage": "queued", "progress": 0, "message": "Queued", "platform": "youtube", "handle": "examplecreator", "profile_id": null, "parts": { "profile": "pending", "audience": "pending" }, "audience_reason": null, "poll_after_seconds": 3, "status_url": "/creator-requests/cr_3f9a1c2b4d5e6f708192a3b4c5d6e7f8", "result": null }, "meta": { "received_at": "2026-10-13T12:00:00.000Z", "credits_charged": 1 } } ``` ## Step 2: Poll until it finishes Read the request at `status_url`, waiting `poll_after_seconds` between reads. The answer stays `202` while the request is `pending` or `processing` and becomes `200` when it has finished: ```bash theme={null} REQUEST_ID=cr_3f9a1c2b4d5e6f708192a3b4c5d6e7f8 while true; do STATUS=$(curl -s -o response.json -w "%{http_code}" \ -H "x-api-key: YOUR_API_KEY" \ "https://external-api.streamforge.com/creator-requests/$REQUEST_ID") if [ "$STATUS" != "202" ]; then break; fi sleep 3 done cat response.json ``` `result.profile` is filled in as soon as the profile can be served, which can be while the audience analysis is still in progress. `stage`, `progress` and `message` are there for showing progress to a person; decide what to do next from `status` and `parts`. ## Step 3: Read the outcome A finished request has one of four statuses: | Status | What you have | | - | - | | `ready` | The profile in `result.profile`, and the audience analysis in `result.audience` if you asked for it | | `partial` | The profile in `result.profile`, and no audience analysis. `parts.audience` and `audience_reason` say why | | `not_found` | Nothing: there is no such creator on that platform | | `failed` | Nothing: the request could not be completed. You can make it again | `result.profile` is the same object [Get single profile](/api-reference/profiles/get-profile) returns, and `result.audience` the same object [Get audience analysis](/api-reference/advanced/get-audience-analysis) returns. `profile_id` is the ID to use with every other endpoint from then on. ### When the audience analysis is not available `partial` is an ordinary outcome, not an error. An audience analysis is not always possible, and `parts.audience` tells you which case you are in: | `parts.audience` | Meaning | | - | - | | `insufficient_data` | There is not enough public audience data for this creator to produce an analysis | | `unsupported` | An audience analysis is not available for this creator on this platform | | `unavailable` | The daily capacity for new analyses is used up. Request the creator again after the daily reset | | `failed` | The analysis could not be completed | `audience_reason` carries the same explanation as a sentence you can show. ## Credits | Call | Credit Cost | | - | - | | `POST /creator-requests`, accepted (`200` or `202`) | 1 credit, once | | `POST /creator-requests` again for the same request while it is in progress | 0 credits; you get the same `request_id` | | `GET /creator-requests/{request_id}` | 0 credits | | A request that ends `not_found` or `failed` | The credit is returned | `meta.credits_charged` shows what the request has cost in total, and the `X-Credits-request-cost` response header what the call you just made cost. Both are in credits. Reads are free but do count towards your per-minute rate limit, so keep to `poll_after_seconds`. ## Errors | Status | Code | What to do | | - | - | - | | `400` | `unsupported_profile_url`, `platform_mismatch`, `invalid_handle`, `invalid_profile_id` | Fix the request; it does not name a creator profile | | `403` | `direct_key_only` | Use a Streamforge API key; these endpoints are not on RapidAPI | | `404` | `creator_request_not_found` | The `request_id` is wrong, has expired, or belongs to another API key | | `503` | `preparation_unavailable` | Nothing was started or charged. Try again after `Retry-After` seconds | | `503` | `preparation_budget_exhausted` | The daily capacity for preparing new creators is used up. Nothing was charged; try again after the daily reset | A request can be read only with the API key that created it, and stays readable for 7 days. ## Best practices * **Use the profile endpoint when a profile is all you need** and you have its ID: it costs 0.01 credit for a creator that is already available, where a creator request costs 1 credit. * **Keep the `request_id`** rather than posting again: a new `POST` after the request has finished starts, and charges, a new request. * **Treat `partial` as a result**: the profile is usable even when no audience analysis could be produced. * **Respect `Retry-After`** on `202`, `429` and `503` answers. # Credit Management Source: https://docs.streamforge.com/guides/credit-management Plan Streamforge API credit usage with endpoint costs, request limits, and caching strategies that help you budget profile, content, and audience data requests. The Streamforge External API prices every call in credits. Understanding how credits work helps you plan your API consumption. Each call is charged once, at its endpoint's tier, whatever the number of IDs it names or results it returns. A bulk call for 25 profiles costs 0.01 credit, the same as a call for one profile. ## Credit Costs | Tier | Credits per call | What it covers | | - | - | - | | Standard | 0.01 credit | Creator profiles, posts and videos, games, creator and brand search, rate estimates | | Advanced | 0.1 credit | Creator email, cross-platform social linking, brand profiles, industry data, rate benchmarks | | Premium | 1 credit | AI-enriched creator data, audience demographics, creator requests (credited back if the creator can't be found) | ### Credits by endpoint | Endpoint | Tier | Credit Cost | | - | - | - | | `GET /platforms/{platform}/profiles` (browse) | Standard | 0.01 credit | | `POST /platforms/{platform}/profiles` (bulk by ID) | Standard | 0.01 credit | | `POST /platforms/{platform}/profiles/lookup` (handles) | Standard | 0.01 credit | | `GET /platforms/{platform}/profiles/search` | Standard | 0.01 credit | | `GET /platforms/{platform}/profiles/{profile_id}` | Standard | 0.01 credit | | `GET /platforms/{platform}/profiles/{profile_id}/content` | Standard | 0.01 credit | | `GET` and `POST /platforms/{platform}/content` | Standard | 0.01 credit | | `GET /platforms/{platform}/content/{content_id}` | Standard | 0.01 credit | | `GET /platforms/{platform}/games/{game_id}` | Standard | 0.01 credit | | `GET /platforms/{platform}/games/{game_id}/content` | Standard | 0.01 credit | | `POST /platforms/{platform}/games` | Standard | 0.01 credit | | `GET /games/search` | Standard | 0.01 credit | | `GET /brands/search`, `GET /brands` | Standard | 0.01 credit | | `GET /rates/dimensions`, `GET /rates/estimate` | Standard | 0.01 credit | | `GET /platforms/{platform}/profiles/{profile_id}/email` | Advanced | 0.1 credit | | `GET /platforms/{platform}/profiles/{profile_id}/socials` | Advanced | 0.1 credit | | `GET /brands/{brand_id}` | Advanced | 0.1 credit | | `GET /industries`, `GET /industries/{industry_id}` | Advanced | 0.1 credit | | `GET /rates/benchmarks` | Advanced | 0.1 credit | | `GET /platforms/{platform}/profiles/{profile_id}/analysis` | Premium | 1 credit | | `GET /platforms/{platform}/profiles/{profile_id}/audience` | Premium | 1 credit | | `POST /creator-requests`, accepted | Premium | 1 credit, once (returned if it ends `not_found` or `failed`) | | `GET /creator-requests/{request_id}` | None | 0 credits | Creator search, brand, industry, rate and creator request endpoints are available with a Streamforge API key only, not through RapidAPI. ## Items per call A call names or returns at most 25 items: * Bulk calls take at most 25 IDs in `profile_ids`, `content_ids`, `game_ids` or `handles`. More returns a `400` validation error. * List calls return at most 25 items per page. A larger `limit` is lowered to 25. ## Examples | What you fetch | Calls | Credits | | - | - | - | | One profile | 1 | 0.01 | | 25 profiles by ID | 1 bulk call | 0.01 | | 100 profiles by ID | 4 bulk calls of 25 | 0.04 | | 25 handles resolved to IDs | 1 lookup | 0.01 | | 100 content items of one creator | 4 pages of 25 | 0.04 | | All 36 industries | 2 pages | 0.2 | | One creator's email and socials | 2 | 0.2 | | One creator's analysis and audience | 2 | 2 | ## Credit Headers Responses carry three headers that show your credit use: | Header | What it shows | | - | - | | `X-Credits-limit` | Your credit allowance | | `X-Credits-used` | What you have used so far | | `X-Credits-request-cost` | What this call cost | These headers are in credits. A profile request shows `X-Credits-request-cost: 0.01`, and so does a bulk call for 25 profiles. An email lookup shows `0.1`, a brand profile `0.1` and an analysis `1`. `meta.credits_charged` on a creator request is in credits too: `1` once the request is accepted. ## Optimizing Credit Usage ### Use Bulk Operations A bulk call costs the same as a single-item call. Fetching 25 profiles in one bulk call costs 0.01 credit; fetching them one by one costs 0.25. ### Use Full Pages A list page costs the same whatever its `limit`. When you will read a whole list, use `limit=25` and make fewer calls. Search endpoints cost the same whatever the `limit`, so ask for as many results as you will show. ### Cache Expensive Operations The `/analysis` and `/audience` endpoints cost 1 credit each, 100 times a profile. This data is regenerated infrequently (typically monthly), so cache results aggressively. ## When you exceed a credit limit The API returns `403 Forbidden` ## Credit Budget Planning | Use Case | Typical Credits/Day | | - | - | | Basic profile lookups | 10-100 | | Content analysis | 50-500 | | Creator discovery with advanced insights | 100-1,000 | > [!TIP] > > Monitor your credit usage via the headers on each response. Set up alerts when approaching 80% of your limits. ## Best Practices * **Use bulk endpoints**: Always prefer bulk operations for multiple items, up to 25 per call * **Cache expensive requests**: Cache `/analysis` and `/audience` responses for extended periods * **Use full pages**: A page costs the same at any `limit`, so use `limit=25` when you read a whole list * **Monitor headers**: Use headers to understand usage * **Distribute load**: Stagger requests to avoid credit spikes # Data Freshness Source: https://docs.streamforge.com/guides/data-freshness Understand Streamforge API data timestamps and caching guidance. Check profile and audience update fields to decide when to reuse data or refresh your requests. Understanding when data is updated helps you implement effective caching strategies. ## Data Update Cadence | Data Type | Update Frequency | Notes | | - | - | - | | Profiles | Daily | Updated via ETL when creator activity changes | | Content | Real-time | New content appears as it's created | | Analysis | Periodic (\~30 days) | AI analysis is regenerated periodically | | Audience | Periodic (\~30 days) | Based on recent content and engagement patterns | ## Timestamps ### Profile Timestamps * **`updated_at`**: When the profile data was last refreshed in our system * **`last_active_at`**: When the creator last posted content (if known) ### Audience Analysis Timestamp * **`meta.last_updated_at`**: When the audience analysis was last generated Use this timestamp to determine if cached audience data is still current. ## Recommended Cache TTLs | Data Type | Recommended TTL | Reason | | - | - | - | | Profiles | 24 hours | Updates daily via ETL | | Content (single) | 1 hour | View/engagement stats may update | | Content (lists) | No cache | Real-time additions | | Analysis | Weeks to months | Regenerated infrequently (typically monthly) | | Audience | Until `last_updated_at` changes | Regenerated infrequently (typically monthly) | ## Best Practices * **Cache profiles for 24 hours**: Profile data typically updates daily * **Cache analysis/audience aggressively**: This data is regenerated infrequently (typically monthly) * **Don't cache content lists**: New content is added in real-time * **Check `last_updated_at`**: For audience data, cache until this timestamp changes * **Refresh on demand**: Only re-fetch when needed, not on every request > [!TIP] > > Combine caching with the quota optimization strategies in the [Credit Management](/guides/credit-management) guide for efficient API usage. # Error Handling Source: https://docs.streamforge.com/guides/error-handling Handle Streamforge API errors with status codes, request IDs, and retry strategies. Learn to respect Retry-After and manage partial success in bulk requests. Understanding API error responses and implementing proper error handling is crucial for building reliable integrations with the Streamforge External API. ## HTTP Status Codes The API uses standard HTTP status codes to indicate request outcomes: | Code | Meaning | When It Occurs | | - | - | - | | `200` | Success | Request completed successfully | | `400` | Bad Request | Invalid parameters, missing required fields, or validation errors | | `401` | Unauthorized | Missing `x-api-key` header | | `403` | Forbidden | Invalid or revoked API key | | `404` | Not Found | Resource doesn't exist (profile, content, game) | | `429` | Too Many Requests | Rate limit exceeded | | `5xx` | Server Error | Internal server issues (retry with backoff) | ## Error Response Format All error responses follow a consistent structure: ```json theme={null} { "error": { "status": 404, "message": "Profile not found" }, "meta": { "request_id": "5e7c0137-1ed3-4b4b-8e5f-3d9cf00f7ac4" } } ``` The `request_id` can be used when contacting support about specific errors. ## Handling Specific Errors ### 400 Bad Request Invalid parameters or malformed requests: ```javascript theme={null} if (response.status === 400) { const error = await response.json(); console.error('Validation error:', error.error.message); // Check your request parameters } ``` **Common causes**: * Invalid `platform` value (must be `twitch`, `youtube`, or `tiktok`) * More than 25 IDs in a bulk request (`profile_ids`, `content_ids`, `game_ids` or `handles`) * Missing required fields in bulk requests * Invalid date format in query parameters ### 401 Unauthorized Missing API key: ```javascript theme={null} if (response.status === 401) { console.error('API key is missing'); // Add x-api-key header to your request } ``` **Solution**: Ensure all requests include the `x-api-key` header. ### 403 Forbidden Invalid or revoked API key: ```javascript theme={null} if (response.status === 403) { console.error('API key is invalid or revoked'); // Contact support@streamforge.com for a new key } ``` **Common causes**: * Typo in API key * Key was rotated or revoked * Key is inactive ### 404 Not Found Resource doesn't exist: ```javascript theme={null} if (response.status === 404) { const error = await response.json(); // Resource doesn't exist - this is normal for some use cases // Handle gracefully (e.g., skip, log, or retry later) } ``` **Note**: 404s are **normal** in some scenarios: * Profile IDs that don't exist * Content that was deleted * Games not in the database Handle 404s gracefully rather than treating them as errors. ### 429 Too Many Requests Rate limit exceeded: ```javascript theme={null} if (response.status === 429) { const retryAfter = response.headers.get('Retry-After'); const seconds = parseInt(retryAfter, 10); // Wait before retrying await sleep(seconds * 1000); // Retry the request } ``` **Response headers**: * `Retry-After`: Seconds to wait before retrying * `X-RateLimit-*-remaining`: Remaining quota (often `0`) ## Retry Strategies ### Exponential Backoff Implement exponential backoff for retryable errors (429, 5xx): ```javascript theme={null} async function fetchWithRetry(url, options, maxRetries = 3) { for (let attempt = 0; attempt < maxRetries; attempt++) { const response = await fetch(url, options); if (response.ok) { return response; } // Don't retry 4xx errors (except 429) if (response.status >= 400 && response.status < 500 && response.status !== 429) { throw new Error(`Client error: ${response.status}`); } // Calculate backoff delay const delay = Math.min(1000 * Math.pow(2, attempt), 30000); // For 429, use Retry-After header if (response.status === 429) { const retryAfter = response.headers.get('Retry-After'); if (retryAfter) { await sleep(parseInt(retryAfter, 10) * 1000); continue; } } await sleep(delay); } throw new Error('Max retries exceeded'); } function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } ``` ## Handling Bulk Operation Errors Bulk operations use **partial success** - some items may be missing: ```javascript theme={null} async function handleBulkResponse(response) { const data = await response.json(); if (response.ok) { // Check for missing items if (data.meta.missing_ids && data.meta.missing_ids.length > 0) { console.warn(`Missing items: ${data.meta.missing_ids.join(', ')}`); // Handle missing items (e.g., log, retry individually, or skip) } return data.payload; } else { // Handle full request failure throw new Error(`Bulk request failed: ${data.error.message}`); } } ``` ## Best Practices > [!TIP] > > Always check response status before parsing JSON. Some errors may not return JSON bodies. * **Check status first**: Verify `response.ok` or `response.status` before parsing JSON * **Handle 404s gracefully**: Missing resources are normal; don't treat as errors * **Respect Retry-After**: For 429 errors, wait the specified time before retrying * **Log request IDs**: Include `request_id` from error responses in your logs * **Monitor error rates**: Track error rates to detect issues early * **Implement circuit breakers**: Stop retrying if error rate is too high ## Example: Complete Error Handler ```javascript theme={null} async function apiRequest(url, options) { try { const response = await fetch(url, { ...options, headers: { 'x-api-key': process.env.API_KEY, 'Content-Type': 'application/json', ...options.headers } }); // Handle rate limiting if (response.status === 429) { const retryAfter = response.headers.get('Retry-After'); throw new RateLimitError(parseInt(retryAfter, 10)); } // Parse response const data = await response.json(); if (!response.ok) { throw new ApiError(data.error.message, response.status, data.meta.request_id); } return data; } catch (error) { if (error instanceof RateLimitError) { // Handle rate limit await sleep(error.retryAfter * 1000); return apiRequest(url, options); // Retry } throw error; } } class ApiError extends Error { constructor(message, status, requestId) { super(message); this.status = status; this.requestId = requestId; } } class RateLimitError extends Error { constructor(retryAfter) { super('Rate limit exceeded'); this.retryAfter = retryAfter; } } ``` > [!WARNING] > > Don't retry 4xx errors (except 429) - they indicate client errors that won't be fixed by retrying. # Game Data & Content Source: https://docs.streamforge.com/guides/game-data Explore game metadata and related creator content with the Streamforge API. Learn to search games, use platform IDs, and connect results with IGDB metadata. The Streamforge External API provides access to game metadata from IGDB (Internet Game Database) and allows you to find content related to specific games. ## Game Endpoints The API offers several endpoints for working with games: * `GET /platforms/{platform}/games/{game_id}` - Get game by platform ID * `POST /platforms/{platform}/games` - Get multiple games * `GET /platforms/{platform}/games/{game_id}/content` - Get content for a game * `GET /games/search` - Search games by name ## Platform Support Games are available on different platforms: * **Twitch**: Games are identified by Twitch game IDs * **YouTube**: Games are identified by YouTube game channel IDs * **IGDB**: Direct access using IGDB game IDs ## Finding Games ### Search by Name The easiest way to find games is using the search endpoint: ```javascript theme={null} const games = await fetch( '/games/search?q=minecraft&limit=20', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); games.payload.forEach(game => { console.log(`${game.name} (IGDB: ${game.id})`); }); ``` ### Filter by Platform Search for games available on a specific platform: ```javascript theme={null} // Only return games available on Twitch const twitchGames = await fetch( '/games/search?q=minecraft&platform=twitch&limit=20', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); ``` ## Game Data Structure Games include IGDB metadata: ```json theme={null} { "payload": { "id": "189165", "name": "Kill The Monster Z", "slug": "kill-the-monster-z", "first_release_date": "2017-03-01T00:00:00.000Z", "twitch_id": "2011938005", "youtube_id": "UCf_7CrLpgmot2vPKYwx5zQg" }, "meta": { "source": "igdb", "received_at": "2025-01-27T12:00:00.000Z" } } ``` **Key fields**: * `id`: IGDB game ID (cross-platform identifier) * `twitch_id`: Twitch game ID (if available on Twitch) * `youtube_id`: YouTube game channel ID (if available on YouTube) * `first_release_date`: When the game was first released ## Getting Games by Platform ID ### Twitch Game ID ```javascript theme={null} const game = await fetch( '/platforms/twitch/games/2011938005', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); console.log(game.payload.name); // Game name console.log(game.payload.id); // IGDB ID ``` ### YouTube Game Channel ID ```javascript theme={null} const game = await fetch( '/platforms/youtube/games/UCf_7CrLpgmot2vPKYwx5zQg', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); ``` ### IGDB Game ID ```javascript theme={null} const game = await fetch( '/platforms/igdb/games/189165', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); ``` ## Bulk Game Lookup Fetch up to 25 games in a single request. The call costs 0.01 credit, whatever the number of IDs: ```javascript theme={null} const games = await fetch( '/platforms/twitch/games', { method: 'POST', headers: { 'x-api-key': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ game_ids: ["2011938005", "491487", "490377"] }) } ).then(r => r.json()); games.payload.forEach(game => { console.log(`${game.name}: ${game.id}`); }); ``` ## Getting Content for Games Find streams and videos related to a specific game: ```javascript theme={null} const content = await fetch( '/platforms/twitch/games/2011938005/content?limit=20&sort=views&order=desc', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); content.payload.forEach(item => { console.log(`${item.title}: ${item.statistics.viewers.max} peak viewers`); }); ``` ### Content Filtering Filter game content by various criteria: ```javascript theme={null} // Filter by content type const streams = await fetch( '/platforms/twitch/games/2011938005/content?content_type=stream&limit=20', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); // Filter by date range const recentContent = await fetch( '/platforms/twitch/games/2011938005/content?start_date=2024-01-01&end_date=2024-12-31', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); ``` ### Sorting Options Sort game content by different statistics: * `created_at` - When content was created (default) * `views` - Total views * `viewers` - Peak concurrent viewers ```javascript theme={null} // Sort by views (descending) const topContent = await fetch( '/platforms/twitch/games/2011938005/content?sort=views&order=desc&limit=10', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json()); ``` ## IGDB Integration Games are enriched with IGDB metadata. You can use IGDB IDs to: 1. **Fetch full game details** from IGDB API (cover art, ratings, genres, etc.) 2. **Cross-reference** games across platforms 3. **Get comprehensive metadata** not available in the Streamforge API ### Example: Using IGDB ID ```javascript theme={null} // Get game from Streamforge API const game = await fetch('/platforms/twitch/games/2011938005', { headers: { 'x-api-key': 'YOUR_API_KEY' } }).then(r => r.json()); const igdbId = game.payload.id; // "189165" // Use IGDB ID to fetch full details from IGDB API // (requires IGDB API credentials) ``` ## Use Cases ### Trending Games Analysis ```javascript theme={null} async function findTrendingGames(platform) { // 1. Search for popular games // 2. Get content for each game // 3. Analyze view counts and engagement // 4. Rank by popularity } ``` ### Game Content Discovery ```javascript theme={null} async function discoverGameContent(gameName, platform) { // 1. Search for game const search = await fetch(`/games/search?q=${gameName}&platform=${platform}`); const games = await search.json(); if (games.payload.length === 0) return []; // 2. Get content for the game const gameId = games.payload[0].twitch_id || games.payload[0].youtube_id; const content = await fetch( `/platforms/${platform}/games/${gameId}/content?limit=25&sort=views&order=desc` ); return content.json(); } ``` ### Cross-Platform Game Analysis ```javascript theme={null} async function analyzeGameAcrossPlatforms(gameName) { // 1. Search for game const search = await fetch(`/games/search?q=${gameName}`); const games = await search.json(); if (games.payload.length === 0) return null; const game = games.payload[0]; // 2. Get content from both platforms const results = {}; if (game.twitch_id) { const twitchContent = await fetch( `/platforms/twitch/games/${game.twitch_id}/content?limit=10` ); results.twitch = await twitchContent.json(); } if (game.youtube_id) { const youtubeContent = await fetch( `/platforms/youtube/games/${game.youtube_id}/content?limit=10` ); results.youtube = await youtubeContent.json(); } return results; } ``` ## Best Practices > [!TIP] > > Use game search to find games by name, then use the returned IDs for subsequent requests. This is more reliable than guessing platform-specific IDs. * **Search first**: Use `/games/search` to find games by name * **Store IGDB IDs**: IGDB IDs are cross-platform identifiers * **Filter by platform**: Use platform filters when you only need games from one platform * **Paginate content**: Use cursor pagination for large content lists * **Cache game data**: Game metadata doesn't change frequently ## Limitations * **Games only on Twitch/YouTube**: Game content endpoints only work for Twitch and YouTube * **IGDB platform**: When using `platform=igdb`, you can't fetch content (games don't have content on IGDB) * **Search limits**: Search returns up to 25 results per query (default 20) * **Page size**: Game content returns up to 25 items per page (default 20). A larger `limit` is lowered to 25 > [!WARNING] > > Game content endpoints (`/games/{game_id}/content`) only work for Twitch and YouTube platforms, not IGDB. # Pagination & Cursors Source: https://docs.streamforge.com/guides/pagination Page through Streamforge API results with cursor tokens. Learn how to choose page sizes, follow next_cursor, resume processing, and handle pagination errors. The Streamforge External API uses **cursor-based pagination** for all list endpoints. This approach provides stable, efficient pagination that avoids duplicates when data changes between requests. ## How Cursor Pagination Works Unlike offset-based pagination (e.g., `page=1`, `page=2`), cursor pagination uses opaque tokens that point to a specific position in the dataset. This means: * **Stable results**: New items added to the beginning won't cause duplicates * **Efficient**: No need to skip through large offsets * **Consistent**: Results remain consistent even as data updates ## Using Cursors All list endpoints return a `next_cursor` in `paging`: ```json theme={null} { "payload": [...], "paging": { "limit": 10, "next_cursor": "eyJpZCI6Ijk4NzY1NDMyMSIsImVuZGVkX2F0IjoiMjAyNC0wNy0wNFQxMTozMDowMC4wMDBaIn0=" }, "meta": {...} } ``` ### Basic Pagination Pattern ```javascript theme={null} async function fetchAllContent(platform, profileId) { let cursor = null; const allContent = []; do { const url = `/platforms/${platform}/profiles/${profileId}/content?limit=25${cursor ? `&cursor=${cursor}` : ''}`; const response = await fetch(url, { headers: { 'x-api-key': 'YOUR_API_KEY' } }); const data = await response.json(); allContent.push(...data.payload); cursor = data.paging.next_cursor; } while (cursor !== null); return allContent; } ``` ## Choosing a Limit The `limit` parameter controls how many items are returned per page: * **Minimum**: 1 item * **Maximum**: 25 items. A larger `limit` is lowered to 25 * **Default**: 10 items for profile and content lists, 20 for game content, 25 for brands and industries * **Credit cost**: Each page is one call, charged once whatever its `limit`: 0.01 credit for profile, content, game content and brand lists, 0.1 credit for industry pages ### Limit Selection Guidelines * **Whole lists**: Use `limit=25`. A page costs the same at any size, so full pages make the fewest calls * **Real-time updates**: Use smaller limits to detect new items faster ## Cursor Stability Cursors are **stable tokens** that remain valid even as new data arrives. However: * Cursors don't expire, but they may become less efficient over time * If you pause pagination for days/weeks, consider restarting from the beginning * Cursors encode the sort position, so changing sort order requires a new cursor ## Endpoints with Pagination The following endpoints support cursor-based pagination: * `GET /platforms/{platform}/profiles` - Browse profiles * `GET /platforms/{platform}/content` - List all content * `GET /platforms/{platform}/profiles/{profile_id}/content` - List content by creator * `GET /platforms/{platform}/games/{game_id}/content` - List content for a game * `GET /brands` - List brands by sponsorship activity * `GET /industries` - List industries (36 in all, two pages at the default `limit`) * `GET /industries/{industry_id}` - An industry's brand ranking. Keep the same `sort` on every page; ranks continue across pages, so the second page starts at rank 26 ## Best Practices > [!TIP] > > Always check if `next_cursor` is `null` before making another request. A `null` cursor means you've reached the end of the results. * **Respect rate limits**: Don't paginate too aggressively; monitor your quota usage * **Handle errors**: Implement retry logic for failed pagination requests * **Store cursors**: If resuming pagination, store the last cursor to avoid re-fetching data * **Batch processing**: For large datasets, process items in batches rather than loading everything into memory ## Example: Paginating Content ```bash theme={null} # First request curl -H "x-api-key: YOUR_KEY" \ "https://external-api.streamforge.com/platforms/twitch/content?limit=25" # Response includes next_cursor # Use it in the next request curl -H "x-api-key: YOUR_KEY" \ "https://external-api.streamforge.com/platforms/twitch/content?limit=25&cursor=eyJpZCI6Ijk4NzY1NDMyMSIsImVuZGVkX2F0IjoiMjAyNC0wNy0wNFQxMTozMDowMC4wMDBaIn0=" ``` ## Common Pitfalls > [!WARNING] > > Don't use offset-based pagination patterns. The API doesn't support `page` or `offset` parameters. * **Assuming page numbers**: There are no page numbers; only cursors * **Reusing old cursors**: While stable, very old cursors may not reflect current data * **Ignoring null cursors**: Always check for `null` to avoid infinite loops * **Not handling empty results**: An empty `payload` array with a `null` cursor means no results # Platform Identifiers Source: https://docs.streamforge.com/guides/platform-identifiers Choose the correct creator, content, and game identifiers for Streamforge API requests, with platform-specific formats, lookup examples, and common mistakes. Each platform uses different ID formats for profiles, content, and games. Understanding these formats is essential for working with the Streamforge External API. ## Profile IDs Profile IDs are platform-specific creator identifiers: ### Twitch * **Format**: Numeric string (e.g., `"484563826"`) * **How to find**: Twitch channel URL or API * **Example**: `https://twitch.tv/streamer123` → Channel ID `484563826` ### YouTube * **Format**: Channel ID string (e.g., `"UCaY_-ksFSQtTGk0y1HA_3YQ"`) * **How to find**: YouTube channel URL or API * **Example**: `https://youtube.com/@channel` → Channel ID `UCaY_-ksFSQtTGk0y1HA_3YQ` ### TikTok * **Format**: Numeric string (e.g., `"1234567890"`) * **How to find**: TikTok profile URL or API * **Note**: TikTok IDs may change; use display names for stability ### Instagram * **Format**: Numeric string (e.g., `"1234567890"`) * **How to find**: Instagram profile data or API * **Note**: Instagram user IDs are stable numeric identifiers ### X (Twitter) * **Format**: Numeric string (e.g., `"3165311079"`) * **How to find**: X user ID (the `rest_id` in X's API), or resolve a handle via `POST /platforms/twitter/profiles/lookup` * **Note**: The platform key is `twitter`. Handles are lowercased before lookup, so `@LofiGirl` and `lofigirl` resolve to the same profile; the response echoes the lowercase handle. ## Content IDs Content IDs identify individual streams, videos, or posts: ### Twitch * **Format**: Numeric string (e.g., `"324628972153"`) * **Type**: Video ID or stream ID * **Example**: `https://twitch.tv/videos/324628972153` ### YouTube * **Format**: Alphanumeric string (e.g., `"dQw4w9WgXcQ"`) * **Type**: Video ID * **Example**: `https://youtube.com/watch?v=dQw4w9WgXcQ` ### TikTok * **Format**: Numeric string (e.g., `"7123456789"`) * **Type**: Video ID * **Example**: `https://tiktok.com/@user/video/7123456789` ### Instagram * **Format**: Post shortcode (e.g., `"CxYz123AbCd"`) * **Type**: Post/Video ID * **Example**: `https://instagram.com/p/CxYz123AbCd` * **Note**: Instagram uses alphanumeric shortcodes in URLs ### X (Twitter) * **Format**: Numeric string (e.g., `"1925220538357559590"`) * **Type**: Post ID * **Example**: `https://x.com/i/status/1925220538357559590` * **Note**: Only numeric post IDs are accepted; non-numeric IDs return a 400 ## Game IDs Game IDs vary by platform and can reference IGDB data: ### Twitch Game ID * **Format**: Numeric string (e.g., `"2011938005"`) * **Source**: Twitch's game taxonomy * **Example**: Used in `GET /platforms/twitch/games/{game_id}` ### YouTube Game Channel ID * **Format**: Channel ID string (e.g., `"UCf_7CrLpgmot2vPKYwx5zQg"`) * **Source**: YouTube's game channel taxonomy * **Example**: Used in `GET /platforms/youtube/games/{game_id}` ### IGDB Game ID * **Format**: Numeric string (e.g., `"189165"`) * **Source**: IGDB (Internet Game Database) * **Example**: Used in `GET /platforms/igdb/games/{game_id}` * **Note**: IGDB IDs are cross-platform identifiers ## Finding Profile IDs ### Twitch ```bash theme={null} # Using Twitch API curl -H "Client-ID: YOUR_CLIENT_ID" \ "https://api.twitch.tv/helix/users?login=streamer123" ``` ### YouTube ```bash theme={null} # Extract from channel URL # https://youtube.com/@channel → Channel ID via API curl "https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=channel&key=YOUR_KEY" ``` ### TikTok ```bash theme={null} # Use TikTok API or extract from profile URL # Profile URLs contain user IDs ``` ### Instagram ```bash theme={null} # Use Instagram API or extract from profile data # Profile IDs are numeric user identifiers ``` ### X (Twitter) ```bash theme={null} # Resolve one or more handles to X user IDs curl -X POST "https://external-api.streamforge.com/platforms/twitter/profiles/lookup" \ -H "x-api-key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"handles": ["lofigirl"]}' ``` ## Cross-Platform Matching The Socials endpoint provides cross-platform matching: ```json theme={null} { "payload": { "socials": [ "profiles": [ { "platform_id": "twitch", "id": "83232866", "followers": 17325979 }, { "platform_id": "youtube", "id": "UCaY_-ksFSQtTGk0y1HA_3YQ", "followers": 15000000 } ] } } } ``` Use the socials response to find the same creator across platforms. ## ID Validation The API validates IDs but doesn't provide validation endpoints. To verify IDs: 1. **Make a request**: Try fetching the resource 2. **Check response**: 404 means invalid or non-existent ID 3. **Handle gracefully**: Missing resources are normal ## Best Practices > [!TIP] > > Store profile IDs alongside display names for better user experience and easier debugging. * **Store IDs, not URLs**: URLs can change; IDs are stable * **Validate before bulk requests**: Check IDs exist before bulk operations * **Use socials data**: Leverage cross-platform socials data for multi-platform workflows * **Handle missing IDs**: Some IDs may not exist; handle 404s gracefully * **Document ID sources**: Keep track of where IDs come from for debugging ## Normalized Terminology The API normalizes platform-specific terminology to provide consistency across all platforms. | API Term | Twitch | YouTube | TikTok | Instagram | X (Twitter) | | - | - | - | - | - | - | | `followers` | Followers | Subscribers | Followers | Followers | Followers | | `shares` | N/A | N/A | Shares | N/A | Reposts | | `comments` | N/A | Comments | Comments | Comments | Replies | > [!NOTE] > > This normalization only applies to equivalent concepts. On YouTube, "subscribers" represents the free channel subscription count and maps to `followers`. On Twitch, `followers` remains `followers` - the separate paid "subscriber" concept is not exposed through this field. ## Common ID Formats Summary | Resource | Twitch | YouTube | TikTok | Instagram | X (Twitter) | | - | - | - | - | - | - | | Profile | Numeric string | Channel ID (UC...) | Numeric string | Numeric string | Numeric string | | Content | Numeric string | Video ID (alphanumeric) | Numeric string | Shortcode (alphanumeric) | Numeric string | | Game | Numeric string | Channel ID (UC...) | N/A | N/A | N/A | ## Example: Working with IDs ```javascript theme={null} // Twitch profile const twitchProfileId = "484563826"; const profile = await fetch(`/platforms/twitch/profiles/${twitchProfileId}`); // YouTube content const youtubeVideoId = "dQw4w9WgXcQ"; const content = await fetch(`/platforms/youtube/content/${youtubeVideoId}`); // Instagram profile const instagramProfileId = "1234567890"; const igProfile = await fetch(`/platforms/instagram/profiles/${instagramProfileId}`); // Instagram content (using post shortcode) const instagramPostCode = "CxYz123AbCd"; const igContent = await fetch(`/platforms/instagram/content/${instagramPostCode}`); // X (Twitter) profile and post const twitterProfileId = "3165311079"; const xProfile = await fetch(`/platforms/twitter/profiles/${twitterProfileId}`); const twitterPostId = "1925220538357559590"; const xPost = await fetch(`/platforms/twitter/content/${twitterPostId}`); // IGDB game const igdbGameId = "189165"; const game = await fetch(`/platforms/igdb/games/${igdbGameId}`); // Cross-platform matching const socials = await fetch(`/platforms/twitch/profiles/${twitchProfileId}/socials`); const socialProfiles = socials.payload; // Now you have all platform IDs for this creator ``` > [!WARNING] > > Don't assume ID formats are consistent across platforms. Always use the correct format for each platform. # Introduction Source: https://docs.streamforge.com/index Explore Streamforge API guides for authentication, creator profiles, content, and audience analysis, with endpoint references to help you build an integration. Public-facing API for accessing normalized creator, content, and analysis data across Twitch, YouTube, TikTok, Instagram, and X (Twitter). ## Quick Start 1. **Get your API key** - Contact [support@streamforge.com](mailto:support@streamforge.com) to obtain an API key 2. **Make your first request** - Use the interactive API playground below to test endpoints 3. **Read the guides** - Check out our guides for common use cases ## Features * **Multi-platform support** - Access data from Twitch, YouTube, TikTok, Instagram, and X (Twitter) * **Normalized data** - Consistent format across all platforms * **Real-time insights** - Get up-to-date creator and content statistics * **Advanced analytics** - AI-powered audience analysis and creator insights ## Base URL ``` https://external-api.streamforge.com ``` ## Authentication All requests require an API key in the `x-api-key` header. [Learn more about authentication](/essentials/authentication). ## Rate Limiting Each key has a per-minute request limit, and each call costs credits by its endpoint's price tier. [Learn more about rate limits](/essentials/authentication#rate-limits) and [credit costs](/guides/credit-management). ## Interactive API Reference Use the API reference below to explore endpoints and make test requests directly from the documentation.