# 账户和余额

> LocalSERP Proxy API：账户详情、预付 USD 余额和余额历史记录。参数、响应示例、curl、Python 和 Node.js 代码。

- URL: https://localserpproxy.com/zh/docs/api/account/
- 最后更新: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

查看您的账户设置、预付 USD 余额以及余额的所有变动（充值、购买、退款）。

**本页端点**

- `GET /v1/account`：获取当前账户
- `GET /v1/balance`：当前预付余额
- `GET /v1/balance/transactions`：余额流水

基础 URL `https://localserpproxy.com/api/v1`。身份验证、错误和限制：请参阅 [API 概览](https://localserpproxy.com/zh/docs/api/)。

## 获取当前账户

`GET /v1/account`

身份验证：在 `Authorization: Bearer API_KEY` 请求头中提供 API 密钥。

**响应** `200 OK`

```json
{
  "accountNumber": "4821773009125564",
  "createdAt": "2026-10-05T09:12:44Z",
  "email": null,
  "emailVerified": false,
  "hasPassword": false,
  "twoFactorEnabled": false,
  "lang": "en",
  "currency": "USD",
  "balance": "0.00",
  "referralCode": "K7Q2MX",
  "status": "active",
  "notifications": {
    "paymentReceipts": true,
    "lowTraffic": true,
    "expiryReminders": true,
    "productNews": false
  },
  "recoveryCodesRemaining": 0
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/account" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/account", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/account`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 当前预付余额

`GET /v1/balance`

身份验证：在 `Authorization: Bearer API_KEY` 请求头中提供 API 密钥。

**响应** `200 OK`

```json
{
  "balance": "29.00",
  "currency": "USD"
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/balance" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/balance", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/balance`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 余额流水

`GET /v1/balance/transactions`

身份验证：在 `Authorization: Bearer API_KEY` 请求头中提供 API 密钥。

**参数**

| 名称 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `page` | query | integer | 否 | ≥ 1，默认值 `1` |
| `perPage` | query | integer | 否 | 1–100，默认值 `20` |
| `type` | query | `top_up` · `purchase` · `refund` · `referral_payout` · `adjustment` | 否 | — |

**响应** `200 OK`

```json
{
  "data": [
    {
      "id": "txn_2k9d1m",
      "type": "top_up",
      "amount": "29.00",
      "balanceAfter": "29.00",
      "description": "Top-up · USDT · Tron (TRC-20)",
      "createdAt": "2026-10-05T14:03:11Z",
      "orderId": null,
      "topUpId": "top_7d2kq9x1"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1,
    "totalPages": 1
  }
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/balance/transactions" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/balance/transactions", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/balance/transactions`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

---

LocalSERP Proxy: LocalSERP Proxy 是一项美国住宅代理服务，用于逐个城市检查本地搜索结果、广告和价格，支持加密货币支付，无需上传身份证件。
