Prompt
product recommendations API
Latest observation
Oct 13, 2026
OpenAI APIWeb search: off
Sure — I can help with a product recommendations API in a few different ways.
If you mean build one, here’s a simple starting design:
Example endpoints
GET /products— list productsGET /recommendations?user_id=123— personalized recommendationsGET /recommendations?product_id=456— similar productsPOST /events— track clicks, views, purchases
Basic recommendation approaches
- Content-based
- Recommend products similar in category, brand, price, tags.
- Collaborative filtering
- Recommend products bought/viewed by similar users.
- Popularity-based
- Recommend trending/top-selling products.
- Hybrid
- Combine multiple methods for better quality.
Minimal response example
{
"user_id": "123",
"recommendations": [
{
"product_id": "p1",
"name": "Wireless Headphones",
"score": 0.98
},
{
"product_id": "p2",
"name": "Bluetooth Speaker",
"score": 0.91
}
]
}
Example request
GET /recommendations?user_id=123
Example Python/FastAPI sketch
from fastapi import FastAPI
app = FastAPI()
@app.get("/recommendations")
def recommendations(user_id: str):
return {
"user_id": user_id,
"recommendations": [
{"product_id": "p1", "name": "Wireless Headphones", "score": 0.98},
{"product_id": "p2", "name": "Bluetooth Speaker", "score": 0.91}
]
}
If you want, I can provide one of these next:
- Full API design
- OpenAPI/Swagger spec
- FastAPI/Node.js implementation
- Recommendation algorithm design
- Database schema for recommendation tracking
Brands