Social listening API

Search public posts for a keyword on several platforms and keep every hit as JSON.

The job

Listening starts with one question: who mentioned us today? Search each platform for your terms, store the rows, and run the same query on a schedule.

Endpoints

EndpointReturnsCost
GET /v1/tiktok/search/keywordTikTok video search1 credit
GET /v1/youtube/searchYouTube search1 credit
GET /v1/instagram/search/reelsInstagram reel search1 credit
GET /v1/threads/searchThreads post search1 credit
GET /v1/twitter/search/postsX post search1 credit
POST /v1/monitorsCreate a monitorFree

Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.

Recipe

  1. Search each platform for the same term.
  2. Keep the ids, so a repeat run only adds what is new.
  3. Watch a search with a monitor instead of polling it.
Preview
The API is in early access. Calls use api.socialscrape.io and return the shapes in the reference.
Python
import os
import requests

API = "https://api.socialscrape.io"
HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}


def get(path, **params):
    res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)
    res.raise_for_status()
    return res.json()["data"]

# TikTok video search
tiktok = get("/v1/tiktok/search/keyword", query="standing desk", sort="latest", date_posted="week")
# YouTube search
youtube = get("/v1/youtube/search", query="standing desk", type="video", upload_date="week")

for post in tiktok["items"] + youtube["items"]:
    print(post["platform"], post["url"])
TypeScript
const API = "https://api.socialscrape.io";
const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };

async function get(path: string, params: Record<string, string | number | boolean>) {
  const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));
  const res = await fetch(`${API}${path}?${query}`, { headers });
  if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
  return (await res.json()).data;
}

// TikTok video search
const tiktok = await get("/v1/tiktok/search/keyword", { query: "standing desk", sort: "latest", date_posted: "week" });
// YouTube search
const youtube = await get("/v1/youtube/search", { query: "standing desk", type: "video", upload_date: "week" });

for (const post of [...tiktok.items, ...youtube.items]) console.log(post.platform, post.url);

Good to know

Each platform ranks its own search, so the same term gives different lists. Twitter/X search goes through a web search engine, so it is a sample of public posts, not the full firehose.

Questions

Can I get alerts instead of running searches?
Yes. A monitor watches a list endpoint and posts new items to a signed webhook. See monitors and webhooks.

Build on social data early.

Developers and agent builders get the first keys.

Get early access