How to Use Apps Script to Monitor Backlinks in Google Sheets

Use Google Apps Script to monitor backlinks by listing your links in Google Sheets, then running a script that fetches each linking page and checks the status code and anchor.
Quick answer: Use Google Apps Script to monitor backlinks by listing your links in Google Sheets, then running a script that fetches each linking page, checks the status code and whether your anchor is still there, and logs the result. A daily time trigger keeps the sheet fresh without any paid tool.
TL;DR: One sheet, one script, one daily trigger. The script fetches every linking page and writes the status, the anchor and the date into the sheet.
Key takeaways
- Apps Script is free and runs in Google's cloud, so the monitor works while your computer is off, with a daily trigger doing the fetching.
- The script checks six things per link: page status, link present, rel attribute, index status, redirects and anchor text, according to the Serpbays 2026 monitoring guide.
- Google allows 20,000 URL Fetch calls a day on a consumer account and 100,000 a day on Google Workspace, according to Google's quotas page verified in November 2026.
- Check paid links twice in the first week, then monthly, according to the Serpbays 2026 monitoring guide.
- Store API keys in Script Properties, never in the sheet or the code, because a shared sheet exposes anything written in a cell. A backlink monitoring tool is the paid alternative when the script is not enough.
What the script checks on every link
A backlink is only useful while the page is live, the link is present and the anchor still points at your page. A backlink monitor exists to catch exactly these failures. The Serpbays 2026 monitoring guide lists six checks: page status, link present, rel attribute, index status, redirects and anchor or target.
Page status is the first check. The script fetches the linking URL and reads the response code: 200 means live, 404 means gone, and 301 or 302 means the page moved. A moved page may still pass value, but the link is no longer where you bought it.
Link presence is the second check. The script searches the fetched HTML for your domain and confirms the anchor is still on the page. A page can return 200 while your link has been quietly removed.
The rel attribute is the third check. A link that changed from dofollow to nofollow or sponsored still sends traffic, but it no longer passes ranking credit in the same way. The script reads the anchor tag and logs the rel value it finds.
Index status, redirects and anchor text finish the list. A deindexed page passes little value, a redirect chain weakens the link, and a changed anchor can shift which keyword the link supports.
According to Google's quotas page, verified in November 2026, Apps Script allows 20,000 URL Fetch calls a day on a consumer account and 100,000 a day on Google Workspace, with 6 minutes per script execution. According to the Ahrefs link rot study, at least 66.5% of links to 2,062,173 sites had rotted since January 2013. Source: Google for Developers, Quotas for Google Services (2026); Ahrefs link rot study (2022, updated 2024).
Setting up the sheet and the script
Start with a sheet that has one row per link. Columns for the linking URL, the target page on your site, the expected anchor text, the price paid, the date the link went live and the last check date give you a full record to work from.
Open the script editor from Extensions, then Apps Script, and paste the monitor function there. The Google Sheets workflow is the base this script builds on. The function reads the URLs from the sheet, fetches each one with UrlFetchApp, and writes the status code, the anchor found and the date back into the row.
UrlFetchApp is the built-in HTTP client in Apps Script, and it is how the script calls outside pages and APIs. Each call returns the page content, which the script searches for your domain with a simple text match.
Add a menu item with an onOpen function so anyone on the team can run a check from the sheet without opening the editor. A custom menu keeps the tool usable by people who never see the code.
Test on ten links first. A backlink checker can confirm what the script finds, and a small test run shows whether the sheet layout and the code agree before you scale to hundreds of rows.
Adding an API feed for new and lost links
Fetching pages tells you whether known links are alive, but it cannot tell you about links you never logged. For that, add an API feed from a link index such as Ahrefs, which exposes backlink data through its API.
Ahrefs Lite costs $129 a month, according to the 2026 price checks cited in the Ahrefs API guides, and the free Ahrefs tier shows 1,000 backlinks and 5,000 crawl credits per project each month. The API itself runs on a credit system, so inefficient requests burn the monthly limit fast.
Store the API token as a Script Property, not in the code or the sheet. The script reads the token at runtime, builds the request with the target domain and a row limit, fetches the data with UrlFetchApp, and writes the new and lost links into a raw data tab.
Keep the raw data tab separate from the presentation tab. The API dumps JSON into the hidden tab, and formulas or a second function turn it into a clean list of gained and lost referring domains.
The Ahrefs API guide from Digital Culture Industry shows the pattern: a small function that takes a target and a metric, calls the API with the stored token, parses the JSON and returns one value to the sheet. That pattern scales to a full monitor.
Staying inside the Apps Script quotas
Apps Script is free, but it has daily per-user quotas, and Google may change them at any time without notice, according to Google's quotas page. Design the monitor around the numbers, not around hope.
A script can run for 6 minutes per execution on both consumer and Workspace accounts, according to Google's quotas page verified in November 2026. A run that fetches hundreds of slow pages will hit that wall, so split large lists into batches and process one batch per run.
Total trigger runtime is 90 minutes a day on a consumer account and 6 hours a day on Google Workspace, according to Google's quotas page. A daily trigger that runs for 10 minutes uses 10 of those 90 minutes, so keep the schedule to once a day, not once an hour.
URL Fetch calls are capped at 20,000 a day for consumer accounts and 100,000 a day for Workspace, according to Google's quotas page. A list of 500 links checked daily uses 500 calls, which is far under either cap, but a list of 5,000 links checked hourly would break the consumer limit in a day.
Each user can have up to 20 triggers per script, and each UrlFetchApp response is limited to 50 MB, according to Google's quotas page. Neither limit should trouble a link monitor, but both matter if you add alerts and reports to the same project.
| Check | How the script does it | What a fail means |
|---|---|---|
| Page status | UrlFetchApp reads the response code | 404 means the link is gone |
| Link present | Search the HTML for your domain | Page live, link removed |
| Rel attribute | Read the anchor tag | Changed to nofollow or sponsored |
| Redirects | Follow the response chain | Page moved, value weakened |
| Anchor text | Compare with the expected anchor | Wrong keyword now targeted |
| Index status | Check the page in Search Console | Deindexed page passes little value |
Turning the log into alerts
A log nobody reads is a chore, not a monitor. Add a daily summary that lists only the links that changed: new 404s, removed links, rel changes and anchor changes, with the date each change was first seen.
Send the summary by email with MailApp, which allows 100 recipients a day on a consumer account and 1,500 a day on Workspace, according to Google's quotas page verified in November 2026. One email to the team each morning is enough.
Colour the sheet with conditional formatting: green for live and correct, amber for a redirect or a rel change, red for a 404 or a removed link. A lost link check then takes a glance instead of an hour.
Act on red rows fast. A sudden wave of red rows can also signal negative SEO, so check the pattern before you blame one seller. A paid link that disappears inside its guarantee window is a refund or replacement claim, and the guarantee clock starts from the date the link went live, not the date you noticed it was gone.
Check paid links twice in the first week, then monthly, according to the Serpbays 2026 monitoring guide. That pace catches early removals while they are still inside the seller's guarantee.
Frequently Asked Questions
Is Google Apps Script free for backlink monitoring?
Yes. Apps Script costs nothing, and the quotas are generous for a monitor: 20,000 URL Fetch calls a day on a consumer account and 100,000 a day on Google Workspace, according to Google's quotas page verified in November 2026. You pay only if you add a paid API feed such as Ahrefs.
How many links can one script check?
Hundreds per run, if you batch them. A single execution runs for at most 6 minutes, according to Google's quotas page, so a list of 500 links is comfortable and a list of 5,000 needs batching across runs or days.
Does the script need an Ahrefs API key?
No. Page fetching with UrlFetchApp needs no key at all. You need a key only when you add an API feed for new and lost links, and the free Ahrefs tier shows 1,000 backlinks per project, according to Ahrefs.
Where should I store the API key?
In Script Properties, under Project Settings. Never paste a key into the code or a sheet cell, because anyone with access to the sheet can read it.
How often should the monitor run?
Daily for paid links in their first week, then weekly or monthly for the full list. Check paid links twice in the first week, then monthly, according to the Serpbays 2026 monitoring guide.
What happens when the script hits a quota?
It stops with an error such as "Service invoked too many times for one day: urlfetch." Quotas reset 24 hours after the first request, according to Google's quotas page, so the next run picks up where the last one stopped.
Expert verdict
Best for: teams tracking hundreds of paid links who want a free, always-on monitor inside a sheet they already use.
Not for: anyone who needs index data, authority scores or competitor tracking, which needs a paid link index such as Ahrefs.
Pros: free, automatic, and fully in your control; the log doubles as evidence for refund claims.
Cons: page fetching cannot find links you never logged, and the 6-minute execution limit forces batching on large lists.
Bottom line
List the links, fetch each page daily, log the status and anchor, and alert on changes. The script is small, the quotas are generous, and the log is what turns a dead link into a refund. Run a backlink check on any row the script flags before you open a dispute.
Sources
The BacklinkPrice Team researches backlink prices, publisher sites and link building tools. We check prices and plans against each provider's own pages and date them, so you know how current the numbers are.
More from BacklinkPrice TeamRelated guides





