SDKs & Libraries - Developers

Home / SDKs & Libraries - Developers

SDKs & Libraries

Use our official SDKs to integrate RukkyHub faster. All SDKs use the same action-based API pattern under the hood. SDK packages are coming soon. In the meantime, use the raw cURL or PHP examples below.

</>
PHP
Composer package for Laravel & PHP projects
composer require rukkyhub/php
{}
JavaScript
NPM package for Node.js & browser apps
npm install rukkyhub-js
:)
Python
PyPI package for Python projects
pip install rukkyhub-python
All SDKs send POST requests to the single API endpoint with action, key, and other parameters. The raw cURL approach works with any language.

PHP Example (cURL)

<?php
$apiUrl = "https://developers.rukkyhub.com/api/v1";
$apiKey = getenv("SMM_API_KEY");

function rukkyhub_request($url, $key, $data) {
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => http_build_query($data),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CONNECTTIMEOUT => 10,
        CURLOPT_TIMEOUT => 20,
        CURLOPT_HTTPHEADER => [
            "X-API-KEY: {$key}",
            "Accept: application/json",
        ],
    ]);
    $raw = curl_exec($ch);
    $http = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($raw === false) throw new Exception("cURL error");
    return json_decode($raw, true);
}

// Check balance
$result = rukkyhub_request($apiUrl, $apiKey, ["action" => "balance"]);
print_r($result);

// Place an SMM order
$order = rukkyhub_request($apiUrl, $apiKey, [
    "action" => "add",
    "service" => 123,
    "link" => "https://example.com",
    "quantity" => 1000
]);
echo "Order ID: " . $order["order"];

// Buy airtime
$vtu = rukkyhub_request($apiUrl, $apiKey, [
    "action" => "vtu_airtime",
    "service_name" => "mtn",
    "phone" => "08012345678",
    "amount" => 100,
    "pin" => "1234"
]);
print_r($vtu);

Node.js Example (fetch)

const apiUrl = "https://developers.rukkyhub.com/api/v1";
const apiKey = process.env.SMM_API_KEY;

async function rukkyhubRequest(action, params = {}) {
  const body = new URLSearchParams({ ...params, action });
  const res = await fetch(apiUrl, {
    method: "POST",
    headers: {
      "X-API-KEY": apiKey,
      "Content-Type": "application/x-www-form-urlencoded",
      "Accept": "application/json"
    },
    body
  });
  return res.json();
}

// Check balance
const balance = await rukkyhubRequest("balance");
console.log(balance);

// Place SMM order
const order = await rukkyhubRequest("add", {
  service: 123,
  link: "https://example.com",
  quantity: 1000
});
console.log("Order ID:", order.order);

// Buy MTN airtime
const vtu = await rukkyhubRequest("vtu_airtime", {
  service_name: "mtn",
  phone: "08012345678",
  amount: 100,
  pin: "1234"
});
console.log(vtu);

Python Example (requests)

import os
import requests

API_URL = "https://developers.rukkyhub.com/api/v1"
API_KEY = os.environ["SMM_API_KEY"]

def rukkyhub_request(action, **params):
    data = {"action": action, **params}
    headers = {"X-API-KEY": API_KEY, "Accept": "application/json"}
    resp = requests.post(API_URL, data=data, headers=headers)
    return resp.json()

# Check balance
print(rukkyhub_request("balance"))

# Place SMM order
order = rukkyhub_request("add", service=123, link="https://example.com", quantity=1000)
print(f"Order ID: {order['order']}")

# Buy airtime
vtu = rukkyhub_request("vtu_airtime", service_name="mtn", phone="08012345678", amount=100, pin="1234")
print(vtu)

Supported Service Interfaces

Secure payment gateways, automation providers, and infrastructure.

Rukkyhub processes personal data only to provide services, ensure security, and meet legal requirements. We do not sell user data. By using this site, you consent to our data processing in accordance with GDPR. learn more

Allow