Overview
The Authors API provides access to author and influencer data for mentions within an alert. This includes social media profiles, follower counts, influence scores, and aggregated statistics.
Methods
Get Authors
Fetch authors/influencers for an alert with optional sorting.
client.get_authors(
account_id: str,
alert_id: str,
*,
limit: int = 100,
sort_by: str | None = None
) -> AuthorsResponse
Maximum number of authors to return
Sort field (mentions, reach, influence, followers, etc.)
Returns: AuthorsResponse containing list of authors and total count
Example:
from mention import MentionClient
client = MentionClient(access_token="your-token")
# Get top influencers sorted by influence score
response = client.get_authors(
"acc_123456",
"alert_123",
limit=50,
sort_by="influence"
)
print(f"Total authors: {response.total}")
for author in response.authors:
print(f"Author: {author.name} (@{author.username})")
print(f" Followers: {author.followers_count:,}")
print(f" Influence: {author.influence_score}")
print(f" Mentions: {author.mentions_count}")
print(f" Source: {author.source}")
print()
Response:
{
"authors": [
{
"id": "author_456",
"name": "John Doe",
"username": "johndoe",
"profile_url": "https://twitter.com/johndoe",
"avatar_url": "https://example.com/avatars/johndoe.jpg",
"followers_count": 15000,
"following_count": 500,
"influence_score": 82.5,
"mentions_count": 25,
"source": "twitter",
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-20T15:30:00Z"
},
{
"id": "author_789",
"name": "Jane Smith",
"username": "janesmith",
"profile_url": "https://instagram.com/janesmith",
"avatar_url": "https://example.com/avatars/janesmith.jpg",
"followers_count": 50000,
"following_count": 1200,
"influence_score": 91.3,
"mentions_count": 18,
"source": "instagram",
"created_at": "2024-01-12T14:20:00Z",
"updated_at": "2024-01-20T16:45:00Z"
}
],
"total": 142
}
Sorting Options
You can sort authors by various metrics using the sort_by parameter:
| Sort Field | Description |
|---|
mentions | Number of mentions by this author |
reach | Total reach of author’s mentions |
influence | Influence score (0-100) |
followers | Follower count |
engagement | Total engagement (likes, shares, comments) |
Example:
# Get top 10 authors by reach
top_by_reach = client.get_authors(
"acc_123456",
"alert_123",
limit=10,
sort_by="reach"
)
# Get most active authors (by mention count)
most_active = client.get_authors(
"acc_123456",
"alert_123",
limit=20,
sort_by="mentions"
)
# Get top influencers
top_influencers = client.get_authors(
"acc_123456",
"alert_123",
limit=15,
sort_by="influence"
)
Use Cases
Identify Key Influencers
Find the most influential people talking about your brand:
from mention import MentionClient
client = MentionClient(access_token="your-token")
# Get top influencers
response = client.get_authors(
"acc_123456",
"alert_123",
limit=10,
sort_by="influence"
)
print("Top 10 Influencers:")
for i, author in enumerate(response.authors, 1):
print(f"{i}. {author.name} - Score: {author.influence_score}")
print(f" Followers: {author.followers_count:,}")
print(f" Profile: {author.profile_url}")
Track Active Contributors
Monitor who is mentioning your brand most frequently:
# Get most active authors
active_authors = client.get_authors(
"acc_123456",
"alert_123",
sort_by="mentions"
)
print("Most Active Contributors:")
for author in active_authors.authors[:5]:
print(f"{author.name}: {author.mentions_count} mentions")
Group authors by their social media platform:
from collections import defaultdict
response = client.get_authors(
"acc_123456",
"alert_123",
limit=200
)
by_platform = defaultdict(list)
for author in response.authors:
by_platform[author.source].append(author)
for platform, authors in by_platform.items():
total_reach = sum(a.followers_count or 0 for a in authors)
print(f"{platform}: {len(authors)} authors, {total_reach:,} total reach")
Models
Author
Represents an author/influencer.
| Field | Type | Description |
|---|
id | string | Author ID |
name | string | Display name |
username | string | Username/handle |
profile_url | string | Profile URL |
avatar_url | string | Avatar image URL |
followers_count | integer | Number of followers |
following_count | integer | Number of following |
influence_score | float | Influence score (0-100) |
mentions_count | integer | Number of mentions by this author |
source | string | Social media platform |
created_at | datetime | First seen timestamp |
updated_at | datetime | Last update timestamp |
AuthorsResponse
Response containing a list of authors.
| Field | Type | Description |
|---|
authors | list[Author] | List of author objects |
total | integer | Total number of authors (may be more than returned) |
AuthorStats
Statistics for a specific author (used in advanced analytics).
| Field | Type | Description |
|---|
author_id | string | Author ID |
mentions_count | integer | Total mentions |
reach | integer | Total reach |
engagement | integer | Total engagement |
sentiment_positive | integer | Positive mentions |
sentiment_negative | integer | Negative mentions |
sentiment_neutral | integer | Neutral mentions |
Understanding Influence Score
The influence score is calculated based on multiple factors:
- Follower count: Number of followers/subscribers
- Engagement rate: Likes, shares, comments on posts
- Reach: Total potential audience
- Authority: Domain authority for web sources
- Activity: Posting frequency and consistency
Scores range from 0-100, where:
- 0-30: Low influence
- 30-60: Medium influence
- 60-80: High influence
- 80-100: Very high influence (major influencer)