> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cludo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quicklinks

> Fetch a visitor's Quicklink match and redirect them before calling search, using the same public settings endpoint used by CludoJS.

Quicklinks are configured in MyCludo to send visitors straight to a page when their query matches a trigger phrase, instead of showing them search results.

This guide shows API-only customers how to read the configured Quicklinks from the same public settings endpoint used by CludoJS, and how to apply them in a custom integration.

<Note>
  Quicklinks are not part of the [Search](/api-reference/v4/search/search) response. Banners and Page Rankings are both applied automatically inside that response, but Quicklinks are delivered separately and your integration is responsible for checking the query against them, typically before deciding whether to call search at all.
</Note>

## Prerequisites

From MyCludo, collect the values for the engine where Quicklinks are configured:

| Value           | Description                                                                            |
| --------------- | -------------------------------------------------------------------------------------- |
| **Customer ID** | The customer ID for your Cludo account                                                 |
| **Engine ID**   | The engine where Quicklinks were configured                                            |
| **Search key**  | The public search or site key for the engine                                           |
| **Region**      | EU customers use `https://api.cludo.com`; US customers use `https://api-us1.cludo.com` |

The feature must also be enabled on your subscription. If **Tools > Quicklinks** in MyCludo lets you save terms, the feature is enabled.

## Step 1: Build the SiteKey authorization header

The request uses SiteKey authentication. Build the token by Base64-encoding `{customerId}:{engineId}:{searchKey}`:

```text theme={null} theme={null}
Authorization: SiteKey <base64("{customerId}:{engineId}:{searchKey}")>
```

## Step 2: Call the public settings endpoint

Fetch the website public settings for the engine:

```bash theme={null} theme={null}
curl https://api.cludo.com/api/v3/{customerId}/{engineId}/websites/publicsettings
```

Use the regional base URL that matches your customer ID:

| Customer ID          | Region | Base URL                    |
| -------------------- | ------ | --------------------------- |
| Below 10,000,000     | EU     | `https://api.cludo.com`     |
| 10,000,000 and above | US     | `https://api-us1.cludo.com` |

## Step 3: Parse the `quicklinks` field

The response contains many website settings. Quicklinks are returned as a plain JSON array under `quicklinks` — unlike `instantSuggestionsConfiguration`, this field does not need a second parse:

```json theme={null} theme={null}
{
  "quicklinks": [
    {
      "id": 123,
      "url": "https://example.com/contact-us",
      "terms": [{ "name": "contact" }, { "name": "phone number" }],
      "websiteid": 456,
      "brokenLinksFoundAt": null
    }
  ]
}
```

| Field                | Description                                                         |
| -------------------- | ------------------------------------------------------------------- |
| `id`                 | Quicklink ID                                                        |
| `url`                | Destination to send the visitor to when one of its terms is matched |
| `terms`              | Trigger phrases for this Quicklink; any one of them can match       |
| `websiteid`          | Engine this Quicklink belongs to                                    |
| `brokenLinksFoundAt` | Managed by Cludo; informational only                                |

## Step 4: Match the query and redirect

Before calling search, compare the visitor's query against every term across all Quicklinks. Trim whitespace and compare case-insensitively:

```js theme={null} theme={null}
const query = input.trim().toLowerCase();
const match = quicklinks.find((quicklink) =>
  quicklink.terms.some((term) => term.name.trim().toLowerCase() === query)
);

if (match) {
  window.location.href = match.url;
} else {
  // No Quicklink matched — run search as normal.
  // Banners and Page Rankings for this query are already included
  // automatically in that response, no extra calls needed.
}
```

Quicklinks change infrequently, so fetch them once per page load (or cache them for a few minutes) rather than re-fetching on every keystroke.
