Social Listening API: Track Mentions Across 17 Networks With One Key

Published · 9 min read

A social listening API is the data layer under a listening product. It finds public posts that mention your terms, pulls the comments under them, and watches the accounts you care about, all as structured JSON. SocialLens provides that layer across 17 networks with one key and one schema. It does not score sentiment or draw dashboards. That happens in your own code or an LLM, and this guide shows how to build it, what it costs in reads, and where public data stops.

Three different products share the name "social listening API"

Before comparing vendors, decide which of three things you actually need. Most articles blur them together.

Type What it reads Whose data Who does analysis Fits when
Owned-account inbox Your mentions, comments and DMs, often pushed by webhook Accounts you connected and authorized You, or the vendor's UI You run community management for your own brand handles
Public data layer (SocialLens) Keyword search results, public posts, comments, profiles Any public account or post Your code or your LLM You want a custom listening feed, an internal tool, or an AI agent
Finished dashboard suite Social plus, often, news, blogs and forums Public web, sometimes licensed feeds The suite (built-in sentiment, charts, alerts) Your team wants a UI, not a codebase

An inbox cannot see a conversation about you that never tags your account. A dashboard suite is fast to adopt but hard to bend to your own logic. A public data layer sees conversations you were never tagged in and gives you full control, at the price of writing the analysis yourself.

Sentiment is not a field in the response

Some vendors describe their listening API as one that "analyzes" conversations, which leaves buyers guessing whether sentiment is a response field, a paid add-on, or marketing copy. SocialLens states it directly: responses contain what the platform shows publicly (text, author, timestamps, likes, comments, views where exposed). No sentiment field exists. You classify the text yourself, and an LLM does that well. The scoring step appears later in this guide.

The same honesty applies to metrics. Reach and impressions are private insights that only the account owner (or an app they authorize) can see. No public listening feed can return them for an account you do not control. Public listening gives you likes, comments, views where the network shows them, follower counts, and the text itself.

Why official platform APIs struggle as a listening feed

The obvious first move is to wire up each network's own API. For listening specifically, each one has a catch:

Each of these is a separate app, auth flow, schema and quota. Five networks means five integrations before you write a line of listening logic. The broader picture is in Social Media APIs Compared.

The building blocks: search, posts, comments, profiles

A listening feed on SocialLens uses four kinds of read, all with the same key and JSON conventions.

1. Keyword search: find the conversation

The search endpoint returns public posts matching a term on a given network. Search coverage and quality differ by network, because each platform exposes search differently. Some networks support keyword search through SocialLens. Others support profile and post lookup only. Check the current per-network list in the API reference and in Social Media Search API by Keyword before you design around a specific network.

2. Profile posts: watch key accounts

Search finds strangers talking about you. /v1/profile-posts watches the accounts you already know matter: competitors, partners, the creators who drive your category.

curl "https://api.sociallens.dev/v1/profile-posts?platform=tiktok&username=HANDLE&limit=10" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Each post comes back in this shape (illustrative types, not real values):

{ "url": "<string>", "caption": "<string>", "published_at": "<ISO 8601>", "likes": "<int>", "comments": "<int>", "views": "<int or null>" }

views is null where the network does not expose a view count. The API never guesses.

3. Post comments: where the real opinion lives

The post itself is often marketing. The comments are the voice of the market. /v1/post-comments expands any public post into its thread:

curl "https://api.sociallens.dev/v1/post-comments?platform=youtube&url=POST_URL" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
{ "text": "<string>", "author": "<string>", "likes": "<int>", "replies": "<int>" }

More on this endpoint in Social Media Comments API.

4. Profile: context on who is talking

When a mention shows up, /v1/profile tells you whether the author has a large audience or almost none:

{ "exists": true, "username": "<string>", "verified": "<bool>", "private": false, "followers": "<int>", "is_exact": "<bool>", "fetched_at": "<ISO 8601>" }

is_exact tells you whether the follower count is the precise integer or a rounded figure from the network. A deleted or missing handle returns "exists": false, not an error, and costs nothing.

A practical listening pipeline

The steps below turn those reads into a working feed: poll search, expand hits into comments, watch key accounts, dedupe, store, score, and alert. This sketch is in Python. Confirm the exact search path and parameters in the API reference, because the search() helper below is the one part you should check against the docs.

import os, sqlite3, requests

BASE = "https://api.sociallens.dev/v1"
H = {"Authorization": f"Bearer {os.environ['SOCIALLENS_API_KEY']}"}
db = sqlite3.connect("listening.db")
db.execute("CREATE TABLE IF NOT EXISTS seen (id TEXT PRIMARY KEY, platform TEXT, text TEXT, label TEXT)")

def get(path, **params):
    r = requests.get(f"{BASE}/{path}", headers=H, params=params, timeout=30)
    return r.json() if r.status_code == 200 else None

def search(platform, query):
    # Confirm path and params in the API reference.
    return get("search", platform=platform, query=query) or {}

def is_new(post_id):
    return db.execute("SELECT 1 FROM seen WHERE id=?", (post_id,)).fetchone() is None

TERMS = ["yourbrand", "your product name"]
WATCH = [("instagram", "competitor_a"), ("tiktok", "competitor_b")]
SEARCH_PLATFORMS = ["reddit", "youtube"]  # use networks with keyword search support

hits = []
for p in SEARCH_PLATFORMS:
    for t in TERMS:
        for post in search(p, t).get("results", []):
            if is_new(post["url"]):
                hits.append((p, post))

for p, user in WATCH:
    for post in (get("profile-posts", platform=p, username=user, limit=10) or {}).get("posts", []):
        if is_new(post["url"]):
            hits.append((p, post))

Dedupe on the post URL (or ID), because the same post will match on several polls. Then expand high-signal hits into comments and score the text:

def classify(text):
    # Call your LLM of choice; return "positive" | "neutral" | "negative" | "urgent"
    ...

for p, post in hits:
    label = classify(post.get("caption", ""))
    db.execute("INSERT OR IGNORE INTO seen VALUES (?,?,?,?)", (post["url"], p, post.get("caption"), label))
    if post.get("comments"):
        thread = get("post-comments", platform=p, url=post["url"]) or {}
        # classify comments in a batch, store, and flag clusters of negatives
    if label == "urgent":
        requests.post(os.environ["SLACK_WEBHOOK"], json={"text": f"{p}: {post['url']}"})
db.commit()

Run it on a schedule (cron, a serverless function, or an n8n workflow). Freshness equals your polling interval: poll every four hours and a mention can be up to four hours old when you see it. For a deeper method on turning comment threads into themes, see Voice of Customer from Social Media Comments with AI. For the account-watching side, see Monitor a Competitor's Social Media by API.

Cost math: estimate your monthly reads

SocialLens charges one credit per successful read (HTTP 200). Errors and not-found results cost zero, and prepaid credits never expire. That makes budgeting simple arithmetic. Here is a worked example with hypothetical inputs:

Total: about 20,700 reads a month. The biggest lever is search frequency. Dropping from 6 to 3 polls a day cuts the search line in half. You can also poll fast-moving networks often and slower ones daily. Start with the 250 free reads (no card) to measure your real hit rate, then see pricing for per-credit rates.

Listening with an AI agent (MCP)

To skip the pipeline code entirely, hand the reads to an agent. SocialLens ships an MCP server (registry name dev.sociallens/sociallens-mcp), so any MCP-aware client can call search, posts and comments as typed tools:

{
  "mcpServers": {
    "sociallens": {
      "command": "npx",
      "args": ["-y", "sociallens-mcp"],
      "env": { "SOCIALLENS_API_KEY": "sk_live_YOUR_KEY" }
    }
  }
}

Then give it a standing brief, for example: "Every morning, search Reddit and YouTube for 'yourbrand', open the comments on the five most-engaged results, and summarize sentiment, recurring complaints and anything that needs a reply today." The agent does the reading through the API and the judgment in the model. Setup details are in Social Media MCP Server: Give Your AI Agent Data and the agents guide.

What the public data does not cover

Know these edges before you build:

How the options compare

Option What it is Model Best fit
SocialLens Public data layer, 17 networks, REST and MCP Prepaid credits, 1 per successful read, never expire Custom feeds, internal tools, AI agents
Data365 Social data API positioned for listening Subscription tiers Teams wanting a monthly plan
Phyllo Creator data, largely via a consented connect step Contract or plan based Apps where creators authorize their own accounts
EnsembleData Social scraping API Per-call units High-volume reads on its supported networks
Apify Marketplace of scrapers ("actors") Usage-based compute Teams comfortable picking and maintaining actors
Bright Data Scraping infrastructure and datasets Usage or dataset pricing Large data teams building their own collection

If you want a finished UI with built-in sentiment and news coverage, an enterprise listening suite is the better fit, and that is fine. If you want the raw, consistent data to build exactly the feed you need, a data layer is the right tool.

FAQ

What is a social listening API? It is programmatic access to public social conversations: keyword search results, posts, comments and profiles as structured data. SocialLens provides that data layer across 17 networks. Analysis such as sentiment runs in your own code or an LLM.

Does SocialLens include sentiment analysis? No. Responses contain the public text and metrics only. You classify sentiment downstream, typically with an LLM call per post or comment batch, as shown in the pipeline above.

Which 17 networks are covered? TikTok, Instagram, YouTube, Facebook, X, Reddit, LinkedIn, Threads, Pinterest, Telegram, Bluesky, Truth Social, Cosmos, SoundCloud, Kwai, GitHub and Spotify. Keyword search is supported on a subset, so check the API reference for the current list.

Can a social listening API show reach and impressions? Not for accounts you do not own. Reach and impressions are private insights available only to the account owner or an app they authorize. Public listening provides likes, comments, views where shown, and the text.

How fresh is the data? Each read is live at request time and stamped with fetched_at. Your feed's freshness depends on how often you poll.

How much does it cost to run? One credit per successful read, with errors and not-found results free. Multiply keywords by polls per day by days, then add watched accounts and comment expansions. Start with 250 free reads to measure your actual volume.

Run these requests yourself

Every example on this page is a real call to the SocialLens API. A new account starts with 250 free reads, no card needed, and a read that fails is never charged.

Keep reading