canonical: https://jentic.com/apis/algolia.com/algolia-recommend-api

# Algolia Recommend API

Jentic publishes the only available OpenAPI specification for the Algolia Recommend API, keeping it validated and agent-ready. The Recommend API serves product recommendations - related items, frequently bought together, trending items, looking similar - powered by models trained on Insights events. It also exposes a rules engine so merchandisers can pin, hide, or boost recommendations for specific objects. Eleven endpoints cover recommendations retrieval and rule management.

## For AI agents

Fetch product recommendations (related, frequently bought together, trending, looking similar) and manage merchandising rules for the Algolia Recommend models.

## Scope

Does not handle keyword search, event ingestion, or personalized search ranking - use the Algolia Search, Insights, and Personalization APIs for those. Use this API for product recommendations and merchandising rules only.

## Capabilities

- Retrieve related products, frequently bought together, trending, and looking-similar recommendations via POST /1/indexes/*/recommendations
- Define merchandising rules to pin, hide, or boost specific objects in recommendations via POST /1/indexes/{indexName}/{model}/recommend/rules/batch
- Search across recommend rules to audit current merchandising via POST /1/indexes/{indexName}/{model}/recommend/rules/search
- Read or delete a single recommend rule by object ID via GET and DELETE /1/indexes/{indexName}/{model}/recommend/rules/{objectID}
- Check the asynchronous task status after applying rule changes via GET /1/indexes/{indexName}/{model}/task/{taskID}

## Use cases

### Related-products carousel on a product detail page

Call /1/indexes/*/recommendations with model 'related-products', the indexName, and the current product's objectID to get a ranked list of similar items. The response is filtered through any active recommend rules, so merchandiser pins and hides apply without extra logic in the front-end.

Example prompt: POST /1/indexes/*/recommendations with requests=[{indexName:'products', model:'related-products', objectID:'sku_123', threshold:30}]

### Frequently bought together for cart upsell

On the cart page, call the Recommend API with model 'bought-together' and the SKUs already in the cart to surface upsells trained on real co-purchase data. The model is updated automatically as new conversion events flow in via the Insights API, so recommendations stay fresh without retraining.

Example prompt: POST /1/indexes/*/recommendations with requests including model 'bought-together' for each cart objectID and aggregate the returned objectIDs

### Merchandiser pin and hide rules

Define rules that pin a hero product to the top of related-products on a campaign page or hide an out-of-stock SKU across every model. Rule changes are asynchronous - poll /1/indexes/{indexName}/{model}/task/{taskID} until the rule has been indexed, then verify with a recommendations request.

Example prompt: POST /1/indexes/products/related-products/recommend/rules/batch with a rule pinning objectID 'sku_hero' to position 1 for all queries on the campaign category

### Agent-driven recommendations in conversational commerce

An AI shopping assistant operating through Jentic can fetch related and bought-together items as part of a single conversation. The agent searches Jentic by intent, loads the getRecommendations schema, and executes - no manual integration with the Recommend endpoint.

Example prompt: Search Jentic for 'fetch Algolia related products', load getRecommendations, and execute for the SKU the user is looking at

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /1/indexes/*/recommendations | Fetch recommendations across one or more models |
| POST | /1/indexes/{indexName}/{model}/recommend/rules/batch | Create or update recommend rules in batch |
| POST | /1/indexes/{indexName}/{model}/recommend/rules/search | Search across recommend rules |
| GET | /1/indexes/{indexName}/{model}/recommend/rules/{objectID} | Get a single recommend rule |
| DELETE | /1/indexes/{indexName}/{model}/recommend/rules/{objectID} | Delete a recommend rule |
| GET | /1/indexes/{indexName}/{model}/task/{taskID} | Check rule indexing task status |

## Key resources

- **Recommendations** — Model-driven product suggestions: related, bought-together, trending, looking-similar
- **Rules** — Merchandising rules that pin, hide, or boost objects per model

## Why Jentic

- **Setup:** Wiring the Algolia Recommend API by hand means sending its API key, resolving the {appId}.algolia.net host, and managing recommendation queries and merchandising rules yourself. Through Jentic you install once, import the Recommend API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** The Recommend API puts the index, model, and rule ids in the URL path (/1/indexes/{indexName}/{model}/recommend/rules/{objectID}, /1/indexes/{indexName}/{model}/task/{taskID}), so a rule can pin your agent to one index and model. You choose the operations it may call, so deleting a merchandising rule is not included unless you add it.
- **Credential handling:** Your Algolia API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get related product recommendations' or 'search merchandising rules', and Jentic returns the matching Algolia Recommend operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Algolia Insights API** — Source of training events for Recommend models
- **Algolia Search API** — Search powers product discovery; Recommend powers similar-item discovery
- **Algolia Personalization API** — Different relevance lever - personalized search ranking rather than item recommendations

## FAQ

### Why is there no official OpenAPI spec for the Recommend API?

Algolia does not publish a standalone OpenAPI specification for the Recommend API. Jentic generates and maintains this spec so that AI agents and developers can call the Recommend API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Algolia Recommend API use?

Two API key headers: x-algolia-application-id and x-algolia-api-key with the appropriate ACL (search for read, editSettings for rule management). Through Jentic, both keys are stored in the vault and injected at request time.

### Can I get frequently-bought-together recommendations with this API?

Yes. POST /1/indexes/*/recommendations with model 'bought-together' and one or more objectIDs. The response returns ranked suggestions trained on conversion events captured by the Insights API.

### What are the rate limits for the Algolia Recommend API?

The spec does not declare explicit numeric rate limits. The Recommend API shares Algolia's standard search infrastructure, which scales per-cluster. Watch for 429 responses on burst traffic and back off using the Retry-After header.

### How do I add a recommendation rule through Jentic?

Search Jentic for 'add Algolia recommend rule', load batchRecommendRules, and execute against the target index and model. Jentic returns the taskID; poll /1/indexes/{indexName}/{model}/task/{taskID} until indexed.

### Do recommendations need Insights events to work?

Yes. Recommend models train on click and conversion events sent through the Insights API. Without enough event volume, models fall back to defaults or return empty for cold-start objectIDs.

### Can I limit what my agent is allowed to do with the Algolia Recommend API?

Yes. Because you self-host Jentic One, your own rules decide which Recommend operations your agent may call and which Algolia credentials it uses. Since the index, model, and rule IDs sit in the URL path (for example /1/indexes/{indexName}/{model}/recommend/rules/{objectID}), you can pin the agent to a single index and model so it only fetches recommendations there. You choose the allowed operations, so an action like deleting a merchandising rule stays off the table unless you explicitly grant it.
