Integration Options
Use either of the following:- Agent API: best for chat interfaces and multi-turn conversational search
- MCP Server: best for custom integrations and direct tool access
Option 1: Agent API
The Agent API provides a conversational search experience with memory across sessions.Endpoint
Headers
Request Example
query(required): natural language querysession_id(optional): conversation continuityuser_id(optional): user identifiermax_results(optional, default5): total productsmax_sponsored(optional, default2): sponsored productsstreaming(optional, defaultfalse): NDJSON streaming mode
Response Example
Streaming Mode
Setstreaming: true to receive NDJSON events:
Multi-turn Sessions
Reuse the samesession_id for follow-up queries to preserve context.
Option 2: MCP Server
If you are building your own agent, connect directly to the MCP server and callsearch_products.
Connection
Tool: search_products
Main parameters:query(required): natural language querymarketplace_id(optional): marketplace UUIDmax_results(optional, default5)max_sponsored(optional, default2)price_filtering(optional, defaultfalse)min_priceandmax_price(optional, if filtering enabled)
Product Response Fields
id: product identifiername: product namebrand: brand nameprice: numeric pricecurrency: currency code (for exampleUSD)categories: category listimage_url: product image URLsimilarity_score: semantic relevance scorerank: result positionis_sponsored: sponsored flagdescription: product descriptionavailability: stock statusresolvedBidId: sponsored bid ID for attribution
Best Practices
Sponsored Products
- Treat
is_sponsored: trueas paid placement - Track
resolvedBidIdfor attribution and analytics - Clearly label sponsored placements in UI
Session Management
- Generate a unique
session_idper conversation - Reuse session IDs across follow-up turns
- Start a new session for a new conversation
Error Handling
- Use generous timeouts (
60-180seconds) for complex queries - Retry transient
5xxerrors with exponential backoff - In streaming mode, handle error events gracefully