Skip to main content

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
account_id
string
required
The account ID
alert_id
string
required
The alert ID
limit
integer
default:"100"
Maximum number of authors to return
sort_by
string
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 FieldDescription
mentionsNumber of mentions by this author
reachTotal reach of author’s mentions
influenceInfluence score (0-100)
followersFollower count
engagementTotal engagement (likes, shares, comments)
Example:
Sync
# 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:
Sync
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:
Sync
# 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")

Analyze by Platform

Group authors by their social media platform:
Sync
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.
FieldTypeDescription
idstringAuthor ID
namestringDisplay name
usernamestringUsername/handle
profile_urlstringProfile URL
avatar_urlstringAvatar image URL
followers_countintegerNumber of followers
following_countintegerNumber of following
influence_scorefloatInfluence score (0-100)
mentions_countintegerNumber of mentions by this author
sourcestringSocial media platform
created_atdatetimeFirst seen timestamp
updated_atdatetimeLast update timestamp

AuthorsResponse

Response containing a list of authors.
FieldTypeDescription
authorslist[Author]List of author objects
totalintegerTotal number of authors (may be more than returned)

AuthorStats

Statistics for a specific author (used in advanced analytics).
FieldTypeDescription
author_idstringAuthor ID
mentions_countintegerTotal mentions
reachintegerTotal reach
engagementintegerTotal engagement
sentiment_positiveintegerPositive mentions
sentiment_negativeintegerNegative mentions
sentiment_neutralintegerNeutral 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)

Build docs developers (and LLMs) love