Data API
Provide data bundles and plans for all major telecommunication networks.
Get Data Plans
Retrieve the available data plans categorized by network and plan type (e.g., SME, Gifting, Corporate).
GET
https://suruleredatacom.com.ng/api/data_plans
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
curl -X GET "https://suruleredatacom.com.ng/api/data/data_plans" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json"
<?php
$url = 'https://suruleredatacom.com.ng/api/data/data_plans';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Token YOUR_API_KEY',
'Content-Type: application/json',
]
]);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
?>
const response = await fetch('https://suruleredatacom.com.ng/api/data/data_plans', {
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/data/data_plans"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
Response
✓ 200 OK
{
[
{
"plan_id": 1,
"day": "30",
"type": "SME",
"network": "MTN",
"datasize": "500MB",
"price": 450
},
{
"plan_id": 2,
"day": "30",
"type": "SME",
"network": "MTN",
"datasize": "1GB",
"price": 650
}
]
}
Purchase Data Bundle
Purchase a specific data plan for a recipient's phone number.
POST
https://suruleredatacom.com.ng/api/data
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | String | Yes | Recipient phone number. |
| plan | Integer | Yes | Plan ID retrieved from the /data/plans endpoint. |
| bypass | Boolean | Yes | Set to true to skip number validation (or use Ported_number instead). |
| request-id | String | Optional | Idempotency key. |
curl -X POST "https://suruleredatacom.com.ng/api/data" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "08012345678",
"plan": 101,
"bypass": true,
"request-id": "data_123"
}'
<?php
$url = 'https://suruleredatacom.com.ng/api/data';
$payload = [
'phone' => '08012345678',
'plan' => 101,
'bypass' => true,
'request-id' => 'API_' . uniqid()
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
'Authorization: Token YOUR_API_KEY',
'Content-Type: application/json',
]
]);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
?>
const response = await fetch('https://suruleredatacom.com.ng/api/data', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '08012345678',
plan: 101,
bypass: true,
'request-id': 'data_123'
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://suruleredatacom.com.ng/api/data"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"phone": "08012345678",
"plan": 101,
"bypass": True,
"request-id": "data_123"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Responses
✓ 200 OK
{
"status": "success",
"Status": "successful",
"message": "Data Purchase Successful.",
"response": "MTN 1GB SME (30 Days) sent to 08012345678",
"api_response": "MTN 1GB SME (30 Days) sent to 08012345678",
"request-id": "API_66bbd45c67b7b",
"service": "data",
"amount": "250",
"old_balance": 5000,
"new_balance": 4750
}