1. Use cases
  2. Competitor tracking API

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

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

EndpointReturnsCost
YouTube channel videos1 credit
Instagram profile posts1 credit
Facebook Ad Library search1 credit
Create a monitorFree

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.
1import os2import requests34API = "https://api.socialscrape.dev"5HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}678def get(path, **params):9    res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)10    res.raise_for_status()11    return res.json()["data"]1213# YouTube channel videos14youtube = get("/v1/youtube/channel/videos", handle="mkbhd", sort="latest")15# Instagram profile posts16instagram = get("/v1/instagram/profile/posts", handle="nasa")1718for feed in (youtube, instagram):19    for post in feed["items"][:5]:20        print(post["platform"], post["published_at"], post["url"])

Calls use api.socialscrape.dev and return the shapes in the reference.

Good to know

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

Related