- Use cases
- Newsroom monitoring
Newsroom monitoring
Watch channels and accounts and get new items at a webhook.
The job
Desks follow sources, not feeds. Point a monitor at a channel or search and your tool receives each new item as it appears.
Endpoints
Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.
| Endpoint | Returns | Cost |
|---|---|---|
| Telegram channel posts | 1 credit | |
| Bluesky profile posts | 1 credit | |
| YouTube search | 1 credit | |
| X post search | 1 credit | |
| Create a monitor | Free |
Recipe
- List the sources you follow.
- Create a monitor per source or search.
- Verify the signature on each delivery, then route it to the desk.
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# Telegram channel posts14posts = get("/v1/telegram/channel/posts", handle="telegram")15# YouTube search16fresh = get("/v1/youtube/search", query="breaking news", type="video", upload_date="hour", sort="latest")1718for p in posts["items"][:5]:19 print(p["published_at"], p["url"])20for v in fresh["items"][:5]:21 print(v["url"])1const API = "https://api.socialscrape.dev";2const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };34async function get(path: string, params: Record<string, string | number | boolean>) {5 const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));6 const res = await fetch(`${API}${path}?${query}`, { headers });7 if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);8 return (await res.json()).data;9}1011// Telegram channel posts12const posts = await get("/v1/telegram/channel/posts", { handle: "telegram" });13// YouTube search14const fresh = await get("/v1/youtube/search", { query: "breaking news", type: "video", upload_date: "hour", sort: "latest" });1516for (const p of posts.items.slice(0, 5)) console.log(p.published_at, p.url);17for (const v of fresh.items.slice(0, 5)) console.log(v.url);Calls use api.socialscrape.dev and return the shapes in the reference.
Good to know
Telegram returns web-preview pages only. Verification of what you find stays your job.
Related
Questions
How often does a monitor check?
You choose the interval. The limits are in the monitors guide.