Join Community Join Channel Telegram Contact Owner
Developers

KLS API Documentation

Connect your own scripts and apps to your KLS account

Open live API tester

Getting Started

Every KLS user can generate a personal API Key and API Secret from Settings API Access. These two values authenticate every request you make to the API — treat them like a password. Your secret is shown once at generation time and never again, so save it somewhere safe immediately.

All endpoints are scoped to your own account only — you can check your own balance, list available items, view your own purchase history, and buy items on your own behalf. You cannot access any other user's data.

Quick start — your first call in 3 steps

  1. Create your keys. Go to Settings → API Access and tap Generate. Copy the API Key and API Secret (the secret is shown only once).
  2. Send both on every request as headers: X-API-Key and X-API-Secret. Everything is JSON.
  3. Test it — check your balance. If you see {"balance": ...} you are connected.
BASE=https://klslogs.com KEY=your_api_key SECRET=your_api_secret curl "$BASE/api/v1/balance" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET"

Tip: open GET /api/v1 in your browser to see every endpoint this server supports, grouped by feature.

What you can do with the API

Website featureAPI calls (in order)
WalletGET /balance · GET /transactions
Buy logs & toolsGET /marketplace → POST /buy/:id → GET /purchases/:purchaseId
Tools onlyGET /tools → POST /buy/:id → use toolLink / deliverableFile from the response
Marketplace 2GET /market2/products → POST /market2/buy → GET /market2/orders
Marketplace 3GET /market3/products → POST /market3/buy → GET /market3/orders
Numbers — Server 1 (USA)GET /numbers/options?countries=1 → GET /numbers/options?country=CODE → POST /buy-number → GET /get-sms
Numbers — Server 2 (all countries)GET /numbers/server2/services → /countries → /providers → POST /numbers/server2/buy → GET /get-sms
Social boostingGET /boost/services → POST /boost/quote → POST /boost/order → GET /boost/order/:id

All paths above start with /api/v1. Money is always in Naira (₦) and is taken from your KLS wallet. If an order fails at the provider you are refunded automatically.

Jump to a section

Everything below is generated from the endpoints this server actually runs — Boost, Buy Number Server 1, Buy Number Server 2 and the Marketplace.

Live API tester — confirm it works with your own key

Paste your key + secret and this page calls the real endpoints on this server, read-only. Nothing is bought and your wallet is never charged — it only runs the browse/status calls for Boost, Server 1 numbers, Server 2 numbers and the Marketplace so you can see exactly which ones answer.

Authentication

Every request must include these two headers:

X-API-Key: your_api_key X-API-Secret: your_api_secret

Requests missing either header, or with an invalid/revoked key, get a 401 Unauthorized response.

Base URL

https://your-site.example.com/api/v1

Endpoints

MethodEndpointWhat it does
GET/meYour account info (name, email, balance)
GET/balanceYour current wallet balance
GET/transactionsYour wallet history
GET/categoriesMarketplace categories
GET/marketplaceLogs + tools for sale — query: category, type, search, page, limit
GET/marketplace/:idOne item in detail
GET/toolsTools only
GET/listingsAll available items (?type=tool or ?type=log)
GET/listings/:idOne listing — includes subAccounts for folder listings
POST/buy/:idBuy an item. Folder listing: optional { "subAccountId": "..." }, otherwise the cheapest is picked
POST/buy-multi/:idBuy several accounts from one folder — { "subAccountIds": [...] }. All-or-nothing
GET/purchasesYour full purchase history
GET/purchases/:purchaseIdRe-fetch one purchase (credentials / download link)
GET/numbers/options?countries=1Server 1 (USA) — countries with stock
GET/numbers/options?country=CODEServer 1 — services for that country with service_id and price
POST/buy-numberServer 1 — rent a number: { "country": "CODE", "service_id": "ID" }
GET/numbers/server2/servicesServer 2 (all countries) — services, query search
GET/numbers/server2/countriesServer 2 — countries with stock for service
GET/numbers/server2/providersServer 2 — price pools for service + country
GET/numbers/server2/operatorsServer 2 — mobile operators for country
POST/numbers/server2/buyServer 2 — rent: { "service", "country", "maxPrice" }
GET/get-smsBoth servers — poll for the code: ?order_id=ID
POST/cancel-numberBoth servers — cancel + refund before a code arrives: { "order_id": "ID" }
GET/numbers/ordersBoth servers — your recent number orders
GET/boost/servicesBoost catalogue with ₦ price per 1000, min, max
POST/boost/quoteExact ₦ price for { "serviceId", "quantity" }
POST/boost/orderPlace a boost: { "serviceId", "link", "quantity" }
GET/boost/order/:idLive status of one boost order
GET/boost/ordersYour boost orders
POST/boost/order/:id/refillAsk for a refill (refill services only)
POST/boost/order/:id/cancelCancel (cancellable services only)
GET/boost/balanceYour wallet balance for boosting
GET/market2/productsMarketplace 2 — products for sale, query category, search
POST/market2/buyMarketplace 2 — buy: { "productId": 123, "quantity": 1 }, returns the delivered keys
GET/market2/ordersMarketplace 2 — your past orders with their keys

Example: Check your balance

curl https://your-site.example.com/api/v1/balance \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret"

Example: List available items

curl "https://your-site.example.com/api/v1/listings?type=tool" \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret"

Example: Buy an item

No platform fee — you're charged exactly the item's listed price via the API, same as buying it through the marketplace. The response includes itemPrice and totalCharged (always equal) so you can confirm this.
curl -X POST https://your-site.example.com/api/v1/buy/LISTING_ID_HERE \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret"

Example: Buying from a folder listing (multiple accounts under one item)

Some listings are "folders" containing several individually-priced accounts (e.g. "Twitter Logs Batch" with 20 accounts inside). Check listingType === "folder" and the subAccounts array from GET /listings/:id first to see what's available and each one's price.
# Step 1 — see what's inside the folder and each account's price curl https://your-site.example.com/api/v1/listings/FOLDER_ID_HERE \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" # Step 2a — buy ONE specific account from it curl -X POST https://your-site.example.com/api/v1/buy/FOLDER_ID_HERE \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Content-Type: application/json" \ -d '{"subAccountId":"SUB_ACCOUNT_ID_HERE"}' # Step 2b — or buy SEVERAL accounts from it in one call curl -X POST https://your-site.example.com/api/v1/buy-multi/FOLDER_ID_HERE \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Content-Type: application/json" \ -d '{"subAccountIds":["SUB_ID_1","SUB_ID_2","SUB_ID_3"]}'

Example: Getting a past purchase's details again

Lost the account details from an old purchase, or need to look them up again later? Every successful /buy, /buy-multi, or on-site purchase returns a purchaseId — save it, then fetch that exact purchase any time with GET /purchases/:purchaseId.
curl https://your-site.example.com/api/v1/purchases/PURCHASE_ID_HERE \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret"

Example: Buy a Number

Numbers are used to receive a one-time verification code from the provider you choose (WhatsApp, Telegram, etc). Prices here are separate from the site's own Buy Numbers page — check /numbers/options for what's currently available and its price. Want to see this exact flow (browse buy poll done) built into a full page? /buy-number on this site is that reference implementation — same four calls below, wired to a UI.
# 1. See what's available curl https://your-site.example.com/api/v1/numbers/options \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" # 2. Rent a number curl -X POST https://your-site.example.com/api/v1/buy-number \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Content-Type: application/json" \ -d '{"provider":"WhatsApp","country":"United States"}' # 3. Poll for the code (repeat every few seconds until status is "received") curl "https://your-site.example.com/api/v1/get-sms?order_id=ORDER_ID_HERE" \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" # 4. If no code arrives, cancel for a refund curl -X POST https://your-site.example.com/api/v1/cancel-number \ -H "X-API-Key: your_api_key" \ -H "X-API-Secret: your_api_secret" \ -H "Content-Type: application/json" \ -d '{"order_id":"ORDER_ID_HERE"}'

Numbers — Server 1 (USA numbers)

Server 1 sells USA numbers for many services with live prices. Flow: country → service → buy → poll code. For any other country use Server 2.

Developer API (API key)

MethodEndpointInputReturns
GET/api/v1/numbers/options?countries=1—[{ code, name }] countries with stock
GET/api/v1/numbers/options?country=CODEcountry = the code above[{ country, service_id, provider, price, count }]
POST/api/v1/buy-number{ country, service_id }{ order_id, number, price, status: "waiting" } — wallet is charged here
GET/api/v1/get-sms?order_id=ID—{ status: "waiting" | "received" | "cancelled" | "expired", sms }
POST/api/v1/cancel-number{ order_id }Full refund if no code has arrived

Full flow (Server 1)

# 1. Countries with stock curl "$BASE/api/v1/numbers/options?countries=1" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 2. Services + price for the country (use the "code" from step 1) curl "$BASE/api/v1/numbers/options?country=COUNTRY_CODE" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 3. Rent one (wallet is charged here) curl -X POST "$BASE/api/v1/buy-number" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" \ -H "Content-Type: application/json" \ -d '{"country":"COUNTRY_CODE","service_id":"SERVICE_ID"}' # 4. Poll every 5 seconds until status is "received" curl "$BASE/api/v1/get-sms?order_id=ORDER_ID" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 5. No code? Cancel and get refunded (also happens automatically when time runs out) curl -X POST "$BASE/api/v1/cancel-number" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" \ -H "Content-Type: application/json" -d '{"order_id":"ORDER_ID"}'

Server 1 errors and how to fix them

CodeMessageFix
400Server 1 is temporarily switched offAn admin disabled Server 1. Check /api/numbers/servers and use Server 2 meanwhile.
400That service is not available for this country right nowSend country and service_id exactly as returned by /numbers/options.
400Insufficient balanceTop up. The charge is the price field from /numbers/options.
400Out of stock for that provider/countryRe-read /numbers/options (or /api/numbers/live-services) and pick another. Nothing was charged.
401UnauthorizedMissing/revoked X-API-Key + X-API-Secret, check both headers.
404Order not foundUse the order_id exactly as returned by the buy call — it belongs to your account only.
502Provider unreachableUpstream hiccup. Retry the same call after a few seconds; nothing was charged.

Numbers — Server 2 (all countries)

Server 2 has numbers from every country for hundreds of services, with live stock and prices. Always call in this order: service → country → price pool → buy → poll code. Use your API key headers on every call. Codes are read with the same /api/v1/get-sms and refunds with /api/v1/cancel-number as Server 1.
MethodEndpointQuery / BodyReturns
GET/api/v1/numbers/server2/servicessearch (optional)[{ code, name, popular }]
GET/api/v1/numbers/server2/countriesservice (required)[{ id, name, count, price }] cheapest first
GET/api/v1/numbers/server2/providersservice, countryPrice pools [{ label, maxPrice, price, count }]
GET/api/v1/numbers/server2/operatorscountryOperators (optional — skip to use any)
POST/api/v1/numbers/server2/buy{ service, country, maxPrice, operator? }{ order_id, number, price, expiresAt, status }

Full flow

# 1. Find the service code curl "$BASE/api/v1/numbers/server2/services?search=whatsapp" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 2. Countries with stock for that service curl "$BASE/api/v1/numbers/server2/countries?service=wa" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 3. Price pools for service + country curl "$BASE/api/v1/numbers/server2/providers?service=wa&country=187" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 4. Buy — send the pool's maxPrice exactly as returned curl -X POST "$BASE/api/v1/numbers/server2/buy" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" \ -H "Content-Type: application/json" \ -d '{"service":"wa","country":"187","maxPrice":0.42}' # 5. Poll the code curl "$BASE/api/v1/get-sms?order_id=ORDER_ID" -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET"

Server 2 errors and how to fix them

StatusMessage you'll seeFix
400Server 2 is temporarily switched offAn admin disabled Server 2 in the admin panel. Use Server 1, or wait until it's switched back on — retrying won't help.
400service is required / service and country are requiredYou skipped a step. The order is fixed: services → countries → providers. Never guess a country id; take it from the countries response.
400Please re-pick service, country and providerYour buy body is missing one of service, country, maxPrice, or maxPrice came through as 0. Send the pool's maxPrice exactly as returned (a decimal, not the ₦ price).
400That provider just sold out — please pick another oneStock moves constantly. Re-call /providers and pick a fresh pool. Nothing was charged.
400Insufficient balanceTop up your wallet. The ₦ amount charged is the pool's price field, not maxPrice.
400Provider did not return a numberUpstream hiccup. Nothing was charged — just retry, and if it repeats pick a different pool or country.
401UnauthorizedSend X-API-Key and X-API-Secret on every call.
502Any upstream error textThe upstream number provider is unreachable or rejected the request. Wait a few seconds and retry the same call — this is never caused by your request body.
Golden rule: price and stock are re-verified server-side at the moment of purchase, so a stale pool can only ever fail the buy — it can never overcharge you. Any failed buy leaves your balance untouched.

Boost API — social media growth (v1)

Resell followers, likes, views and subscribers from your own app. Same catalogue, same prices and the same upstream panel that powers the KLS Boost page. Every call uses your X-API-Key / X-API-Secret pair, and orders are charged to your KLS wallet in NGN.

There are no webhooks. The upstream panel does not send callbacks, so neither do we — poll GET /api/v1/boost/order/:id (it refreshes live from the provider on every call). Once every 2–5 minutes is plenty.
MethodEndpointBody / QueryReturns
GET /api/v1/boost/services platform, search (both optional) Catalogue: serviceId, name, platform, min, max, refill, pricePer1000Ngn
POST /api/v1/boost/quote { serviceId, quantity } Exact priceNgn — nothing is charged
POST /api/v1/boost/order { serviceId, link, quantity } orderId, status, priceNgn, new balanceNgn
GET /api/v1/boost/order/:orderId — Live status: status, bucket, startCount, remains
GET /api/v1/boost/orders status=all|pending|delivered|failed, limit 1–200 Your boost order history, newest first
POST /api/v1/boost/order/:orderId/refill — Requests a refill (completed orders on refill-enabled services only)
GET /api/v1/boost/balance — { balanceNgn, currency }

Full flow with cURL — browse, price, order, then poll.

# 1. Find a service curl "$BASE/api/v1/boost/services?platform=Instagram&search=followers" \ -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" # 2. Price 500 followers (nothing is charged) curl -X POST "$BASE/api/v1/boost/quote" \ -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" \ -H "Content-Type: application/json" \ -d '{"serviceId":"1435","quantity":500}' # 3. Place the order (wallet is debited, auto-refunded if the provider rejects it) curl -X POST "$BASE/api/v1/boost/order" \ -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET" \ -H "Content-Type: application/json" \ -d '{"serviceId":"1435","link":"https://instagram.com/yourpage","quantity":500}' # 4. Poll until bucket != "pending" curl "$BASE/api/v1/boost/order/ORDER_ID_HERE" \ -H "X-API-Key: $KEY" -H "X-API-Secret: $SECRET"

Node.js — with the error handling you actually want in production.

const BASE = 'https://klslogs.com'; const HEADERS = { 'Content-Type': 'application/json', 'X-API-Key': process.env.KLS_API_KEY, 'X-API-Secret': process.env.KLS_API_SECRET, }; async function kls(path, options = {}) { const res = await fetch(BASE + path, { ...options, headers: HEADERS }); const text = await res.text(); let body; try { body = JSON.parse(text); } catch { throw new Error(`Non-JSON reply (HTTP ${res.status}): ${text.slice(0, 200)}`); } if (!res.ok || body.ok === false) { const err = new Error(body.error || `HTTP ${res.status}`); err.status = res.status; err.retryable = res.status === 502 || res.status === 503; throw err; } return body; } async function boost(link, quantity) { const { services } = await kls('/api/v1/boost/services?platform=Instagram&search=followers'); const service = services.find(s => quantity >= s.min && quantity <= s.max); if (!service) throw new Error('No service accepts that quantity'); const quote = await kls('/api/v1/boost/quote', { method: 'POST', body: JSON.stringify({ serviceId: service.serviceId, quantity }), }); const { balanceNgn } = await kls('/api/v1/boost/balance'); if (balanceNgn < quote.priceNgn) throw new Error('Top up your KLS wallet first'); const order = await kls('/api/v1/boost/order', { method: 'POST', body: JSON.stringify({ serviceId: service.serviceId, link, quantity }), }); for (;;) { // no webhooks upstream — poll await new Promise(r => setTimeout(r, 120000)); const { order: o } = await kls(`/api/v1/boost/order/${order.orderId}`); if (o.bucket !== 'pending') return o; } } boost('https://instagram.com/yourpage', 500) .then(o => console.log('Finished:', o.status)) .catch(e => console.error('Boost failed:', e.message, '| retryable:', !!e.retryable));

PHP — same flow with cURL and proper exceptions.

<?php function kls($path, $method = 'GET', $payload = null) { $ch = curl_init('https://klslogs.com' . $path); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_TIMEOUT => 40, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-Key: ' . getenv('KLS_API_KEY'), 'X-API-Secret: ' . getenv('KLS_API_SECRET'), ], ]); if ($payload !== null) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); $raw = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); $cerr = curl_error($ch); curl_close($ch); if ($raw === false) throw new Exception("Network error: $cerr"); $data = json_decode($raw, true); if (json_last_error() !== JSON_ERROR_NONE) throw new Exception("Non-JSON reply (HTTP $status)"); if ($status >= 400 || (isset($data['ok']) && $data['ok'] === false)) throw new Exception(($data['error'] ?? "HTTP $status") . " [$status]"); return $data; } try { $quote = kls('/api/v1/boost/quote', 'POST', ['serviceId' => '1435', 'quantity' => 500]); echo "Price: NGN {$quote['priceNgn']}\n"; $order = kls('/api/v1/boost/order', 'POST', [ 'serviceId' => '1435', 'link' => 'https://instagram.com/yourpage', 'quantity' => 500, ]); echo "Order {$order['orderId']} placed\n"; $state = kls('/api/v1/boost/order/' . $order['orderId']); echo "Status: {$state['order']['status']}\n"; } catch (Exception $e) { echo 'Boost failed: ' . $e->getMessage() . "\n"; }

Boost errors and how to fix them

StatusMeaningFix
400quantity out of range / bad linkThe response names the field. Quantity must sit between the service's min and max; the link must be a full http(s):// URL.
401Missing or invalid key pairCheck both headers, or regenerate in Settings → API Access.
402Insufficient wallet balanceTop up, then retry. Never blind-retry this one.
404Unknown serviceId or orderRe-fetch /services — the panel drops services regularly.
502Provider rejected or unreachableNothing was charged — your wallet is refunded inside the same request. Retry after a minute.
503Boosting switched offAn admin disabled it, or the provider key is missing. Retry later.
Idempotency: POST /order is not idempotent. If a request times out on your side, call GET /api/v1/boost/orders?limit=5 to check whether it landed before sending it again.

Errors

StatusMeaningWhat to do
401Missing or invalid API key/secretDouble-check the X-API-Key/X-API-Secret headers are set and match exactly what's shown in Settings API Access. Regenerating your key there invalidates the old one immediately.
403Account restrictedYour account has been limited — contact support, this isn't something a retry fixes.
404Listing not found or no longer availableRe-fetch /listings or /numbers/options — the item may have sold out or been removed since you last checked.
400Insufficient balance, sold out, or invalid requestCheck the response body's error field for the specific reason — it's always a plain-English message, not just the code.
402Insufficient balance (numbers endpoints)Deposit funds before retrying — no partial/temporary state is created, so it's safe to just retry once the balance is topped up.
409No numbers currently available for that provider/countryThis is temporary stock, not a config issue — wait a few seconds and retry, or check /numbers/options again in case that provider/country is no longer listed at all.
Numbers specifically: your money is only ever taken if a real number was actually issued — a failed /buy-number call never touches your balance, so it's always safe to just retry. Once you do have an order, it auto-refunds on its own if no code arrives in time — you don't have to call /cancel-number unless you want your balance back sooner than that.
Back to Settings