Skip to main content

Overview

The Mention Python Client is a modern, fully-typed Python library that provides a simple and intuitive interface to interact with the Mention API. Built with developer experience in mind, it offers both synchronous and asynchronous clients with automatic retry logic, comprehensive error handling, and full type hints.

Key Features

Fully Typed

Complete type hints for all methods and models using Pydantic for validation

Async Support

Both synchronous (MentionClient) and asynchronous (AsyncMentionClient) implementations

Auto Retry

Built-in retry logic with exponential backoff for failed requests

Error Handling

Comprehensive exception hierarchy for better error handling

What is Mention?

Mention is a powerful media monitoring and social listening platform that helps you:
  • Monitor your brand across millions of web sources
  • Track social media mentions in real-time
  • Analyze sentiment and engagement metrics
  • Engage with your audience directly from the platform

Use Cases

The Mention Python Client enables you to:
Track mentions of your brand, products, or competitors across web sources and social media platforms. Set up alerts with custom keywords and get notified when relevant content appears.
Analyze the tone and sentiment of mentions to understand public perception. Fetch statistics and generate reports on positive, negative, and neutral mentions.
Monitor conversations about your industry, identify trends, and discover influencers. Stream mentions in real-time to stay on top of important discussions.
Automate your monitoring workflows by creating tasks, tagging mentions, and generating reports programmatically. Integrate Mention data into your existing systems.

API Coverage

The client provides complete coverage of the Mention API, including:
  • Accounts - Create and manage accounts
  • Alerts - Configure monitoring alerts with custom queries
  • Mentions - Fetch, filter, and curate mentions
  • Tasks - Create and manage tasks for team collaboration
  • Tags - Organize mentions with custom tags
  • Statistics - Access analytics and metrics
  • Authors - Identify and track influencers
  • Shares - Share mentions with team members

Example

Here’s a quick example of what you can do with the Mention Python Client:
from mention import MentionClient

# Initialize the client
client = MentionClient(access_token="your-token")

# Fetch all alerts for an account
alerts = client.get_alerts("account-id")

# Get mentions for an alert
mentions = client.get_mentions("account-id", "alert-id", limit=50)

# Iterate through mentions
for mention in mentions.mentions:
    print(f"{mention.title} - {mention.tone}")

Requirements

The Mention Python Client requires Python 3.10 or higher.
The library has minimal dependencies:
  • httpx - Modern HTTP client with sync and async support
  • pydantic - Data validation using Python type hints
  • python-dotenv - Environment variable management

Getting Help

If you need assistance:

License

The Mention Python Client is released under the MIT License. See the LICENSE file for details.

Build docs developers (and LLMs) love