# 速卖通 评分汇总 API (aliexpress.ratings)

- Canonical page: https://everyinfra.com/aliexpress-api/ratings
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "aliexpress", "action": "ratings", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=aliexpress&action=ratings

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | AliExpress 商品链接，建议传 https://www.aliexpress.com/item/<商品ID>.html。profile 返回商品资料而非用户主页，variants 查商品变体，reviews / ratings 查评论或评分汇总；product_detail 也接收纯数字商品 ID。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| average_star | 平均星级。 |
| total_reviews | 评价总数。 |
| positive_rate | 好评率。 |
| neutral_rate | 中评率。 |
| negative_rate | 差评率。 |
| five_star | 五星评价，含 count（条数）和 rate（占比）。 |
| four_star | 四星评价，含 count 和 rate。 |
| three_star | 三星评价，含 count 和 rate。 |
| two_star | 二星评价，含 count 和 rate。 |
| one_star | 一星评价，含 count 和 rate。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "aliexpress",
  "action": "ratings",
  "params": {
    "url": "https://www.aliexpress.com/item/3256806025886958.html"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "aliexpress",
        "action": "ratings",
        "params": {
            "url": "https://www.aliexpress.com/item/3256806025886958.html",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "aliexpress",
  "action": "ratings",
  "results": {
    "average_star": …,
    "total_reviews": …,
    "positive_rate": …,
    "neutral_rate": …,
    "negative_rate": …,
    "five_star": …,
    "four_star": …,
    "three_star": …,
    "two_star": …,
    "one_star": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=aliexpress
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
