Skip to main content

Mentio Python SDK

PyPI Python license docs

Social listening for developers, in Python. Mentio watches Reddit, Hacker News, X, GitHub, Bluesky, LinkedIn, Stack Overflow, DEV, YouTube and news for your keywords and scores every mention for relevance, sentiment and intent. This package is the official Python client for its API: one object, one call per endpoint, generated from the OpenAPI document and regenerated whenever the API changes, so it is always complete. Python 3.11+, sync and async, typed.

Installation

pip install mentio

Quick start

from mentio import Mentio

mentio = Mentio(api_key="mk_live_...")

# Track a keyword on two platforms.
keyword = mentio.keywords.create(term="acme cloud", kind="brand", platforms=["reddit", "x"])

# Read what arrived, relevant posts only, newest first.
for mention in mentio.mentions.search(platform="reddit", relevant=True, limit=25).data:
    print(mention.post.platform.value, mention.classification.relevance, mention.post.url)

An API key comes from the dashboard (Settings, API keys) or from mentio.api_keys.create(...) with an existing key. Every account starts with $5.80 of credit and no card.

Configuration

mentio = Mentio(
    api_key="mk_live_...",                # required
    base_url="https://api.mentio.dev",    # another deployment's host, if you run one
    timeout=30.0,                         # seconds, or None for no timeout
)

Enum-valued arguments take plain strings (platform="reddit"). Instants take a datetime, an ISO 8601 string, or epoch milliseconds. Bodies take a dict, a model, or their fields as keyword arguments.

Examples

Page through every mention of the last week

from datetime import datetime, timedelta, timezone

since = datetime.now(timezone.utc) - timedelta(days=7)
cursor = None
while True:
    page = mentio.mentions.search(since=since, relevant=True, limit=100, cursor=cursor)
    for mention in page.data:
        print(mention.post.url)
    cursor = page.next_cursor
    if not cursor:
        break

Filter by intent and sentiment

hot = mentio.mentions.search(intent="buy_intent", sentiment="negative", min_followers=1000, sort="priority")

Intents are buy_intent, question, complaint, praise and comparison. sort="priority" puts fresh, relevant, high-reach posts first.

Triage

mentio.mentions.update("mm_7f3a...", status="done", note="replied 2026-09-14")
mentio.mentions.update("mm_9c1b...", status="ignored")

An instant Slack alert for buying signals on Reddit

slack = next(c for c in mentio.channels.list().data if c.kind == "slack")

mentio.alerts.create(
    name="Reddit buying signals",
    mode="instant",
    filter={"platforms": ["reddit"], "intents": ["buy_intent"], "minRelevance": 40},
    channelIds=[slack.id],
)

Body fields keep the API's names (channelIds, minRelevance); query parameters are snake_case (min_followers). Slack, Telegram, email and webhook channels are created with mentio.channels.create(...); mentio.alerts.test(id) sends a sample; mentio.alerts.run(id) sends a daily alert's last 24 hours now.

Analytics

summary = mentio.analytics.summary(range_="30d", compare=True, timezone="Europe/Madrid")
by_platform = mentio.analytics.breakdown(range_="30d", by="platform")
sov = mentio.analytics.share_of_voice(range_="90d")

People

people = mentio.people.list(platforms=["x"], min_followers=5000)
mentio.people.update(people.data[0].id, tags=["influencer"], muted=False)

CSV export

csv_text = mentio.mentions.export(since="2026-09-01T00:00:00Z")

Async

AsyncMentio mirrors every call for asyncio:

import asyncio
from mentio import AsyncMentio

async def main() -> None:
    mentio = AsyncMentio(api_key="mk_live_...")
    page = await mentio.mentions.search(relevant=True, limit=10)
    for mention in page.data:
        print(mention.post.url)

asyncio.run(main())

Error handling

A non-2xx raises MentioError with the API's status, code and message:

from mentio import Mentio, MentioError

try:
    mentio.keywords.create(term="acme", kind="brand")
except MentioError as err:
    if err.code == "duplicate_keyword":
        pass                          # already tracked
    elif err.code == "insufficient_balance":
        print("top up from Billing")
    elif err.code == "rate_limited":
        print("slow down")
    else:
        raise

The full catalog, with status and meaning, is at docs.mentio.dev/errors. Common codes: unauthorized, forbidden, read_only_key, validation_error, not_found, invalid_cursor, rate_limited, duplicate_keyword, insufficient_balance, keyword_limit_reached, upstream_unavailable, internal_error.

SDK reference

Resource Methods
mentio.keywords create, list, get, update, delete
mentio.mentions search, get, update, export
mentio.people list, get, update, merge, split, export
mentio.segments list, create, get, update, delete
mentio.alerts list, create, get, update, delete, test, run
mentio.channels list, create, get, update, delete, test, rotate_secret, deliveries
mentio.analytics summary, series, breakdown, share_of_voice
mentio.company get, update
mentio.api_keys create, list, revoke
mentio.system health

The generated low-level client and models live under mentio.api and mentio.models for anything the facade does not cover.

MCP server

The same API is available to Claude Code, Cursor, Codex, claude.ai and ChatGPT as tools:

claude mcp add --transport http mentio https://mcp.mentio.dev/mcp

Guide: docs.mentio.dev/mcp.

Requirements

  • Python 3.11+
  • A Mentio API key

This repository is published from the Mentio monorepo on every release; regenerate from a checkout with pnpm --filter @mentio-dev/sdk-python generate (needs uv).

License

MIT.

Metadata

Release files for mentio 0.13.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mentio 0.13.4
File Size Uploaded
mentio-0.13.4.tar.gz 292.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mentio 0.13.4
File Interpreter ABI Platform
mentio-0.13.4-py3-none-any.whl Python 3 none any Details

Total release size: 992.1 kB

Release files / mentio-0.13.4.tar.gz

Download URL mentio-0.13.4.tar.gz
Size 292.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0d8d7b3ea1c59e914a070f9aaaac881ce37bf1e887feb044592f48c7f2bfbcd8
BLAKE2b-256 checksum
How to use checksums
10ff8a6ed64075b834d010030b9a80dd73308da78878e2822396136f64133306
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mentio-0.13.4-py3-none-any.whl

Download URL mentio-0.13.4-py3-none-any.whl
Size 699.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a20227f89631dc4f9a8baf56b15790ce0784b863b6c6096437e9f41080b23479
BLAKE2b-256 checksum
How to use checksums
537dcebefbbbf2f4d4bf0aaecc0465866d8501a9056de073b7019718f3ae6f8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.13.4 This release

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page