The "I never know what to post next" problem is a data problem, not a creativity problem. Founders and creators stare at a blank draft because they are guessing instead of looking at what already works in their niche. The TikTok API fixes the guessing half: pull the top videos for your niche hashtags, sort by play count, and you have a ranked list of formats and hooks that are getting views right now. Scavio's TikTok endpoints return this as structured JSON at 1 credit ($0.005) per request, no scraping, no proxies. This walks through turning a niche into a content-idea queue. The API gives you the signal; the angle is still yours.
Prerequisites
- A Scavio API key (50 free credits on signup)
- Python 3.9+ or Node 18+
- A niche and two or three seed hashtags
Walkthrough
Step 1: Resolve your hashtag to its challenge ID
TikTok endpoints are a two-step lookup: name to ID, then ID to data. Start by resolving your seed hashtag (for example "skincare") to its challenge_id and view stats.
import os, requests
H = {"Authorization": f"Bearer {os.environ['SCAVIO_API_KEY']}", "Content-Type": "application/json"}
tag = requests.post("https://api.scavio.dev/api/v1/tiktok/hashtag",
headers=H, json={"hashtag": "skincare"}).json()
print(tag["data"]) # challenge_id, view_count, video_countStep 2: Pull the top videos under that hashtag
Fetch videos for the hashtag and read the statistics block on each: play_count, digg_count (likes), comment_count, share_count. These are your ranking signals, what the niche is actually rewarding.
vids = requests.post("https://api.scavio.dev/api/v1/tiktok/hashtag/videos",
headers=H, json={"hashtag": "skincare", "count": 30}).json()
top = sorted(vids["data"]["videos"],
key=lambda v: v["statistics"]["play_count"], reverse=True)[:10]Step 3: Search for format patterns, not just one hashtag
Hashtags are noisy. Use search/videos with a niche phrase ("morning skincare routine") to catch high-view videos that did not use your exact tag. Combine both lists and dedupe by video ID for a fuller picture of what is working.
search = requests.post("https://api.scavio.dev/api/v1/tiktok/search/videos",
headers=H, json={"query": "morning skincare routine", "count": 30}).json()Step 4: Extract the repeatable pattern, then add your angle
Look across the top videos for the shared structure: the hook in the first two seconds, the format (before/after, list, voiceover), the length. That repeatable structure is your content idea. The API hands you the proven format; you bring the niche-specific angle and voice. Re-run weekly, trends decay fast, and last month's winning hook is this month's noise.
Python Example
import os, requests
H = {"Authorization": f"Bearer {os.environ['SCAVIO_API_KEY']}", "Content-Type": "application/json"}
def content_ideas(hashtag, phrase, n=10):
vids = requests.post("https://api.scavio.dev/api/v1/tiktok/hashtag/videos",
headers=H, json={"hashtag": hashtag, "count": 30}).json()["data"]["videos"]
found = requests.post("https://api.scavio.dev/api/v1/tiktok/search/videos",
headers=H, json={"query": phrase, "count": 30}).json()["data"]["videos"]
pool = {v["id"]: v for v in vids + found}.values()
return sorted(pool, key=lambda v: v["statistics"]["play_count"], reverse=True)[:n]
for v in content_ideas("skincare", "morning skincare routine"):
print(v["statistics"]["play_count"], v["desc"][:80])JavaScript Example
const H = { Authorization: `Bearer ${process.env.SCAVIO_API_KEY}`, "Content-Type": "application/json" };
async function contentIdeas(hashtag, phrase, n = 10) {
const post = (path, body) => fetch(`https://api.scavio.dev/api/v1/tiktok/${path}`,
{ method: "POST", headers: H, body: JSON.stringify(body) }).then(r => r.json());
const a = (await post("hashtag/videos", { hashtag, count: 30 })).data.videos;
const b = (await post("search/videos", { query: phrase, count: 30 })).data.videos;
const pool = [...new Map([...a, ...b].map(v => [v.id, v])).values()];
return pool.sort((x, y) => y.statistics.play_count - x.statistics.play_count).slice(0, n);
}Expected Output
A ranked list of the highest-view videos in your niche, each with its play count and description, so the next post is based on what is already winning instead of a blank-page guess.