How to Build a Competitor Tweet Tracker

A competitor tweet tracker collects each rival account's posts on a schedule, stores them with their likes, reposts and replies, and reports how often each competitor posts, what performs best and how their audience grows.

Cover card reading 'How to Build a Competitor Tweet Tracker'

A competitor tweet tracker collects each rival account’s posts on a schedule, stores them with their likes, reposts and replies, and reports how often each competitor posts, what performs best and how their audience grows. With apidojo’s actors on Apify, the posts come from a from: query per competitor and the follower counts from Twitter User Scraper.

This guide builds the tracker: the accounts and queries, the collection schedule, the metrics and a weekly report. Recurring collection follows the pattern in how to monitor a keyword on X with an API.

What Should a Competitor Tweet Tracker Measure?

Track 6 metrics per competitor: posting volume, engagement per post, top posts, content format, topics and follower growth. The table shows where each comes from.

Metric Calculated from
Posts per week Count of posts by createdAt week
Average engagement per post Mean of likeCount + retweetCount + replyCount
Top posts Posts ranked by likes within the week
Content format Share of posts with media, links or threads
Topics Most frequent words and hashtags in text
Follower growth followers from weekly profile snapshots

How Do You Collect Competitors’ Posts?

Collect each competitor’s original posts with one from: query per account, excluding replies and reposts so the data reflects what they publish. A daily run with a 2-day window, deduplicated on post ID, never misses a post (twitter-advanced-search reference).

import os
from apify_client import ApifyClient

COMPETITORS = ["competitor1", "competitor2", "competitor3"]
client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("apidojo/twitter-scraper-lite").call(run_input={
    "searchTerms": [f"from:{h} -filter:replies -filter:retweets within_time:2d" for h in COMPETITORS],
    "includeSearchTerms": True,
    "sort": "Latest",
})
posts = {t["id"]: t for t in client.dataset(run.default_dataset_id).iterate_items()}

Twitter Scraper Unlimited suits daily runs because it allows repeated queries; a batch of up to 5 queries gets the lowest per-item price, $0.0004 (Apify). For a one-time backfill of each competitor’s full history, use Tweet Scraper V2 with date windows, as in how to scrape tweets from a user profile.

How Do You Track Competitors’ Follower Growth?

Take a weekly profile snapshot with apidojo’s Twitter User Scraper and store each account’s followers and following counts with the date. Put the handles in twitterHandles (Apify).

{
  "twitterHandles": ["competitor1", "competitor2", "competitor3"],
  "getFollowers": false,
  "getFollowing": false
}

How Do You Turn the Data Into a Weekly Report?

Load the stored posts into pandas, group them by competitor and week, and compute the metrics from the table above.

import pandas as pd

df = pd.json_normalize(list(posts.values()))
df["created"] = pd.to_datetime(df["createdAt"], format="%a %b %d %H:%M:%S %z %Y")
df["week"] = df["created"].dt.to_period("W")
df["engagement"] = df["likeCount"] + df["retweetCount"] + df["replyCount"]

report = df.groupby(["author.userName", "week"]).agg(
    posts=("id", "count"),
    avg_engagement=("engagement", "mean"),
    best_post=("likeCount", "max"),
)
print(report)

The createdAt format is explained in how to collect tweets with Python.

What Does a Competitor Tracker Cost?

A daily tracker for 3 competitors costs about $1.44 over 30 days in query fees, because each of the 3 daily queries costs $0.016 and includes about 40 posts. Most brand accounts post fewer than 40 times in 2 days, so the per-item fee rarely applies (Apify).

Questions people ask

Can you track what people say about competitors?

Yes, run mention queries for their handles too; see how to build a Twitter mention monitor.

Can you track a competitor's replies to customers?

Yes, add from:competitor filter:replies -to:competitor as a separate query.

Where do you start?

At the apidojo Twitter Scraper.