Recipes
Nine end-to-end builds on the InsightSocial API, from brand monitoring to ad audits, each with its credit cost worked out before you run it.
Each recipe solves one real task from start to finish and tells you what a run costs before you start. The snippets are Python (3.9+, requests), with Node.js (22+, native fetch) where a recipe benefits from both. They read your key from INSIGHTSOCIAL_API_KEY, use real public accounts, queries and URLs, and read the schema 2 response shape: posts, profiles, comments and transcripts look the same on every platform. Anything a recipe derives, such as an engagement rate or a sentiment score, it computes from those fields in your code.
New to the API? The Quickstart gets you a key and a first call in a few minutes.
Pick a recipe
| Recipe | What you build | Credits per run |
|---|---|---|
| Brand mention monitoring | A daily sweep of six platforms' search for your brand, deduped | from 120 per sweep |
| Sentiment analysis | How people feel about a topic, scored from the comments with your own model | from 400 |
| Competitor tracking | Follower counts, engagement and latest posts across four platforms, snapshotted | 160–420 per competitor |
| Creator engagement scoring | One creator's engagement on three platforms, worked out from recent posts and ranked | 120–380 per creator |
| TikTok analytics dashboard | Account KPIs, a per-video table and a comment feed | 60–100 per refresh |
| Search then enrich | Posts on a topic, then the full profile of everyone who posted them | from 240 |
| Video transcription | One transcribe() function for seven platforms | 60 (YouTube) or 200 per video |
| Ad library aggregation | Every ad a brand runs on Meta, LinkedIn and TikTok | 300–540 per brand |
| Music trend detection | A cross-platform heat score for a sound on TikTok and Instagram | 40 per song |
Where a price is a range, at least one endpoint in the recipe is metered: the top of its range is held when the call starts and you are charged what it actually used. Failed calls, empty results and dry_run=1 calls are never charged. Repeating a call is charged again (2 credits when the shared cache answers it), so store what you fetch. API credits are non-refundable. See Credits.
Which recipe should I start with?
If you want to see the breadth of the API, start with Brand mention monitoring. It runs six platforms' search endpoints in parallel from one key, with one response envelope to handle.
If you already know the platform, the TikTok analytics dashboard is the shortest complete example: three calls, one account.
The helper every recipe uses
Every recipe calls the API through the same small function. It sends the key in x-api-key, raises on a failed call, and returns the whole envelope so you can read data, pagination, unavailable and credits_used.
import os
import requests
KEY = os.environ["INSIGHTSOCIAL_API_KEY"]
BASE = "https://api.insightsocial.app/v1"
def get(path, **params):
res = requests.get(
f"{BASE}/{path}",
params=params,
headers={"x-api-key": KEY},
timeout=120,
)
body = res.json()
if not body["success"]:
raise RuntimeError(f'{body["error"]["type"]}: {body["error"]["message"]}')
return bodyA count the platform hides is null, never 0, so the recipes skip nulls rather than adding them. unavailable lists the fields a response could not fill on any row, for example ["items[].post.author.id"].
Two limits shape how the recipes run calls in parallel: 60 requests per minute and 10 calls in flight per key. The recipes keep their thread pools at 10 or fewer. See Rate limits.
Related
Which endpoint should I use?
Side-by-side decision tables for the endpoints that look alike, with the credit price of each so you pick the one that returns what you need for the least.
Brand mention monitoring
Run a daily brand-mention sweep across the search endpoints of six platforms in parallel, drop off-topic rows with a keyword check, dedupe against earlier runs and alert on what is new. From 60 credits per sweep.