- Use cases
- Community monitoring
Community monitoring
Read groups, channels and communities and watch for new posts.
The job
Support and product teams follow where their users talk. List the newest posts in each space and keep what mentions you.
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 |
|---|---|---|
| Facebook group posts | 1 credit | |
| Telegram channel posts | 1 credit | |
| Create a monitor | Free |
Recipe
- List the spaces you follow.
- Read their newest posts.
- Add a monitor to get new ones at a webhook.
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")1516for p in posts["items"][:5]:17 print(p["published_at"], p["text"][:80])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" });1314for (const p of posts.items.slice(0, 5)) console.log(p.published_at, String(p.text).slice(0, 80));Calls use api.socialscrape.dev and return the shapes in the reference.
Good to know
Private groups and invite-only channels are out of reach by design.