Competitor tracking API

Pull what a competitor posted this week on each platform, with the numbers.

The job

Pick the accounts, fetch their latest posts on a schedule, and store the counts. A change between runs is the signal.

Endpoints

EndpointReturnsCost
GET /v1/youtube/channel/videosYouTube channel videos1 credit
GET /v1/instagram/profile/postsInstagram profile posts1 credit
GET /v1/facebook/ad-library/searchFacebook Ad Library 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. List each account's latest posts.
  2. Store views, likes and comments with a date.
  3. Compare runs, or let a monitor send only new posts.
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"]

# YouTube channel videos
youtube = get("/v1/youtube/channel/videos", handle="mkbhd", sort="latest")
# Instagram profile posts
instagram = get("/v1/instagram/profile/posts", handle="nasa")

for feed in (youtube, instagram):
    for post in feed["items"][:5]:
        print(post["platform"], post["published_at"], 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;
}

// YouTube channel videos
const youtube = await get("/v1/youtube/channel/videos", { handle: "mkbhd", sort: "latest" });
// Instagram profile posts
const instagram = await get("/v1/instagram/profile/posts", { handle: "nasa" });

for (const feed of [youtube, instagram])
  for (const post of feed.items.slice(0, 5)) console.log(post.platform, post.published_at, post.url);

Good to know

Instagram play counts are not in every list response; the reference shows when a request can add them.

Build on social data early.

Developers and agent builders get the first keys.

Get early access