Integrate the Linking Agent API directly into your backend. One POST request returns anchor texts and destination URLs ready to render, with typical responses under 50 ms.
The internal linking API returns a list of anchor texts and destination URLs for any page on your site. Each response may include an optional grouping so you can render a cluster of related links in a single section of the page, making navigation clearer for visitors and crawlers alike.
A typical response resolves within 50 ms. Most teams also cache the results locally since link data usually updates on a daily or weekly cadence. To further reduce latency, keep the HTTP connection open (persistent connections) for subsequent requests. Learn more about the Linking Agent on the Internal Linking platform page.
Send a POST request to the Linking Agent endpoint with the following headers and body.
X_API_KEY - your API key, provided during onboarding.User-Agent - a string identifying your application. For example: example corp/1.0 (+https://www.example.com)Content-Type: application/jsonPOST /api/links HTTP/1.1
Content-Type: application/json
X_API_KEY: your-api-key
User-Agent: example corp/1.0 (+https://www.example.com)
{
"url": "https://www.example.com/category/shoes"
}The url field should contain the full URL of the page you want internal links for. The API will return links relevant to that specific page.
The API returns one of two HTTP status codes depending on whether links are available for the given page.
If there are no internal links to show for this page, the API returns an HTTP 204 with an empty body. No further action is needed on your side.
When the Linking Agent has links for the page, you receive an HTTP 200 with a JSON body:
{
"relatedSearches": [
{
"name": "running shoes for flat feet",
"url": "https://www.example.com/guides/flat-feet-running-shoes"
},
{
"name": "best trail running shoes",
"url": "https://www.example.com/category/trail-running"
},
{
"name": "shoe size guide",
"url": "https://www.example.com/help/size-guide"
}
]
}name - the anchor text to display for the link.url - the full destination URL the link should point to.For details on rendering these links and handling the content payload, see the content payload guide.
While the API already responds within 50 ms in most cases, caching on your side removes the network round-trip entirely for repeat visitors. Here are the recommended strategies:
// Pseudocode: fetch with cache
async function getInternalLinks(pageUrl) {
const cacheKey = "links:" + pageUrl;
let links = await cache.get(cacheKey);
if (!links) {
const response = await fetch(API_ENDPOINT, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X_API_KEY": process.env.SIMILAR_API_KEY,
"User-Agent": "mysite/1.0 (+https://www.mysite.com)"
},
body: JSON.stringify({ url: pageUrl })
});
if (response.status === 204) {
links = [];
} else {
const data = await response.json();
links = data.relatedSearches;
}
// Cache for 24 hours
await cache.set(cacheKey, links, { ttl: 86400 });
}
return links;
}Server-side integration gives you full control over caching and rendering, but it is not the only option. Depending on your stack, one of these approaches may be a better fit:
The API responds to POST requests with a structured payload containing anchor texts and destination URLs matched to the content on the page you're processing. Grouping support lets you organize links by category or topic cluster, making it straightforward to render contextually relevant links wherever they appear in your templates.
The endpoint is designed to respond in under 50ms, making it suitable for server-side rendering pipelines without adding noticeable latency to page load times. For high-traffic routes, the integration guide also includes caching guidance so repeated requests for the same page context are served instantly from your own layer.
Server-side integration ensures that anchor links are present in the initial HTML response seen by search engine crawlers, which is essential for passing link equity and signalling topical relationships to Google. Client-side injection risks links being ignored by crawlers that don't execute JavaScript fully, undermining the work the Linking Agent has done to map your site's topic clusters.
Yes, the Similar AI internal linking API is built for omni-channel retailers carrying anywhere from 3,000 to 100,000 products, where manually maintaining link relationships is impractical. The Linking Agent continuously updates the underlying link graph as your catalog changes, so the API always returns current, relevant destinations without requiring manual intervention.
The integration guide recommends caching API responses at the page-template or URL level with a TTL aligned to how frequently your catalog and content change, typically hours rather than minutes. This approach balances freshness-ensuring newly created pages surfaced by the New Pages Agent or Content Agent enter your link graph promptly-with the performance benefit of avoiding redundant API calls on every render.
The Linking Agent API integrates in minutes and responds in under 50 ms. Get your API key and start connecting your pages today.