Nabola Developer API

Build integrations with Nigeria's leading waste-to-cash platform.

The Nabola API allows verified partners to access platform data, create waste logs, query machine locations, and retrieve analytics. All API access requires a partner account approved by the Nabola team.

Partner Program: To get API access, contact nabolaafrica@gmail.com or visit /contact to apply.

Authentication

All API requests must include your API key in the X-API-Key header.

curl -H "X-API-Key: nbl_your_api_key_here" \
     https://bybimport.com/nabola.bybimport.com/public/api/v1/stats

Alternatively, pass it as a query parameter (not recommended for production):

https://bybimport.com/nabola.bybimport.com/public/api/v1/stats?api_key=nbl_your_api_key_here
Never expose your API key in client-side JavaScript or public repositories.

Base URL

https://bybimport.com/nabola.bybimport.com/public/api/v1

All endpoints are relative to this base URL. The API returns JSON responses.

Error Handling

The API uses standard HTTP status codes. All error responses include an error field.

CodeMeaning
200Success
201Created
400Bad Request — invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — insufficient permissions
404Not Found
422Validation Error
429Rate Limit Exceeded
500Server Error
// Error response example
{
  "error": "Permission denied. Your key does not have 'read_waste' access."
}

Rate Limits

API requests are limited to 60 requests per minute per API key. Rate limit headers are included in every response:

X-RateLimit-Remaining: 58
X-Nabola-Version: 1.0

Health Check

GET /api/health No authentication required

Check if the API is online.

{
  "status": "ok",
  "version": "1.0",
  "service": "Nabola API",
  "time": "2026-04-07T10:00:00+01:00"
}

Partner Info

GET /api/v1/me

Returns information about the authenticated partner account.

{
  "success": true,
  "data": {
    "company_name": "EcoTech Nigeria",
    "company_type": "tech",
    "status": "active",
    "permissions": ["read_stats", "read_machines"],
    "api_calls": 1247,
    "last_used": "2026-04-07T09:45:00+01:00",
    "member_since": "2026-04-01"
  }
}

Platform Stats

GET /api/v1/stats

Returns real-time platform statistics.

{
  "success": true,
  "data": {
    "total_users": 12500,
    "total_waste_logs": 48000,
    "confirmed_pickups": 32000,
    "total_kg_recycled": 98500.5,
    "total_co2_saved": 246251.25,
    "active_machines": 5,
    "timestamp": "2026-04-07T10:00:00+01:00"
  }
}

Machines

GET /api/v1/machines

Returns a paginated list of active Nabola recycling machines.

Query Parameters

ParameterTypeRequiredDescription
statestringoptionalFilter by Nigerian state
lgastringoptionalFilter by LGA
pageintegeroptionalPage number (default: 1)
curl -H "X-API-Key: YOUR_KEY" \
     "https://bybimport.com/nabola.bybimport.com/public/api/v1/machines?state=Lagos"

Waste Logs

GET /api/v1/waste-logs read_waste

Returns paginated waste logs. Requires read_waste permission.

Query Parameters

ParameterTypeRequiredDescription
statusstringoptionalpending, confirmed, rejected
fromdateoptionalStart date (YYYY-MM-DD)
todateoptionalEnd date (YYYY-MM-DD)
per_pageintegeroptionalResults per page (max: 100)

Create Waste Log

POST /api/v1/waste-logs create_waste

Creates a new waste log for a registered Nabola user.

Request Body (JSON)

FieldTypeRequiredDescription
user_emailstringrequiredEmail of registered Nabola user
waste_categorystringrequiredplastic, metal, glass, organic, electronic, mixed
weight_kgnumberrequiredWeight in kilograms (min: 0.1)
addressstringrequiredCollection address
notesstringoptionalAdditional notes
curl -X POST \
     -H "X-API-Key: YOUR_KEY" \
     -H "Content-Type: application/json" \
     -d '{"user_email":"user@example.com","waste_category":"plastic","weight_kg":2.5,"address":"123 Lagos Street"}' \
     https://bybimport.com/nabola.bybimport.com/public/api/v1/waste-logs

Users

GET /api/v1/users/{email} read_users

Look up a Nabola user by email address.

curl -H "X-API-Key: YOUR_KEY" \
     https://bybimport.com/nabola.bybimport.com/public/api/v1/users/user@example.com

Analytics

GET /api/v1/analytics read_stats

Returns daily recycling analytics and state-level breakdowns.

ParameterTypeDescription
daysintegerNumber of days to look back (max: 90, default: 30)

Permissions

PermissionDescription
read_statsAccess platform statistics and analytics
read_machinesAccess machine directory (included by default)
read_wasteRead waste logs and pickup data
create_wasteCreate new waste logs for users
read_usersLook up user profiles by email

Webhooks

Configure a webhook URL in your partner dashboard to receive real-time events. Nabola will send a POST request to your URL when events occur.

Event Types

EventDescription
waste_log.confirmedA waste pickup has been confirmed
waste_log.createdA new waste log was submitted
user.registeredA new user joined the platform
// Webhook payload example
{
  "event": "waste_log.confirmed",
  "timestamp": "2026-04-07T10:00:00+01:00",
  "data": {
    "id": 1234,
    "user_email": "user@example.com",
    "weight_kg": 2.5,
    "coins_earned": 50,
    "status": "confirmed"
  }
}

SDKs & Examples

JavaScript / Node.js

const response = await fetch('https://bybimport.com/nabola.bybimport.com/public/api/v1/stats', {
  headers: { 'X-API-Key': 'nbl_your_key_here' }
});
const data = await response.json();
console.log(data.data.total_users);

Python

import requests

headers = {'X-API-Key': 'nbl_your_key_here'}
r = requests.get('https://bybimport.com/nabola.bybimport.com/public/api/v1/stats', headers=headers)
print(r.json()['data']['total_kg_recycled'])

PHP

$ch = curl_init('https://bybimport.com/nabola.bybimport.com/public/api/v1/stats');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: nbl_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
echo $data['data']['total_users'];

Support

For API support, partnership inquiries, or to report issues: