AI agent that monitors product ratings, detects suspicious/fake reviews, and protects seller rating by flagging anomalies.
import requests, json, numpy as np
from datetime import datetime, timedelta
API_REVIEWS = "https://api.shopee.com/v2/product/reviews"
def fetch_reviews(product_id, days=30):
resp = requests.get(API_REVIEWS, params={
"product_id": product_id,
"since": (datetime.now() - timedelta(days=days)).isoformat()
})
return resp.json().get("reviews", [])
def score_authenticity(reviews):
scores = []
for r in reviews:
score = 1.0
if r.get("reviewer_tenure_days", 365) < 7:
score -= 0.3
if len(r.get("text", "")) < 20:
score -= 0.2
if r.get("rating") == 5 and r.get("has_images") == False:
score -= 0.25
scores.append({"review_id": r["id"], "score": max(0, score)})
return scores
def flag_suspicious(reviews, threshold=0.5):
scored = score_authenticity(reviews)
flagged = [s for s in scored if s["score"] < threshold]
return {
"total": len(reviews),
"flagged": len(flagged),
"suspicious_ids": [s["review_id"] for s in flagged]
}
report = flag_suspicious(fetch_reviews("PROD-001"))
print(json.dumps(report, indent=2))
Basic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer โ
Ask about AINNA pages, services and articles.
AINNA website sources only ยท answers up to 5 lines
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy