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 and use real public accounts, queries and URLs.
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, from free per-comment sentiment labels | from 400 |
| Competitor tracking | Follower counts and latest posts across four platforms, snapshotted | 160–660 per competitor |
| Creator engagement scoring | One creator's engagement on three platforms, ranked | 60 per creator |
| TikTok analytics dashboard | Account KPIs, a per-video table and a comment feed | 60–260 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, and repeating the exact same call inside its window (1 hour for search, 6 hours for most lists, 24 hours for profiles) costs 0. 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 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 bodyTwo 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 for free, dedupe against earlier runs and alert on what is new. From 120 credits per sweep.