# Tài khoản và số dư

> API LocalSERP Proxy: thông tin tài khoản, số dư USD trả trước và lịch sử số dư. Tham số, phản hồi mẫu, mã curl, Python và Node.js.

- URL: https://localserpproxy.com/vi/docs/api/account/
- Cập nhật lần cuối: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

Xem cài đặt tài khoản, số dư trả trước bằng USD và mọi giao dịch của số dư đó (nạp tiền, mua hàng, hoàn tiền).

**Các điểm cuối trên trang này**

- `GET /v1/account`: Lấy thông tin tài khoản hiện tại
- `GET /v1/balance`: Số dư trả trước hiện tại
- `GET /v1/balance/transactions`: Sổ ghi số dư

URL cơ sở `https://localserpproxy.com/api/v1`. Xem [tổng quan API](https://localserpproxy.com/vi/docs/api/)] để biết về xác thực, lỗi và giới hạn.

## Lấy thông tin tài khoản hiện tại

`GET /v1/account`

Xác thực: khóa API trong tiêu đề `Authorization: Bearer API_KEY`.

**Phản hồi** `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());
```

## Số dư trả trước hiện tại

`GET /v1/balance`

Xác thực: khóa API trong tiêu đề `Authorization: Bearer API_KEY`.

**Phản hồi** `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());
```

## Sổ ghi số dư

`GET /v1/balance/transactions`

Xác thực: khóa API trong tiêu đề `Authorization: Bearer API_KEY`.

**Tham số**

| Tên | Trong | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- | --- |
| `page` | query | integer | Không | ≥ 1, mặc định `1` |
| `perPage` | query | integer | Không | 1–100, mặc định `20` |
| `type` | query | `top_up` · `purchase` · `refund` · `referral_payout` · `adjustment` | Không | — |

**Phản hồi** `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 là dịch vụ proxy dân cư tại Hoa Kỳ để kiểm tra kết quả tìm kiếm địa phương, quảng cáo và giá theo từng thành phố, thanh toán bằng tiền mã hóa và không cần tải lên giấy tờ tùy thân.
