There are two ways to upload reviews for analysis:
CSV Format:
product_id,product_title,review,author,date,stars
Where:
JSON Format:
{
"products": [
{
"id": "product_id",
"title": "product_title",
"reviews": [
{
"review": "review",
"author": "author",
"date": "date",
"stars": stars
}
]
}
]
}
Where:
All API requests must include your API key in the header:
x-api-key: your-api-key
POST /api/summarize
Request Body:
{
"products": [
{
"id": "string",
"title": "string",
"reviews": [
{
"review": "string",
"author": "string",
"date": "YYYY-MM-DD",
"stars": number
}
]
}
]
}
Response:
{
"results": [
{
"id": "string",
"title": "string",
"create_date": "YYYY-MM-DD",
"summarized_reviews_count": number,
"total_reviews_count": number,
"summary": "string",
"average_rating": number,
"sentiment": "positive" | "negative" | "neutral",
"top_features": [
{
"feature": "string",
"mentions": number,
"sentiment": "positive" | "negative" | "neutral"
}
]
}
],
"errors": [
{
"id": "string",
"error": "string"
}
]
}
GET /api/summarize/last?productId=PRODUCT_ID
Parameters:
Response:
{
"results": [
{
"id": "string",
"title": "string",
"create_date": "YYYY-MM-DD",
"summarized_reviews_count": number,
"total_reviews_count": number,
"summary": "string",
"average_rating": number,
"sentiment": "positive" | "negative" | "neutral",
"top_features": [
{
"feature": "string",
"mentions": number,
"sentiment": "positive" | "negative" | "neutral"
}
]
}
]
}
Error Responses:
The API may return the following error codes: