BOCRA API Documentation

Learn how to use the BOCRA API to get network coverage, pricing, licenses, and more. Some endpoints require an API key.

1. Get Coverage (POST /api/coverage)

Description: Get network coverage for a specific location. Public endpoint.

cURL

curl -X POST https://bocra.65bugs.com/api/coverage \
-H "Content-Type: application/json" \
-d '{"location": "Gaborone"}'
    

Python

import requests

url = "https://bocra.65bugs.com/api/coverage"
data = {"location": "Gaborone"}

response = requests.post(url, json=data)
print(response.json())
    

Java

import java.net.http.*;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(new URI("https://bocra.65bugs.com/api/coverage"))
            .header("Content-Type", "application/json")
            .POST(BodyPublishers.ofString("{\"location\":\"Gaborone\"}"))
            .build();
        HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
    

JavaScript (Fetch)

fetch("https://bocra.65bugs.com/api/coverage", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({location: "Gaborone"})
})
.then(res => res.json())
.then(console.log);
    

Expected Result

{
  "status": "success",
  "data": {
    "Mascom": "4G",
    "Orange": "5G",
    "BTC": "3G"
  }
}
    

2. Get Pricing (GET /api/pricing)

Description: Retrieve pricing plans for all networks. Public endpoint.

cURL

curl https://bocra.65bugs.com/api/pricing
    

Python

import requests

response = requests.get("https://bocra.65bugs.com/api/pricing")
print(response.json())
    

Expected Result

{
  "status": "success",
  "data": {
    "Mascom": {"1GB":"P10","5GB":"P45"},
    "Orange": {"1GB":"P12","5GB":"P50"},
    "BTC": {"1GB":"P9","5GB":"P40"}
  }
}
    

3. Get Performance (POST /api/performance)

Description: Returns network performance data. Requires API key.

cURL

curl -X POST https://bocra.65bugs.com/api/performance \
-H "Content-Type: application/json" \
-H "x-api-key: BOCRA123"
    

Python

import requests

headers = {"x-api-key": "BOCRA123"}
response = requests.post("https://bocra.65bugs.com/api/performance", headers=headers)
print(response.json())
    

Expected Result

{
  "status": "success",
  "data": {
    "Mascom": {"uptime":"98%","avg_speed":"25Mbps"},
    "Orange": {"uptime":"97%","avg_speed":"30Mbps"},
    "BTC": {"uptime":"95%","avg_speed":"15Mbps"}
  }
}
    

⚠️ Note: Replace API key with a valid key when using protected endpoints.