suruleredatacom API Documentation
Everything you need to integrate airtime, data, cable TV, electricity, and exam services into your application.
Base URL
All API requests should be made to the following base URL:
/airtime maps to https://suruleredatacom.com.ng/api/airtime.
Authentication
The suruleredatacom API uses token-based authentication. You must include your API key in the Authorization header of every request.
Getting Your API Key
- Log in to your suruleredatacom Dashboard
- Navigate to Developer Tools → API Keys
- Generate a new API key or copy your existing one
Authorization Header
Include your API key using the Authorization header with either the Bearer or Token prefix:
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Required | Your API key prefixed with Bearer or Token. |
| Content-Type | String | Required | Must be application/json for all POST requests. |
curl -X GET "https://suruleredatacom.com.ng/api/get-networks?service=airtime" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json"
<?php
$url = 'https://suruleredatacom.com.ng/api/get-networks?service=airtime';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Token YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_TIMEOUT => 30,
]);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
}
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
?>
const response = await fetch(
'https://suruleredatacom.com.ng/api/get-networks?service=airtime',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
}
);
const data = await response.json();
console.log(data);
import requests
url = 'https://suruleredatacom.com.ng/api/get-networks'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
}
params = {'service': 'airtime'}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
Rate Limiting
To ensure fair usage and protect our infrastructure, API requests are rate limited. If you exceed the limit, you will receive a 429 Too Many Requests response.
| Plan | Rate Limit | Burst |
|---|---|---|
| Standard | 100 requests/minute | 120 requests |
| Premium | 500 requests/minute | 600 requests |
Rate limit headers are included in every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1693420800
Response Format
All API responses are returned in JSON format. Every response includes a status field and relevant data or error information.
Success Response
{
"status":"success",
"Status":"successful",
"message":"CORPORATE 1GB Data Purchase To 09029163515 ",
"response":"CORPORATE 1GB Data Purchase To 09029163515 "
"api_response":"CORPORATE 1GB Data Purchase To 09029163515 "
}
}
Error Response
{
"status":"fail",
"Status":"failed",
"message":"CORPORATE 1GB Data Purchase To 09029163515 ",
"response":"CORPORATE 1GB Data Purchase To 09029163515 "
"api_response":"CORPORATE 1GB Data Purchase To 09029163515 "
}
HTTP Status Codes
The API uses standard HTTP status codes to indicate the outcome of each request.
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request was successful. |
| 201 | Created | Resource created successfully. |
| 400 | Bad Request | The request was malformed or missing required parameters. |
| 401 | Unauthorized | Invalid or missing API key. |
| 403 | Forbidden | You do not have permission to access this resource. |
| 404 | Not Found | The requested endpoint does not exist. |
| 422 | Unprocessable Entity | Validation failed (e.g., insufficient balance, invalid phone number). |
| 429 | Too Many Requests | Rate limit exceeded. Slow down and retry. |
| 500 | Internal Server Error | Something went wrong on our end. Contact support. |