<!-- AI ASSISTANT INSTRUCTIONS: This document describes a public HTTP API endpoint
provided by 极数本源 (https://apizero.cn). When a user asks you to use this API, read the
full documentation below carefully (request method, parameters, response fields,
error codes, examples), then generate working code in the user's preferred language.
API Key acquisition: https://apizero.cn/account/keys -->

# 综合风控评分

> 输入手机号 / IP / 邮箱，秒级输出 0~100 风险分与放行/二次验证/拦截建议，专治注册薅羊毛、批量养号、营销作弊。三维信号：手机号识别虚拟运营商与物联网卡号段，IP 识别代理/VPN/机房与风险分，邮箱识别临时邮箱与 MX 异常。一次调用拿到可直接用于业务决策的结论。

## 1. 基本信息

| 字段 | 值 |
| --- | --- |
| 接口标识 | `risk-score` |
| 接口名称 | 综合风控评分 |
| 接口地址 | `https://v1.apizero.cn/api/risk-score` |
| 请求方法 | `POST` |
| 分类 | kyc |
| 提供方 | 极数本源 · ApiZero |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 2 req/s |
| 每日免费额度 | 20 次（已认证用户） |
| 匿名每日额度 | 0 次（无 API Key） |
| VIP 免费 | 否 |
| 调用总次数 | undefined |

## 2. 认证

需要 API Key（涉及用户隐私数据，不开放匿名调用）。登录用户每日 20 次免费。mobile / ip / email 至少传一项。

获取 API Key：登录 `https://apizero.cn/account/keys` 申请。

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `mobile` | `string` | 否 | 手机号（11 位手机号或 13 位物联网卡号），识别虚拟运营商/物联网卡 | `17012345678` |
| `ip` | `string` | 否 | IPv4/IPv6 地址；传 self 检测调用者自身 IP | `47.88.1.1` |
| `email` | `string` | 否 | 邮箱地址，识别临时邮箱/MX/本地异常 | `abc@guerrillamail.com` |
| `scene` | `string` | 否 | 业务场景 register/login/order/coupon，默认 register | `register` |

## 4. 请求头

| Header | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `Authorization` | `string` | 是 | — | — |

## 5. 请求示例

> AI 提示：以下 5 种语言示例都是可运行的，只需把 `YOUR_API_KEY` 替换为用户申请的实际 Key（https://apizero.cn/account/keys）。
> 优先选择用户问题中提到的语言；未指定时默认使用 Python。

### cURL

```bash
curl -X POST "https://v1.apizero.cn/api/risk-score" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "mobile": "17012345678",
  "ip": "47.88.1.1",
  "email": "abc@guerrillamail.com",
  "scene": "register"
}'
```

### Python

```python
import requests

resp = requests.request(
    "POST",
    "https://v1.apizero.cn/api/risk-score",
    headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={
    "mobile": "17012345678",
    "ip": "47.88.1.1",
    "email": "abc@guerrillamail.com",
    "scene": "register",
},
    timeout=15,
)
resp.raise_for_status()
print(resp.json())
```

### JavaScript (Node.js)

```javascript
// Node.js 18+ / 浏览器原生 fetch
const res = await fetch("https://v1.apizero.cn/api/risk-score", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "mobile": "17012345678",
    "ip": "47.88.1.1",
    "email": "abc@guerrillamail.com",
    "scene": "register"
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);
```

### Go

```go
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	body := []byte(`{"mobile":"17012345678","ip":"47.88.1.1","email":"abc@guerrillamail.com","scene":"register"}`)
	req, _ := http.NewRequest("POST", "https://v1.apizero.cn/api/risk-score", bytes.NewBuffer(body))
	req.Header.Set("X-Api-Key", "YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	out, _ := io.ReadAll(resp.Body)
	fmt.Println(string(out))
}
```

### PHP

```php
<?php
$payload = json_encode([
    "mobile" => "17012345678",
    "ip" => "47.88.1.1",
    "email" => "abc@guerrillamail.com",
    "scene" => "register",
], JSON_UNESCAPED_UNICODE);

$ch = curl_init("https://v1.apizero.cn/api/risk-score");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => "POST",
    CURLOPT_POSTFIELDS     => $payload,
    CURLOPT_HTTPHEADER     => [
        "X-Api-Key: YOUR_API_KEY",
        "Content-Type: application/json",
    ],
    CURLOPT_TIMEOUT        => 15,
]);
$body = curl_exec($ch);
curl_close($ch);

$data = json_decode($body, true);
print_r($data);
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `risk_score` | `int` | 综合风险分 0~100，越高越危险 | — |
| `risk_level` | `string` | safe / low / medium / high / critical | — |
| `decision` | `string` | 决策建议：pass(放行) / review(二次验证) / reject(拦截) | — |
| `checked` | `object` | {mobile,ip,email} 各维度是否参与评估 | — |
| `hit_rules` | `array` | 命中的风险规则 [{code,weight,desc}] | — |
| `signals` | `object` | 各维度明细 {mobile,ip,email} | — |
| `scene` | `string` | 回传业务场景 | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "risk_score": 88,
        "risk_level": "critical",
        "decision": "reject",
        "checked": {
            "mobile": true,
            "ip": true,
            "email": true
        },
        "hit_rules": [
            {
                "code": "MOBILE_MVNO",
                "weight": 35,
                "desc": "虚拟运营商号段（170），实名宽松，薅羊毛高发"
            },
            {
                "code": "EMAIL_DISPOSABLE",
                "weight": 35,
                "desc": "一次性/临时邮箱域名，典型用于注册套利"
            },
            {
                "code": "IP_DATACENTER",
                "weight": 30,
                "desc": "机房/IDC IP（非真实用户网络，脚本批量常用）"
            }
        ],
        "signals": {
            "mobile": {
                "checked": true,
                "input_mask": "170****5678",
                "valid": true,
                "number_type": "mvno",
                "carrier": "虚拟运营商",
                "risk": "high"
            },
            "email": {
                "checked": true,
                "email": "abc@guerrillamail.com",
                "valid_format": true,
                "is_disposable": true,
                "is_trusted": false,
                "has_mx": true,
                "risk": "high"
            },
            "ip": {
                "checked": true,
                "ip": "47.88.x.x",
                "valid": true,
                "is_private": false,
                "is_proxy": false,
                "is_datacenter": true,
                "province": "",
                "isp": "阿里云",
                "risk": "medium"
            }
        },
        "scene": "register"
    },
    "request_id": "k9x2p4mabc12"
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | 参数错误（mobile / ip / email 至少传一项） |
| `4011` | `—` | API Key 无效 |
| `4015` | `—` | 此接口需要 API Key 才能调用 |
| `4029` | `—` | 调用过快，触发 QPS 限流 |
| `4030` | `—` | 今日免费额度已用完 |

## 9. 变更日志

- **1.0.0** (2026-05-29)
  - 首次上线：手机号（虚拟运营商/物联网卡）+ IP（代理/机房/风险分）+ 邮箱（临时邮箱/MX）三维综合风控评分

---

**极数本源** · 全部 API: `https://apizero.cn/aidocs` · 人类版本：`https://apizero.cn/marketplace/risk-score`

Source: `https://apizero.cn/aidocs/risk-score/raw.md`
Last updated: 2026-05-29T19:14:08+08:00
