Overview
The Item Recommendations endpoints provide similar functionality to the Affiliate Recommendations API, but with a key difference: it only returns items that your organization has access to. This protects intellectual property while enabling powerful content discovery features for your users. The search and ranking logic, based on snippet count and cumulative certainty, is identical to the Affiliate Recommendations API. Please note that once a publisher allows their content to be used as a reference, it may take up to 24 hours for search queries to include their items in returned data.Endpoints
There are two distinct endpoints for item recommendations:/recommendations/base: Returns item and snippet metadata but keeps the snippet text itself hidden./recommendations/verbose: Returns item and snippet data, including the full snippet text.
How to Use the API
Parameters
| Parameter | Description | Required |
|---|---|---|
query | The prompt that the user enters into the application. | Yes |
collection | The collection to search in. | Yes |
tenant | The tenant to search. | Yes |
publishers | A list of Publisher Names. Only publishers belonging to your organization are allowed. | Yes |
max_snippet_count_overall | The maximum number of snippets to search through overall. | Yes |
certainty_threshold | The minimum certainty threshold for snippets. | No |
media_types | An array of media types to filter by (audio, video, book, article). | No |
min_snippet_count_per_item | The minimum number of snippets an item must have to be returned. Must be at least 1. | No |
Making a Request
Before making a request, you must know which publisher’s content you would like to query.- Find Your Tenant (Publisher Name): First, navigate to the Organizations page in Studio and click “View Publishers”. Your Tenant is the name of the publisher you’re querying.
- Identify the Collection: A collection is where we keep the content for our customers. The only collection you’ll need to specify in requests is
GlooProd. You must specify this in thecollectionfield.
NOTE: You will only have access to your own publisher’s tenant through this endpoint, and a tenant must be specified. Other requests will result in a 403 “Forbidden” response.
Base Recommendations
This endpoint returns snippet metadata without the snippet text.POST /ai/v1/data/items/recommendations/base
Example Request (/base)
Example Response (/base)
As shown below, the uuids array contains snippet metadata, but not the snippet text itself.
Verbose Recommendations
This endpoint returns the full snippet text.POST /ai/v1/data/items/recommendations/verbose
Example Request (/verbose)
Example Response (/verbose)
Note the addition of the snippet field in the uuids array.
Use Cases
The Item Recommendations API is ideal for a publisher looking to increase exposure and engagement with their own content. For example, a user could enter a query on a publisher’s website. The publisher could then use the/recommendations/base endpoint to recommend their own relevant books, articles, or videos. This enhances content discovery and keeps users engaged on the platform.
If the publisher wanted to provide a preview of the content, they could use the /recommendations/verbose endpoint to display a relevant snippet or a sample of one, encouraging the user to explore the full item.
