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:

ParamTypeDefaultMo ta
typestring-Required - Pool type (scraping, posting, …)
limitnumber10Max 100, so luong account
minEnergynumber100-100, nguong energy toi thieu
excludePendingbooleantrueLoai 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:

ParamTypeDefaultMo ta
limitnumber10Max 100
minEnergynumber100-100
excludePendingbooleantrueLoai 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:

ParamTypeDefaultMo ta
actionTypestring-Loai action de chon account phu hop
minEnergynumber100-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
}
FieldTypeRequiredValidation
accountIdUUIDYesAccount ID
poolIdUUIDNoPool ID
decrementEnergynumberNo0-100, default 1

Response (200):

{
  "success": true,
  "message": "Da cap nhat usage"
}