Pool API#
API quan ly pool va lay account cho automation. Ho tro scoring thong minh de chon account tot nhat.
Base URL: https://app.socialking.vn/api/v1
Rate Limit: 100 req/sec
1. Lay Account theo Pool Type#
GET /pool/accounts/by-type
#
Auth: API Key
Query Parameters:
| Param | Type | Default | Mo ta |
|---|---|---|---|
type | string | - | Required - Pool type (scraping, posting, …) |
limit | number | 10 | Max 100, so luong account |
minEnergy | number | 10 | 0-100, nguong energy toi thieu |
excludePending | boolean | true | Loai bo account dang co task |
Response (200):
{
"success": true,
"data": {
"type": "scraping",
"accounts": [
{
"id": "uuid",
"uid": "123456789",
"name": "Account Name",
"status": "live",
"poolId": "uuid",
"poolName": "Pool Name",
"memberId": "uuid",
"priority": 0,
"usageCount": 5,
"lastUsedAt": "2026-03-30T10:00:00Z",
"isActive": true,
"currentEnergy": 85,
"maxEnergy": 100,
"recoveryPerMinute": 0.1
}
],
"total": 1
}
}2. Lay Account tu Pool cu the#
GET /pool/:poolId/accounts
#
Auth: API Key
URL Params: poolId (UUID)
Query Parameters:
| Param | Type | Default | Mo ta |
|---|---|---|---|
limit | number | 10 | Max 100 |
minEnergy | number | 10 | 0-100 |
excludePending | boolean | true | Loai bo account dang busy |
Response (200):
{
"success": true,
"data": {
"pool": {
"id": "pool-uuid",
"name": "Pool Name",
"type": "scraping"
},
"accounts": [...],
"total": 5
}
}3. Lay Account tot nhat (Best Selection)#
GET /pool/:poolId/accounts/best
#
Auth: API Key
URL Params: poolId (UUID)
Query Parameters:
| Param | Type | Default | Mo ta |
|---|---|---|---|
actionType | string | - | Loai action de chon account phu hop |
minEnergy | number | 10 | 0-100 |
Scoring Algorithm:
- Energy: 40% - Account co energy cao duoc uu tien
- Rest time: 30% - Account nghi lau duoc uu tien
- Usage variety: 30% - Account it dung duoc uu tien
Response (200):
{
"success": true,
"data": {
"pool": {
"id": "pool-uuid",
"name": "Pool Name",
"type": "scraping"
},
"account": {
"id": "account-uuid",
"uid": "123456789",
"name": "Account Name",
"currentEnergy": 95,
"score": 87.5
}
}
}4. Cap nhat Usage#
POST /pool/accounts/usage
#
Auth: API Key
Request Body:
{
"accountId": "uuid-account-id",
"poolId": "uuid-pool-id",
"decrementEnergy": 1
}| Field | Type | Required | Validation |
|---|---|---|---|
accountId | UUID | Yes | Account ID |
poolId | UUID | No | Pool ID |
decrementEnergy | number | No | 0-100, default 1 |
Response (200):
{
"success": true,
"message": "Da cap nhat usage"
}