Sub topic 4
Collecting competitor data responsibly
Earlier chapters fixed your goals, your competitor set, and your metric definitions. This chapter covers how to gather the numbers those definitions need. The aim is a dataset that is legitimate to collect, repeatable, and documented well enough that someone else could rebuild it.
This chapter assumes you have read the chapters on metric definitions and the competitor set. It also assumes you can read basic Python, since one example validates collected records.
Collect only what your metrics need
Collection starts from the metric definitions, not from what a tool happens to export. If your KPI is median engagement rate per post, you need these fields for every post:
- Account identifier and post identifier.
- Publication timestamp, stored in UTC.
- Public counts: likes, comments, shares, and views where visible.
- The account's follower count on the day you collect.
- The date and time of collection.
- The source of the data (which method or tool produced it).
Anything beyond this list needs a reason. Collecting less lowers your legal exposure, your storage burden, and your cleaning work.
Two fields are easy to forget and hard to recover later. The first is the collection timestamp. Counts keep growing after publication, so a number is only meaningful with its capture time. The second is follower count. Platforms show only the current value, so if you don't record it now, you can't compute an honest rate for an older post later.
What counts as responsible collection
Responsible collection has three tests. The method must be permitted by the platform's terms. The data must be public, or yours. And you must not collect personal information you have no need for.
Sources you can use
| Method | Good for | Main limits |
|---|---|---|
| Your own native analytics | Your reach, impressions, saves, demographics | Shows only your own account |
| Manual reading of public pages | Small competitor sets, spot checks, qualitative review | Slow, error-prone, hard to repeat at scale |
| Official platform APIs | Public posts and counts for pages, with documented rate limits | Access rules differ by platform, and some data needs approval or business verification |
| Licensed third-party benchmarking tools | Many accounts, historical trends, standard metrics | Cost, a fixed metric definition you must check, and some opacity about how data is gathered |
| Industry reports and published datasets | Context for sector-wide norms | Aggregated, often dated, and rarely matches your exact peer set |
For a set of five to ten competitors, a mix of manual capture and an official API or a reputable tool is usually enough. Automated tools save time, but you must confirm what each one counts. Two tools can report different engagement rates for the same account because they divide by different bases.
What to avoid
- Scraping against the terms of service. Many platforms prohibit automated page collection. Even where the data is visible to anyone, the terms still apply to how you gather it. Read the current terms and the API documentation before you build anything.
- Logging in to see more. Do not use fake accounts, borrowed credentials, or follow requests under a false identity to reach private or restricted content.
- Private or semi-private data. Private accounts, closed groups, and direct messages are out of scope.
- Personal data you don't need. A benchmark needs counts and post attributes. It does not need the names or profiles of the people who commented. If you do text analysis of comments, aggregate it and avoid storing usernames.
- Competitor internal data. Do not use leaked analytics, or data shared by someone who has no right to share it.
Choosing a method
The diagram shows a decision path. It starts with a question about the data and ends at a method you can defend.
Notice the last branch. Sometimes the right answer is to drop a metric. If views are hidden on a competitor's posts, comparing view-based rates across the set is not possible. Fall back to an engagement definition that uses only visible counts, and apply it to everyone.
Build a collection protocol
A protocol is a short written procedure. It makes your numbers comparable across weeks and across the people collecting them. Include these rules.
- Fixed post window. Decide which posts count, for example all feed posts published in the last 30 days, excluding paid placements you can identify.
- Fixed maturity age. Engagement accumulates, and most of it arrives in the first days. Only include posts that are at least a set age at collection, such as seven days. Otherwise a post from yesterday looks weak next to a post from two weeks ago, and you are comparing age, not performance.
- Same day, same time. Collect all accounts within a narrow window, ideally the same day. Follower counts and engagement drift over time.
- Same metric definition. Use the definitions you wrote in the metrics chapter. If a count is hidden, record it as missing. Do not record it as zero.
- Source log. For every collection run, note who collected, how, with which tool or API version, and any exceptions.
The maturity rule is the one most often skipped. A rule of seven days is a starting point. Check your own history to see when a typical post's engagement levels off, and set the threshold there.
Validate records as you collect
Catching problems at collection time is cheaper than discovering them in a chart. The script below defines a record, then checks it against the protocol: post age, hidden counts, follower count, and a recorded source. It needs Python 3.8 or later.
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
MIN_AGE_DAYS = 7
@dataclass
class PostRecord:
account: str
post_id: str
posted_at: str # ISO 8601, UTC
collected_at: str # ISO 8601, UTC
followers: int
likes: Optional[int] # None means "not visible", never 0
comments: Optional[int]
shares: Optional[int]
source: str
def check(record: PostRecord) -> list:
problems = []
posted = datetime.fromisoformat(record.posted_at)
collected = datetime.fromisoformat(record.collected_at)
age_days = (collected - posted).total_seconds() / 86400
if age_days < 0:
problems.append("collected before it was posted")
elif age_days < MIN_AGE_DAYS:
problems.append(f"post is only {age_days:.1f} days old")
if record.followers <= 0:
problems.append("follower count missing or zero")
for name in ("likes", "comments", "shares"):
if getattr(record, name) is None:
problems.append(f"{name} not visible")
if not record.source.strip():
problems.append("no source recorded")
return problems
records = [
PostRecord("rival_a", "p1", "2026-11-02T14:30:00+00:00",
"2026-11-20T09:00:00+00:00", 50000, 900, 60, 30, "official API"),
PostRecord("rival_a", "p2", "2026-11-18T10:00:00+00:00",
"2026-11-20T09:00:00+00:00", 50000, None, 40, 20, "manual capture"),
]
for r in records:
issues = check(r)
print(f"{r.account}/{r.post_id}:", "; ".join(issues) if issues else "ok")Running it prints rival_a/p1: ok and then rival_a/p2: post is only 2.0 days old; likes not visible. The second post should be excluded or collected again later, and the hidden likes count should be marked missing instead of being filled with a guess.
Using None for hidden values matters downstream. A zero would pull the median down and make a competitor look weaker than it is. A missing value can be excluded, and you can report how many were excluded.
Edge cases you will meet
- Hidden like counts. Some platforms let accounts hide likes. Compare on the metrics that stay visible, such as comments and shares, or exclude the account from like-based metrics and say so.
- Views and reach. Public view counts exist on video formats, but reach and impressions are private to the account owner. Do not estimate a competitor's reach as if it were observed. If you use a vendor's estimate, label it as an estimate.
- Stories and other temporary content. Content that expires cannot be captured later and has no public engagement counts. Exclude it from engagement benchmarks, or capture it deliberately and track it as a separate presence measure.
- Deleted and edited posts. A post may vanish between collection runs. Keep your earlier snapshot, and flag the deletion instead of overwriting the record.
- Time zones. Store publication times in UTC. Convert only when you analyze posting hours, and use the audience's local time then.
- Paid and boosted posts. Public counts mix organic and paid engagement, and you often cannot separate them. Flag posts labelled as partnerships or ads, and see the pitfalls chapter for how to handle them.
- Rate limits and API changes. APIs limit request volume and sometimes change fields. Log the API version, respect the limits, and expect to re-test your pipeline after platform updates.
- Follower counts that move. If you collect competitors on different days, a fast-growing account will have a different follower count in each run. Record the date next to every count.
Store and handle the data
Treat the benchmark dataset as a work product with an owner and a retention period. A few habits cover most needs:
- Store snapshots with the collection date in the file name, and never overwrite older ones. Trend analysis depends on the history.
- Keep a short README beside the data with the protocol, the metric definitions, and a list of known gaps.
- Limit access to the people who need it, even though the data is public. A compiled competitor dataset has commercial value.
- Remove or avoid personal data. If an export includes usernames or profile links of commenters, drop those columns before storing.
- Set a retention rule. For benchmarking, a rolling window of recent quarters is usually enough.
Check your own collection quality
Before moving to normalization, run a quick audit on every collection round:
- Did every account in the competitor set get collected in the same window?
- How many posts per account passed the maturity rule? Very few posts per account will make later medians unstable.
- How many counts were missing, and for which accounts?
- Is every record traceable to a source and a collection time?
- Did anything change since last round, such as a new tool version, a changed definition, or a renamed account?
Write the answers into your source log. These notes are what let you say, in a report, how reliable the numbers are.
Exercise
A competitor posted a video 36 hours ago, and its like count is hidden. Your protocol requires posts to be at least 7 days old and uses likes, comments, and shares. What should you do with this post, and how should the hidden count be stored?
Show answer
Exclude the post from this round because it is younger than the 7-day maturity rule, and collect it again once it is old enough if it falls inside your post window. Store the hidden like count as missing (None or an empty value), never as 0, and note in the source log that this account hides likes so you can decide whether to drop like-based metrics for it.
Exercise
Your teammate suggests using a personal account that follows a competitor's private account to copy its engagement numbers into the benchmark. Give two reasons to refuse, and name one acceptable alternative.
Show answer
The account is private, so its data is not public and accessing it through a personal login likely breaks the platform's terms and may be deceptive. The numbers would also not be comparable with the public data of the other accounts. An acceptable alternative is to remove that competitor from engagement metrics, or replace it with a comparable public account, and note the reason in the competitor-set documentation.