Skip to main content

How to Analyze Competitors on Twitter Using the API

This guide describes a complete workflow for analyzing competitors on X (formerly Twitter) using Sorsa API: profile benchmarking, content strategy decomposition, audience composition, public sentiment, and share of voice. Each phase maps to a specific endpoint, and the phases compose into a single weekly report you can run on a schedule. All examples use Python 3.8+ with requests. Replace YOUR_API_KEY with your actual key in every snippet. The complete consolidated script with all helper functions is at the bottom of this page.
Free to start: Every endpoint in this guide works on your first 100 requests: one-time, no credit card, no expiry. That is enough to trial the full workflow at shallow depth before choosing a plan.
Note: For a narrative walkthrough with strategy context and worked examples, see Twitter Competitor Analysis: A Developer’s Guide on the blog.
No-code option: For ad-hoc side-by-side comparison without writing code, use the Profile Comparison Tool. It returns followers, engagement rate, average likes and retweets per tweet, posting frequency, and account age for any two handles. The Engagement Calculator covers per-tweet engagement-rate math for a single account.

Setup

The ApiKey header authenticates every request. See Authentication for details.

Phase 1: Profile Benchmarking

Endpoints: GET /v3/info, GET /v3/info-batch Establish the baseline: follower count, tweet volume, account age, bio, verified status. Use /info-batch to fetch up to 100 profiles in a single request, which counts as one request against your quota.

Snapshot script

Tracking growth over time

A single snapshot has no analytical value. Log snapshots on a daily or weekly schedule (cron, GitHub Actions, etc.) and compute deltas:
The growth formula:

Bio and positioning changes

/info returns description, location, bio_urls, and created_at. Diff these across snapshots to detect positioning shifts (bio changes, link destination changes) at zero additional cost.

Phase 2: Content Strategy

Endpoints: POST /v3/user-tweets, POST /v3/search-tweets Pull a competitor’s recent tweets and decompose their content mix: original posts vs. replies vs. quotes vs. retweets, average engagement, top-performing posts.

Fetching recent tweets

/user-tweets returns up to 20 tweets per page. Unlike the official X API’s timeline endpoints, it is not hard-capped at 3,200 tweets, so you can paginate deeper into an account’s history. For retrieval far back in time, /search-tweets with since:/until: operators (see below) is the more reliable approach.

Decomposing the content mix

Note that these categories overlap (a tweet with media is also an original post), so the percentages are independent shares rather than a partition that sums to 100.

Historical comparison

To compare two time windows for the same account (e.g., Q1 vs Q4), switch from /user-tweets to /search-tweets and use the since: and until: operators. See Search Operators for the full syntax and Historical Data for backfill patterns.

Phase 3: Audience Composition

Endpoints: GET /v3/followers, GET /v3/verified-followers, GET /v3/followers-stats A competitor’s follower list reveals who their audience is. There are two approaches with different cost profiles.

Verified followers (low cost)

/verified-followers returns only verified accounts following a handle. This is the highest-signal slice of any audience and is dramatically cheaper than pulling the full follower graph.
Diff verified-follower lists across snapshots to detect new high-authority followers per competitor. Journalist follow events often precede coverage by 2-4 weeks.

Full follower extraction (high cost)

/followers returns up to 200 profiles per page. For an account with 1M followers, full extraction is roughly 5,000 requests. Plan accordingly: see Pricing for plan limits and Optimizing API Usage for batch and budget patterns.

Audience overlap

Once you have follower lists for two accounts, compute overlap with set intersection on user IDs:
For a deeper dive on follower extraction patterns, see Followers and Following.

Crypto and Web3 follower breakdown

For accounts in Sorsa’s crypto database, /followers-stats returns a categorical breakdown: influencers, projects, VCs. See Sorsa Score and Crypto Analytics for context.
Counts only include accounts already tracked in the Sorsa crypto database.

Phase 4: Public Sentiment and Mentions

Endpoint: POST /v3/mentions /mentions supports filtering by minimum likes, retweets, replies, and date ranges. Filtering by min_likes cuts low-signal noise (bot replies, auto-tags) from the mention stream. See Track Mentions for the full filter set.

Pulling high-engagement mentions

Sentiment classification with VADER

VADER is an open-source sentiment library tuned for social media text. It runs locally with no per-call cost and handles negation, intensifiers, and emoji reasonably well.
For higher accuracy on sarcasm, technical complaints, or mixed sentiment, pipe full_text into an LLM API (OpenAI, Anthropic). A hybrid approach (VADER for filtering, LLM only on flagged or high-engagement mentions) keeps cost predictable.

Phase 5: Share of Voice

Share of voice (SOV) measures one brand’s mention volume against the category total. The formula:
Implementation:
Notes:
  • Filter by minimum engagement (min_likes=5 is a reasonable floor) to exclude bot and spam noise.
  • Track week-over-week deltas, not absolute snapshots. Category-level events skew absolute numbers in ways that obscure your own movement.
  • To compute category-keyword SOV (e.g., “embedded finance” rather than brand mentions), replace /mentions with /search-tweets and use the keyword as the denominator query.

Consolidated Weekly Report Script

This script combines all five phases. Drop it into a cron job, GitHub Actions schedule, or any task runner.
At the default page depths in this script, a full run for three competitors is on the order of 100 requests (a little more for very active brands where mention pagination runs deeper, a little less otherwise). Run weekly, that is a few hundred requests a month, well inside the Starter plan (10,000 requests per month). The free 100 requests are enough to try the workflow first at shallow depth, on one or two competitors, before choosing a plan. See Pricing for plan details.

Next Steps