Documentation Index
Fetch the complete documentation index at: https://docs.gloo.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Similar to Search, the Affiliate Recommendations endpoint provides intelligent content discovery by searching through a comprehensive database of licensed, published materials to find items that are semantically related to a user’s query. Specifically, it returns items based on the number of snippets found that are associated with that item.- Snippets: A snippet is a section of a content item (like a podcast episode, article, or book) that represents a meaningful piece of information our AI tools can search and understand. They are the recorded units of searchable content in our backend systems.
- Ranking Logic: Items are ranked first by the number of relevant snippets found. If two or more items have the same snippet count, they are then ranked by their cumulative certainty.
- Certainty Score: This is a confidence metric indicating how well a snippet matches the user’s query. Higher scores mean stronger relevance. Cumulative certainty is the sum of these individual scores, providing an overall confidence measure for the item’s relevance.
Why use Affiliate Recommendations?
This API enables applications to surface contextually relevant content recommendations that enhance user engagement and discovery. It’s perfect for providing “additional resources” or “recommended reading” based on a user’s questions or interests. If a publisher filters on their own data, it also enables more exposure to their own content.How to Use the API
Parameters
| Parameter | Description | Required |
|---|---|---|
query | The prompt that the user enters into the application. | Yes |
certainty_threshold | The minimum certainty threshold for snippets. | No |
max_snippet_count_overall | The maximum number of snippets to search through overall. | No |
media_types | An array of media types to filter by (audio, video, book, article). | No |
publishers | An array of publisher names whose items should be recommended. | No |
min_snippet_count_per_item | The minimum number of snippets an item must have to be returned. Must be at least 1. | No |
item_count | The maximum number of items to return, ranked by cumulative certainty. If the available snippets span fewer items than this count, only those items are returned. | No |
Making a Request
An API key is necessary to call these endpoints. You can get one by visiting the API Credentials page to generate a token using the OAuth2 Client Credentials flow. Endpoint:POST /ai/v1/data/affiliates/referenced-items

