Affiliwatch Get Affiliwatch

Amazon affiliate link checker for Next.js, Astro, Hugo and static sites

Most link checkers assume WordPress. This one reads your project files or your live site, gives the file and line of every broken Amazon link, and runs itself on GitHub every day.

The any-website report: a product that needs attention, the file and line it is used in, two possible replacements, and links that may be earning nothing.
The report lists the file and line of every problem.

How it works

Copy one folder into your project and run three commands. Affiliwatch reads your source files (Markdown, MDX, JSX, TSX, HTML, JSON data files and more), finds every Amazon link and product ID, and checks them with Amazon's Creators API.

node affiliwatch/bin/affiliwatch.js init
node affiliwatch/bin/affiliwatch.js test
node affiliwatch/bin/affiliwatch.js check

The report opens in your browser and shows every problem with its file and line, so you can jump straight to it in your editor.

Three ways to read your site

ModeReadsBest for
sourceYour project filesContent in Markdown, MDX or JSON data files
siteYour published pages, through the sitemapLinks built at run time, CMS-driven sites
bothBothThe most complete picture

In site mode it also follows your own redirect links, such as /go/kettle, to the Amazon product behind them.

Runs every day on GitHub, for free

init writes a GitHub Actions workflow. Add your Amazon keys and licence key as repository secrets, push, and it runs every day.

  • When something new breaks, it opens one GitHub issue titled "[Affiliwatch] …" and mentions you, so GitHub emails you.
  • Later news is added to the same issue. When everything is fixed, it closes the issue.
  • It never commits to your repository, so it never triggers a deploy.
  • Slack, Discord and email through Resend are optional.

Swap a product in your files

node affiliwatch/bin/affiliwatch.js replace B0OLDASIN01 B0NEWASIN02
node affiliwatch/bin/affiliwatch.js replace B0OLDASIN01 B0NEWASIN02 --write

The first command shows every line that would change and writes nothing. The second applies it and keeps your tracking ID. Review with git diff before you commit.

Requirements

  • Node.js 18 or newer
  • A GitHub repository for the daily run (optional)
  • An Amazon Associates tracking ID, and Creators API keys for stock checks

See plans, from $49

Questions people ask

Does it need npm packages?
No. It is one folder of plain JavaScript that runs on Node.js 18 or newer. Nothing is installed from npm, so there is nothing to update or audit.
Will the daily run trigger a deploy on Vercel or Netlify?
No. The run never commits to your repository. It keeps its memory in the GitHub Actions cache and reports through one GitHub issue.
My product links are built in code at run time. Can it check them?
Links assembled at run time can't be read from the files, so the tool counts them and skips them. Set "mode": "both" with your sitemap and it checks them on the published pages too.
Does it work with private repositories?
Yes. GitHub Actions minutes for private repositories come from your account's monthly allowance; a daily check of a typical site takes a minute or two.