# Travel Affiliate Link Checker: Booking, GYG, Viator, Klook IDs (`best_celerytop/travel-affiliate-link-checker`) Actor

Affiliate link audit for travel blogs. Crawls your site and lists every Booking.com, GetYourGuide, Viator, Klook, 12Go, Stay22, Travelpayouts, Agoda, Trip.com and Amazon link with its affiliate ID: links without an ID, links with someone else's ID, broken links, missing rel=sponsored.

- **URL**: https://apify.com/best_celerytop/travel-affiliate-link-checker.md
- **Developed by:** [Konstantin Semin](https://apify.com/best_celerytop) (community)
- **Categories:** SEO tools, Marketing, Travel
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 affiliate link founds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Travel Affiliate Link Checker: Booking, GetYourGuide, Viator, Klook, 12Go, Stay22, Travelpayouts

Give it your travel blog. It reads every page from your sitemap, finds every affiliate link and widget, and tells you which affiliate ID each one carries and whether it still works. One row per distinct link, sorted so the problems come first.

**What it catches**

- **Links without an affiliate ID**: a Booking.com, GetYourGuide, Viator, Klook, 12Go, Agoda, Trip.com, Discover Cars or Amazon link that earns you nothing (`idStatus = unmonetized`).
- **Links with someone else's ID**: a VA, an old theme or a copied snippet left a foreign `aid`, `partner_id`, `pid` or `tag` in your posts. Give your own IDs and such links are marked `foreign ID`. Without your IDs, the summary still shows which IDs appear on the site and how many times, so a stray one stands out.
- **Broken links**: 404s, expired `amzn.to` short links, deep links that now land on the network's front page because the hotel or tour is gone.
- **Links without `rel="sponsored"` or `rel="nofollow"`**, which Google and the FTC expect on affiliate links.
- **Hidden placements**: GetYourGuide and Viator widgets, Klook iframes, Stay22 "Let Me Allez" and map scripts, Travelpayouts widgets, cloaked links such as `/go/booking-hanoi`, and links behind `amzn.to`, `bit.ly` and other shorteners are all resolved and attributed to their network.

**Pricing**: a few thousandths of a dollar per affiliate link found. Pages are free, so a 500-post blog with 1,200 affiliate links costs about $1.20 to audit.

### Networks and how their IDs look

| Network | Affiliate ID parameter | Also read |
|---|---|---|
| Booking.com | `aid` | `label` |
| GetYourGuide | `partner_id` (links, widgets, `data-gyg-partner-id`) | `cmp` |
| Viator | `pid` (links, widgets, `data-vi-partner-id`) | `mcid`, `medium`, `campaign` |
| Klook | `aid` (links, redirect links, widget iframes) | `aff_adid`, `aff_label`, `k_site` |
| 12Go | `z` | `sub_id` |
| Agoda | `cid` | `tag` |
| Trip.com | `Allianceid` | `SID`, `ouid` |
| Discover Cars | `a_aid` | `a_bid`, `a_cid` |
| Amazon | `tag` (also behind `amzn.to`) | |
| Stay22 | `aid` in Allez links and maps, the ID in short links (`booking.stay22.com/<id>/...`), the `lmaID` of the Let Me Allez script | `campaign`; the merchant (`allez/booking`, `allez/getyourguide`...) |
| Travelpayouts | `marker` in `tp.media`, `travelpayouts.com`, widgets, Aviasales and Hotellook links | `trs`, `p`; the merchant from the `u=` parameter |

Outbound links to any other site are counted and, if you turn on **Also list other outbound links**, listed with `network = other`. That is how you find the hotel and tour sites you link to for free.

### Input

| Field | Meaning |
|---|---|
| `startUrls` | Your blog, as a domain or URL. Several sites are scanned one after another. Single article URLs work too. |
| `scanWholeSite` | On (default): pages come from your sitemap (`sitemap.xml`, Yoast `sitemap_index.xml`, `wp-sitemap.xml`...). Without a sitemap the site is crawled from the start page. Off: only the given URLs are read. |
| `maxPages` | Page limit per site, default 300, up to 5,000. |
| `myAffiliateIds` | Optional. `booking=1234567`, `getyourguide=ABC123`, `viator=P00012345`, `klook=12345`, `12go=7654321`, `stay22=5f1a...`, `travelpayouts=123456`, `amazon=yourtag-20`. A bare ID is matched against every network. |
| `checkDestinations` | On (default): every affiliate link is opened once to see whether it still works. |
| `includeOtherOutbound` | Adds rows for outbound links of unknown networks. |
| `respectRobotsTxt` | Skips pages your `robots.txt` closes to crawlers. |

### Output

One row per distinct link or widget:

```json
{
  "site": "myblog.com",
  "url": "https://www.getyourguide.com/hanoi-l220/street-food-tour-t12345/?partner_id=ABC123",
  "network": "GetYourGuide",
  "affiliateId": "ABC123",
  "idStatus": "monetized",
  "linkStatus": "ok",
  "placement": "link",
  "via": null,
  "merchant": null,
  "subIds": { "cmp": "hanoi-post" },
  "anchorText": "Book the street food tour",
  "rel": "nofollow sponsored",
  "relSponsoredOrNofollow": true,
  "foundOnPages": 3,
  "pageUrl": "https://myblog.com/hanoi-food-guide/",
  "morePages": ["https://myblog.com/vietnam-itinerary/", "https://myblog.com/hanoi-in-2-days/"],
  "finalUrl": null,
  "httpStatus": 200,
  "redirects": 0,
  "note": null,
  "idDroppedOnRedirect": false
}
```

- `idStatus`: `monetized`, `unmonetized` (known network, no ID), `foreign ID` (an ID that is not in `myAffiliateIds`), or `auto-monetized by Stay22 script` (a plain Booking.com, Agoda, Trip.com... link on a page that loads Stay22's Let Me Allez script, which adds your ID when the reader clicks).
- `linkStatus`: `ok`, `broken` (404, 410, "not available" page), `redirected to home` (deep link now lands on the front page), `not verified` (the network refuses automated checks, as Amazon and GetYourGuide do; the link resolves but the page was not opened), `error`, `timeout`, or `not checked` for widgets and wrapper links, which always answer.
- `placement`: `link`, `cloaked link` (your own `/go/...` redirect), `shortener`, `script widget`, `iframe widget`, `widget`.
- `via`: `cloaked link` or `shortener` when the affiliate link was found behind a redirect.
- `merchant`: for Stay22 and Travelpayouts, where the wrapper finally sends the reader.

The key-value store record `SUMMARY` has the totals: pages read, links per network, every affiliate ID with how often it appears, and counts of unmonetized, foreign-ID, broken and un-tagged links. The same summary is printed at the end of the run log.

### Good to know

- The checker identifies itself as `TravelAffiliateLinkChecker` and follows your `robots.txt`. If your firewall or security plugin answers 403 to unknown bots, the run reports "the site refused every request"; allow that user agent and run again.
- Some networks (Amazon and GetYourGuide in particular) refuse automated requests. Their links are reported as `not verified`, not as broken, and the affiliate ID is still read from the URL. A short link such as `amzn.to/...` that resolves to Amazon is still checked for being dead (404).
- Affiliate IDs are read from the URL as written in your HTML. Links that get their ID from JavaScript after the page loads (some auto-linking scripts) show up as the script itself, with the ID taken from the script address.
- Revenue is not part of this Actor: the networks do not expose earnings without your login. This is a link audit.
- **Price.** $1 per 1,000 affiliate links found, no start fee; pages read and links that turn out not to be affiliate links are free.
- **Works with n8n, Make, Zapier and AI agents.** The official Apify node for n8n runs this Actor and returns the rows inside a workflow, Make and Zapier use the Apify integration, and AI agents call it as a tool through the Apify MCP server.

### FAQ

**How do I find affiliate links without my ID on my blog?**
Run this Actor on your blog and filter the results by `idStatus = unmonetized`. It lists every Booking.com, GetYourGuide, Viator, Klook, 12Go, Agoda, Trip.com and Amazon link that has no affiliate parameter, with the page it is on.

**How do I check if my Booking.com affiliate links still work?**
Every affiliate link is opened once; `linkStatus = broken` or `redirected to home` marks hotels and tours that are gone. Expired `amzn.to` short links are caught the same way.

**Does Lasso or Affilimate do this for travel networks?**
Lasso monitors link health mainly for Amazon and large networks; Affilimate tracks revenue by connecting to your accounts. Neither checks whether a GetYourGuide or Klook link on your page carries your partner ID. This Actor does only that, for any blog, without access to your accounts.

**Can I use it from n8n or an AI agent?**
Yes. Start it through the official Apify node for n8n, the Make or Zapier integration, or the Apify MCP server, and read the rows back from the dataset.

**Something is missing or broken?**
Open an issue on the Actor page. New networks are added on request when their link format is public.

### Disclaimer

This Actor is an independent tool. It is not affiliated with, endorsed by or sponsored by Booking.com, Agoda, GetYourGuide, Viator, Klook, 12Go, Trip.com, Discover Cars, Amazon, Stay22 or Travelpayouts. It reads your own website and the public parts of the networks' redirect links; it never logs in to any affiliate account.

# Actor input Schema

## `startUrls` (type: `array`):

Your travel blog (example.com or https://example.com). With 'Scan the whole site' on, the pages are taken from the sitemap, or found by crawling when there is no sitemap. You can also paste single article URLs.

## `scanWholeSite` (type: `boolean`):

On: read every page listed in the sitemap (up to the page limit). Off: read only the URLs given above.

## `maxPages` (type: `integer`):

Most pages read per site. Pages are free; you pay per affiliate link found.

## `myAffiliateIds` (type: `array`):

Your own IDs, one per line, e.g. 'booking=1234567', 'getyourguide=ABC123', 'viator=P00012345', 'klook=12345', 'stay22=5f1a2b...', 'travelpayouts=123456', 'amazon=yourtag-20'. Links carrying a different ID of that network are marked 'foreign ID'. Leave empty to just see which IDs your site uses and how often.

## `checkDestinations` (type: `boolean`):

Opens each affiliate link once and reports broken links (404), links that now land on the network's front page (listing gone) and networks that refuse automated checks.

## `includeOtherOutbound` (type: `boolean`):

Adds rows for outbound links that belong to none of the known affiliate networks (network = 'other'). Useful to spot hotel or tour sites you link to without any affiliate program.

## `respectRobotsTxt` (type: `boolean`):

Skips pages your robots.txt closes to crawlers.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.nomadicmatt.com"
  ],
  "scanWholeSite": true,
  "maxPages": 300,
  "checkDestinations": true,
  "includeOtherOutbound": false,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `links` (type: `string`):

Every affiliate link and widget found, with network, affiliate ID, ID status and link status.

## `summary` (type: `string`):

Pages read, links per network, which IDs appear how often, counts of unmonetized, foreign-ID and broken links.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.nomadicmatt.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("best_celerytop/travel-affiliate-link-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": ["https://www.nomadicmatt.com"] }

# Run the Actor and wait for it to finish
run = client.actor("best_celerytop/travel-affiliate-link-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.nomadicmatt.com"
  ]
}' |
apify call best_celerytop/travel-affiliate-link-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,best_celerytop/travel-affiliate-link-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Nwc3Ux8vDu3EhUwPx/builds/tef59gEHbxd8h0cI8/openapi.json
