Amigo for Developers

Data vending API (MTN & Glo) — simple, fast, familiar.

Authenticate with an API key, send a JSON payload you already know, and get instant results. Airtel & 9mobile are marked as Coming soon.

cURL Preview
curl --location 'https://amigo.ng/api/data/' \
--header 'X-API-Key: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "network": 1,
  "mobile_number": "09012345678",
  "plan": 1001,
  "Ported_number": true
}'
Familiar payload: network, mobile_number, plan, Ported_number.

Quickstart

  1. Get your API token from your Amigo dashboard.
  2. Pick a plan from the catalog below (MTN (id 1), Glo (id 2)).
  3. Send a POST to https://amigo.ng/api/data/ with headers:
    X-API-Key: <YOUR_API_TOKEN>, Content-Type: application/json.
Auth tips: You can also send Authorization: Token <TOKEN> (or Bearer). If your server strips the Authorization header (common on Apache), either use X-API-Key as above, or add:
# .htaccess or vhost
SetEnvIfNoCase Authorization "^(.*)" HTTP_AUTHORIZATION=$1
# or
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%1]
Node / fetch
fetch('https://amigo.ng/api/data/', {
  method:'POST',
  headers:{
    'X-API-Key':'YOUR_API_TOKEN',
    'Content-Type':'application/json',
    // 'Idempotency-Key':'YOUR-UUID-OPTIONAL' // recommended
  },
  body:JSON.stringify({
    network: 1,
    mobile_number: '09012345678',
    plan: 1001,
    Ported_number: true
  })
}).then(r=>r.json()).then(console.log);
PHP (cURL)
<?php
$ch = curl_init('https://amigo.ng/api/data/');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'X-API-Key: YOUR_API_TOKEN',
    'Content-Type: application/json',
    // 'Idempotency-Key: YOUR-UUID-OPTIONAL'
  ],
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode([
    'network'=>1,
    'mobile_number'=>'09012345678',
    'plan'=>1001,
    'Ported_number'=>true
  ], JSON_UNESCAPED_UNICODE)
]);
$resp = curl_exec($ch);
http_response_code(curl_getinfo($ch, CURLINFO_RESPONSE_CODE));
curl_close($ch);
echo $resp;
Sandbox tip: send mobile_number starting with 090000 to simulate success without debiting.

Plan Catalog

Prices shown are computed as cost − agent_discount. Validity is in days.

MTN (network_id = 1)
MTN Plans
Plan IDCapacityValidityPrice (₦)
Glo (network_id = 2)
Glo Plans
Plan IDCapacityValidityPrice (₦)
Airtel (4), 9mobile (9)
Coming soon

Plan Efficiency

Efficiency is the successful delivery rate per plan (percentage). Higher is better.

MTN (network_id = 1)
MTN Plan Efficiency
Plan IDCapacityEfficiency
Glo (network_id = 2)
Glo Plan Efficiency
Plan IDCapacityEfficiency
API
GET /plans/efficiency

Response (example):

{
  "ok": true,
  "MTN": [
    { "plan_id": 1001, "data_capacity": 1.00, "validity": 30, "price": 449.00, "efficiency_percent": 98.5, "efficiency_label": "Excellent" }
  ],
  "Glo": [
    { "plan_id": 261, "data_capacity": 1.00, "validity": 30, "price": 439.00, "efficiency_percent": 93.0, "efficiency_label": "Good" }
  ]
}

Optional filters: ?network_id=1, ?min_eff=90

API Reference

Base URL

https://amigo.ng/api

Authentication

Recommended: header X-API-Key: <YOUR_API_TOKEN>.

Also supported: Authorization: Token <TOKEN> or Authorization: Bearer <TOKEN>. If using Authorization, ensure your server passes that header to PHP (see Quickstart note).

Purchase Data

POST /data/

Body (JSON):

{
  "network": 1,                // 1=MTN, 2=Glo
  "mobile_number": "09012345678",
  "plan": 1001,                // plan_id from the catalog
  "Ported_number": true        // true if the MSISDN is ported
}

Successful response (example):

{
  "success": true,
  "reference": "AMG-20250928203716-c40306",
  "message": "Dear Customer, You have successfully gifted 1GB data to 09012345678.",
  "network": 1,
  "plan": 1001,
  "amount_charged": 449,
  "status": "delivered"
}

Error response (examples):

{"success":false,"error":"invalid_token","message":"Your API token is not valid."}
{"success":false,"error":"plan_not_found","message":"Plan 1234 is not available on network 1."}
{"success":false,"error":"coming_soon","message":"Airtel is coming soon."}

Idempotency (recommended)

Send Idempotency-Key: <unique-uuid> to safely retry the same request.

Rate limits

Default: 1000 requests/minute (can be upgraded on request).

© 2025 Amigo — Built with ❤️ in Nigeria