Track Competitor Backlinks Daily: Telegram & Slack SEO Bot
Telegram and Slack SEO Bots: Watching Your Competitors' Link Building Day by Day
A competitor picked up forty new referring domains last week. Eight of them were DR 50+, most pointed at one commercial page, and the dominant anchor was the exact money keyword you've been fighting for since spring. You found out three weeks later, when they passed you on that keyword and someone finally opened a backlink report to see why.
None of that information was hidden. It was sitting in Ahrefs and Semrush the whole time. The problem was that nobody looks at a competitor's backlink profile until something has already gone wrong, and by then you're reading history instead of watching it happen.
This article covers how to build a bot that does the watching for you: it pulls competitor link data from the Ahrefs and Semrush APIs every day, works out what actually changed, and posts the parts worth acting on into Telegram or Slack. It covers which events are worth tracking, which endpoints return them, what it costs at daily cadence, and how to design the messages so the channel doesn't get muted in a week. Sections marked [Technical] go into endpoints, parameters and unit math — skip them if you're not the one building it.
Who This Is For
Both Ahrefs and Semrush already have alerting built in. If their email alerts answer your questions, use them and skip this. A custom bot earns its keep in a narrower set of situations.
Worth building when:
- You work in a niche where links decide rankings — iGaming, affiliate, SaaS, finance, legal, or anywhere money keywords are bought rather than earned
- You buy or build links yourself and want to know where your competitors are getting theirs
- You're watching five or more competitors, which is where manual checking stops happening
- Decisions are made quickly — a link-building lead or a client who will act on a signal within days, not at the next quarterly review
- You want link data joined with something the tools don't have: your own outreach list, your link budget, your rankings history
Not worth it when:
- Your niche has few links and they barely change — a monthly look is genuinely enough
- Your competitor set has been the same three brands for years and none of them build links actively
- Nobody will act on the alerts — a bot nobody reads is just an API bill
- You don't have an API-enabled plan on at least one of the two tools (covered in the cost section)
Why Monthly Backlink Audits Miss Everything Important
A monthly backlink audit tells you the state of a profile. It shows that a competitor has 1,240 referring domains today, up from 1,180 last month. What it doesn't show is the shape of that change, and the shape is the useful part.
Sixty new domains spread evenly across a month is a site earning links in the normal course of business. Sixty new domains arriving in four days, all dofollow, all from sites with a suspiciously similar outbound link profile, all pointing at one page with a commercial anchor — that's a campaign. Same number, completely different meaning, and a month-end snapshot can't tell them apart.
There's a second thing the monthly view hides: timing relative to rankings. Links take time to show an effect. If you see a competitor's campaign start on day one, you have a window of weeks before it moves the SERP. If you see it when the SERP moves, the window has already closed.
And a third: losses. Paid links get removed when the payment stops. Guest posts get deleted when a site gets sold. A competitor who lost a cluster of strong links last week is weaker than their headline numbers suggest, and that's an opportunity you only see in a day-by-day view.
The signal is velocity, not volume. That's what the bot is for.
What the Bot Should Watch
Before any code, decide what counts as an event. Everything else in the design follows from this list.
New and Lost Referring Domains
The core signal. Track referring domains, not individual backlinks. A sitewide footer link can produce five hundred backlinks from one site, and if you alert on backlink counts, every sitewide becomes a false alarm. Domains are the unit that reflects actual link-building effort.
Lost domains matter as much as new ones. A strong domain disappearing from a competitor's profile is often the end of a paid placement, and it tells you something about how they build links.
Link Velocity Spikes
The rate of new referring domains against that competitor's own baseline. Twenty new domains in a week means nothing for a site that normally gets twenty-five. It means a lot for a site that normally gets three. Velocity has to be measured relative to each competitor's history, never as an absolute number.
Donors That Link to Competitors but Not to You
The link gap: domains linking to one or more competitors that don't link to you. This is the most directly actionable output of the whole system, because it's a ready-made prospect list. A domain that links to three of your competitors is either open to your niche editorially or selling placements — either way, it's worth a look.
Anchor Text Shifts
Anchors tell you what a competitor is trying to rank for. A sudden rise in exact-match commercial anchors pointing at one URL tells you which page they're pushing and for which query, often weeks before that page appears in your rank tracking.
Which Pages Are Receiving the Links
Link campaigns are almost always aimed at specific pages. Knowing that a competitor's new links are going to a page they launched last month, rather than to their homepage, tells you where they're trying to grow.
[Technical] Ahrefs API v3: Endpoints for Link Monitoring
All requests are GET with a Bearer token, against https://api.ahrefs.com/v3/. Pricing follows the same formula as every other Ahrefs endpoint — max(50, per_row_cost × rows) — and every field you touch in select, where or order_by adds to the per-row cost. Most fields cost 1 unit. The ones that cost more are the ones that will quietly blow your budget, and they're flagged below.
Referring Domains with History
GET /v3/site-explorer/refdomains is the workhorse endpoint for this whole system.
Required: target (domain or URL) and select. The parameters that matter for monitoring:
history—live,all_time(the default), orsince:YYYY-MM-DD. Withsince:, lost domains from that date onward are included in the result instead of silently disappearing. This is what makes lost-domain detection possible without keeping your own full history.mode—subdomains(default),domain,prefix, orexact. Usesubdomainsfor a competitor's whole site andexactwhen you're watching one money page.where,order_by,limit— filter onfirst_seento get only recent arrivals, sort by date or DR, and cap the rows. The limit is your cost control, since you pay per row.
The fields worth selecting:
| Field | What it tells you | Units |
|---|---|---|
domain, domain_rating |
Who links, and how strong they are | 1 each |
first_seen |
When Ahrefs first found a link from this domain to the target — the basis of "new" | 1 |
last_seen |
When the target lost its last live link from this domain. Null while the link is alive — the basis of "lost" | 1 |
links_to_target, dofollow_links |
How many links, and how many pass value. Separates a sitewide from an editorial link | 1 each |
new_links, lost_links |
Link movement from this domain in the selected period | 1 each |
is_spam |
Ahrefs' own flag for known spammy domains. Your first junk filter, for 1 unit | 1 |
dofollow_refdomains |
How well-linked the donor itself is | 5 |
traffic_domain |
The donor's estimated organic traffic — the best single test of whether a site is real | 10 |
A lean daily request selects domain, domain_rating, first_seen, last_seen, dofollow_links, links_to_target and is_spam — 7 units per row — with history=since: set to yesterday. Adding traffic_domain to that request more than doubles the per-row cost, which is why it belongs in the enrichment step, not in monitoring.
Individual Backlinks, Anchors and Lost Reasons
GET /v3/site-explorer/all-backlinks returns individual links rather than domains. You don't need it daily for every competitor — you need it when a new domain shows up and you want to know what kind of link it is.
aggregation—similar_links(default),1_per_domain, orall. Use1_per_domainfor monitoring; it gives one representative link per referring domain and keeps rows, and cost, down.anchor,url_from,url_to— the anchor text, the page it sits on, and which competitor page it points at.is_dofollow,is_sponsored,is_ugc,is_content— link attributes, and whether the link sits in the main content block. An in-content dofollow link on a page with three outbound links is a very different thing from a footer link.links_external— outbound links on the referring page. A page with 150 external links is a link farm, whatever its DR says.lost_reason— why a link was lost: removed from HTML, page now noindex, page redirected, not canonical, page error, and so on. "Removed from HTML" on a sponsored-looking page is the classic signature of an expired paid placement.discovered_status— whether the link is on a newly found page, newly found on a known page, or restored. Restored links are worth separating out; otherwise they read as new.
Watch the expensive fields here too: traffic and traffic_domain cost 10 units each, and the domain-level refdomain counts (refdomains_source, refdomains_source_domain, refdomains_target_domain) and class_c cost 5.
Velocity Baseline
GET /v3/site-explorer/refdomains-history returns the referring domain count over time, grouped by history_grouping — daily, weekly or monthly. Pull this once per competitor when you add them, with a few months of daily data, to establish what "normal" looks like. After that, your own stored daily counts maintain the baseline and you rarely need to call it again.
Access and Units
According to Ahrefs' help center, direct API v3 access is available on all paid plans from Lite upward, with additional units purchasable only on Enterprise — and new third-party applications require Enterprise. Monthly quotas run roughly 25,000 units on Lite, 150,000 on Standard, 500,000 on Advanced and 2,000,000 on Enterprise. Every response carries an x-api-units-cost-total header; log it from the first request. The unit formula is explained in more depth in our article on tracking volatile SERPs with the Ahrefs SERP Overview API.
[Technical] Semrush API: The Second Opinion
Semrush works differently enough from Ahrefs that it's worth understanding both before you decide how to use them together.
The Classic Endpoint and Its Quirks
The long-standing Semrush API is a single endpoint, https://api.semrush.com/analytics/v1/, where a type parameter selects the report. The backlink reports that matter here:
backlinks_overview— summary counts and Authority Score for a target. Priced per request rather than per line, which makes it a cheap daily health check.backlinks_refdomains— referring domains, with first and last seen dates. 40 units per line.backlinks— individual links, with source and target URL, anchor, nofollow, sitewide, and first/last seen. 40 units per line. Supports filters fornewlinkandlostlink, which give you new and lost links without diffing yourself.
Two practical warnings. First, responses come back as semicolon-separated CSV text, not JSON — a header line, then one line per row. Parse with sep=';' and handle the case where an error comes back as a plain text line like ERROR 132 :: API UNITS BALANCE IS ZERO instead of data. Second, set display_limit explicitly on every request. The default is small, but an integration that accidentally sends a very large limit will spend a lot of units on a single call.
The v4 Backlinks API Is Arriving
Semrush is moving backlink data to a new API at https://api.semrush.com/apis/v4/backlinks/v1/, with separate endpoints instead of a type parameter: /overview, /links, /ref-domains, /anchors, /pages, /competitors, and two that are directly useful here — /comparison for up to 10 targets at once and /matrix, a backlink gap report for up to 6 targets. It returns JSON by default, supports a proper filter expression language, and lets you pick fields with fields.
At the time of writing, v4 is in Early Access, billed at v3 rates, and its documentation states that the v3 backlink methods are deprecated. That combination has a clear engineering consequence: put the Semrush calls behind an adapter in your code, so that switching from v3 to v4 is a change in one module rather than a rewrite.
Access and Units
Semrush API access requires a Business subscription plus a separately purchased package of API units; a new Business plan starts with zero units. Check your balance with the free api_units request before each run — for per-line reports, Semrush returns only as many lines as your remaining balance covers, so running out mid-run gives you a silently truncated result rather than an error.
Ahrefs vs Semrush for Competitor Monitoring: Why Use Both
The two tools crawl the web independently, and their link indexes disagree. That's usually framed as a reason to pick the "better" one. For monitoring, it's more useful as a cross-check.
| Ahrefs API v3 | Semrush API | |
|---|---|---|
| Pricing model | Units per row, varies by which fields you select; 50-unit minimum per request | Fixed units per line for each report (40 for referring domains and backlinks) |
| Access | Paid plans from Lite, quota included in the plan | Business plan plus a separate API units package |
| Response format | JSON (CSV, XML optional) | Semicolon CSV on v3; JSON on v4 |
| New / lost detection | history=since: plus first_seen / last_seen, and a lost_reason per link |
newlink / lostlink filters on the backlinks report |
| Junk filtering | is_spam, is_content, links_external per link |
Authority Score, sitewide flag, toxicity data in the suite |
| Link gap | Build it yourself from referring domain lists | /matrix endpoint on v4 (Early Access), up to 6 targets |
| Best role in the bot | Daily primary feed — cheaper per row with lean columns | Weekly confirmation and gap analysis |
The design that falls out of this: Ahrefs as the daily feed, because lean refdomain requests are cheap per row and the JSON is easy to work with. Semrush as a weekly second opinion — confirming the week's significant new domains, and running the gap analysis.
The cross-check has a real payoff. A new referring domain that both indexes found is far more likely to be a real, live, meaningful link than one only one of them found. When the bot labels an alert "confirmed by both", the reader learns quickly to give those alerts more weight. That one label does more for trust in the channel than any amount of threshold tuning.
Turning Raw Data Into Signals
The APIs give you rows. The bot's actual job is reducing those rows to the three or four things a person needs to know today.
Daily Snapshots and Diff
Even though Ahrefs gives you first_seen and last_seen, store your own daily snapshot of each competitor's new and lost domains. There are two reasons. Index dates get revised — a domain can appear, disappear on recrawl and reappear, and without your own record you'll alert on it three times. And your own history is what lets you calculate velocity against a baseline, compare this week to last, and answer "when did this campaign actually start?" months later without buying the data again.
The diff itself is simple: domains in today's set that weren't in any previous snapshot are new; domains whose last_seen moved from null to a date are lost. Everything else is unchanged, and unchanged is never an alert.
Filtering Junk Links
This is the step that decides whether the bot survives. An unfiltered stream of new referring domains for any active site is dominated by scrapers, auto-generated directories, stats sites and spam. If those reach the channel, the channel dies.
A filter that works as a starting point:
- Drop anything with
is_spam = true - Drop domains with zero dofollow links to the target
- Drop domains below a DR floor that suits your niche — often 15 to 20
- Collapse sitewides: a domain with hundreds of links to the target counts once, and is labelled as a sitewide
- Keep a blocklist of known scraper and SEO-stats domains, and add to it every time one slips through
Expect the filter to remove the majority of raw new domains. That's the point.
Scoring a Donor
What survives the filter still needs ranking. A simple additive score is enough:
- Strength — DR, weighted
- Reality — real organic traffic (
traffic_domain, pulled only at this enrichment step). A DR 60 site with no traffic is usually a link seller, not a publication - Placement — in-content and dofollow versus footer or sidebar, and the number of other external links on the page
- Overlap — how many of your competitors this domain links to. One competitor is an editorial choice. Three or more in the same month is a marketplace
- Confirmation — found by both Ahrefs and Semrush
- Target value — whether the link points at a page that competes with one of yours
The score doesn't need to be clever. It needs to be consistent, so that the top of the list each morning is reliably the stuff worth reading.
Message Design: What a Good Alert Looks Like
Everything up to here is data engineering. This section decides whether a human acts on any of it.
Daily Digest vs Instant Alert
Two kinds of message, never mixed.
Instant alerts are for events that justify interrupting someone: a velocity spike well above a competitor's baseline, a burst of strong links to a page that competes directly with one of yours, or a major loss on a competitor's key page. These should be rare — a few a week, not a few a day.
The daily digest carries everything else: one message per morning, grouped by competitor, top-scored donors first, with counts for the rest. People skim it with their coffee, and that's exactly the right level of attention for most of this data.
Message Templates
The message should carry the conclusion, not the data. Compare:
- "competitor.com: +23 refdomains" — a number; someone has to go and investigate before it means anything
- "competitor.com: +23 referring domains this week (normal: ~5). 8 are DR 50+, 6 confirmed by both Ahrefs and Semrush. 17 point to /best-casino-bonuses/. Top anchor: 'best casino bonuses'. Started Tuesday." — a conclusion; someone can decide what to do from the message alone
A useful digest structure, per competitor:
- Headline line: net change in referring domains and how it compares to their normal week
- Top three new donors with DR, traffic, and whether they also link to other competitors
- The page receiving most of the new links, and the dominant anchor
- Notable losses, with the reason if Ahrefs gives one
- A link to the full list in the dashboard or sheet
Bot Commands
A bot that only posts is half a tool. Adding a few commands turns it into something people query when they need it, which is often the moment they need it most:
/competitor competitor.com— this competitor's last seven days in one message/gap— the current top domains that link to competitors but not to you/donor site.com— which of your competitors this domain links to, and since when/week— the weekly summary across all competitors, on demand/mute competitor.com 7d— silence one competitor temporarily without touching the config
Commands should read only from your stored data, never trigger fresh API calls. Otherwise a curious teammate typing /gap ten times in an afternoon spends your monthly quota.
Setting Thresholds So the Bot Doesn't Get Muted
The single most common way these projects fail is noise. Once a channel is muted, the bot is dead, and you're still paying for the units.
- Use relative thresholds. Alert when velocity exceeds a multiple of the competitor's own baseline, not when it crosses a fixed number.
- Require persistence for spikes. A one-day jump can be an index refresh. Two or three days of elevated velocity is a campaign.
- Alert on pages that matter to you. A burst of links to a competitor's blog post about company news is not your problem. A burst to their page that targets your money keyword is.
- Cap instant alerts. A hard limit — say three a day — forces the scoring to do its job. If you hit the cap constantly, the thresholds are wrong.
- Review weekly at first. For the first month, look at which alerts led to an action. Raise the thresholds on everything that didn't.
Telegram vs Slack: Delivery Differences
Both are easy to post to from a script. The differences are in who's reading and what the limits are.
| Telegram | Slack | |
|---|---|---|
| Typical reader | Freelancers, small teams, link builders, affiliate site owners | Agencies and in-house teams already working in Slack |
| Setup | A bot token from @BotFather and a chat ID | A Slack app with a bot token, or an incoming webhook for a single channel |
| Posting limits | About one message per second per chat; no more than 20 messages per minute to a group | About one message per second per channel |
| Message size | 4,096 characters per text message | Up to 50 Block Kit blocks per message |
| Formatting | HTML or Markdown, inline buttons | Block Kit sections, buttons, threads |
| Strongest feature here | Instant mobile notifications; trivially easy for a client to join | Threads — post the digest, put each competitor's detail in a thread under it |
The practical consequences: on Telegram, a digest for ten active competitors will exceed 4,096 characters, so split it into one message per competitor, sent with a pause between them to stay inside the group limit. On Slack, the thread pattern is the right default — one short summary in the channel, details in the thread — because it keeps the channel scannable while everything stays one click away.
Either way, queue your outgoing messages and send them sequentially. Both platforms return HTTP 429 when you go over the limit, and a digest that half-arrives is worse than one that arrives a minute late.
From Alert to Action: The Link Gap Workflow
Alerts only matter if they end in a decision. The workflow that tends to stick:
- A donor appears in the digest with a high score — strong, real traffic, linking to two of your competitors this month.
- Someone reviews it — is the link editorial, a guest post, or a clearly paid placement? Is the site relevant to you?
- It goes into a prospect list — a sheet or a CRM table with the domain, the competitor links it carries, the date found, and a status.
- Outreach or purchase happens through whatever process you already use.
- The bot closes the loop — when that domain starts linking to you, the next digest says so, and the prospect is marked won.
That last step is easy to skip and worth building. It turns the bot from a surveillance tool into a measure of how well your own link building converts competitor intelligence into links.
A note on what you do with this data.
Everything in this article uses data from commercial link indexes that their providers sell for exactly this kind of competitive research. Watching where competitors get links is standard practice.
What the data won't do is make a link scheme safe. If the gap list leads you to the same paid-placement networks your competitors use, you take on the same risk they do under Google's spam policies on link schemes. The bot tells you what competitors are doing. Whether to copy it is a separate decision, and some of the most useful alerts are the ones that show you a competitor building links you'd never want.
[Technical] The Pipeline
- Define the competitor set in a config table: domain,
mode(whole site or specific money pages), and which of your own pages each one competes with. - Build the baseline once per competitor from
/v3/site-explorer/refdomains-historywith daily grouping, and store it. - Run the daily Ahrefs pull:
/v3/site-explorer/refdomainsper competitor, leanselect,history=since:yesterday, filtered to recently seen or recently lost domains, with a cappedlimit. - Store the raw responses with a run timestamp. Store raw, transform later — you'll change the scoring many times and won't want to re-buy the data.
- Normalize domains: lowercase, strip
www., collapse subdomains where it makes sense. Without this, the same donor shows up as three different new domains. - Diff against stored snapshots to produce genuinely new and lost domains, ignoring restored ones you've already seen.
- Filter junk with
is_spam, the dofollow check, the DR floor, sitewide collapse and the blocklist. - Enrich the survivors only:
/v3/site-explorer/all-backlinkswithaggregation=1_per_domainfor anchor, target URL, placement and lost reason, andtraffic_domainwhere the score needs it. - Run the weekly Semrush pass through an adapter module: confirm the week's significant new domains and refresh the gap analysis. Check the unit balance first.
- Score, apply alert rules, and format the digest and any instant alerts.
- Queue and send to Telegram or Slack, respecting the per-chat and per-channel limits.
- Log units consumed on both providers per run, and alert yourself — in the same bot — when the month's consumption is ahead of plan.
Python handles every step with ordinary tools: httpx or requests for the APIs, Postgres or even SQLite for snapshots, pandas for the Semrush CSV, and a scheduler — cron, Celery beat, or a hosted scheduler — to run it each morning before the team starts work.
What This Costs
The two providers price so differently that it's worth working through both.
Ahrefs, daily. The lean refdomains request costs 7 units per row. A competitor with a typical daily movement of 15 new or lost domains returns 15 rows — 105 units, above the 50-unit minimum. A quiet competitor with five rows still costs the 50-unit minimum. Add enrichment for a handful of high-scoring new domains each day, and a weekly anchor pull.
| Setup (Ahrefs, daily, lean) | Per day | Monthly, with enrichment | Minimum plan |
|---|---|---|---|
| 5 competitors, ~15 rows each | ~525 | ~20,000 | Lite (tight) |
| 10 competitors, ~30 rows each | ~2,100 | ~75,000 | Standard |
| 20 competitors, ~30 rows each | ~4,200 | ~145,000 | Standard (at the limit) or Advanced |
20 competitors with traffic_domain on every row |
~10,200 | ~320,000 | Advanced |
The last row is the lesson. One expensive field, selected out of habit on every row, more than doubles the bill. Expensive fields belong in enrichment, on the few domains that survived the filter.
Semrush, weekly. At 40 units per line for referring domains and backlinks, Semrush is much more expensive per row than a lean Ahrefs request, which is why it plays the weekly role. Confirming 50 significant new domains per competitor per week across 10 competitors is 500 lines — 20,000 units a week, roughly 85,000 a month. Running the same thing daily would multiply that by seven. The gap matrix adds more, priced per line returned, so limit it to your top competitors and cap the lines.
Everything else is close to free. The Telegram Bot API and Slack's messaging API have no per-message fees. A small VPS or a scheduled cloud function covers the compute, and a modest Postgres instance holds years of snapshots for dozens of competitors.
The figures above are estimates built from published unit rates and typical movement. Real consumption depends on how active your competitors are, so log the actual units on the first week of runs and adjust before committing to a plan.
Honest Limitations
Index dates are discovery dates. first_seen is when Ahrefs found the link, not when it was placed. New links typically appear in the index days or weeks after they go live, and the lag varies by how often the referring site gets crawled. The bot sees campaigns early compared to a monthly audit — but not on the day they start.
Neither index sees everything. Both tools miss links, and they miss different ones. Cross-checking improves confidence but doesn't make the picture complete. Sites that block SEO crawlers won't appear at all — and some link networks block them deliberately for exactly this reason.
It can't tell you a link was bought. Patterns suggest it: an overlapping donor set, commercial anchors, sudden bursts, links lost when a placement period ends. But the data shows that a link exists, not what it cost. Treat "probably paid" as a hypothesis, not a fact, especially in anything you put in front of a client.
Not every spike is a campaign. A viral post, a PR mention, a product launch or a news story all produce link bursts that look like a campaign in the numbers. The anchors and target pages usually tell them apart, but someone still has to look.
The API surface is moving. Semrush's backlink API is mid-migration to v4, and pricing and endpoints in Early Access can change. Ahrefs adjusts field costs and plan quotas periodically. Re-check the documentation before relying on any number in this article, and build so that a change in one provider means a change in one module.
Conclusion
Every serious competitor in a link-driven niche leaves a trail in the link indexes. The trail is visible to anyone with an API key; what separates the teams that use it from the teams that don't is whether anyone looks at it while it's still fresh.
A bot fixes the looking. It reads the indexes every morning, throws away the junk, works out which changes matter, and puts the few that do in front of people where they already are. The data was always there — the bot just moves it from a report nobody opens into a message somebody reads.
Start small: five competitors, Ahrefs only, a daily digest in one Telegram chat or Slack channel. Add Semrush as the weekly second opinion once you trust the pipeline, and add instant alerts only after you've learned which digest items you actually act on. Most teams find that number is smaller than they expected, and that knowing it is half the value.
Further Reading (Sources & Documentation)
Ahrefs API documentation
- Site Explorer — Referring domains
- Site Explorer — All backlinks
- Site Explorer — Referring domains history
- Site Explorer — Anchors
- Limits consumption — how units are calculated
- Ahrefs Help — About API v3 (plan access)
Semrush API documentation
Messaging platforms
- Telegram Bot API
- Telegram Bots FAQ — sending limits
- Slack — chat.postMessage
- Slack — Web API rate limits
Google policy