Skip to main content

Introduction

The Ubu-Block REST API provides endpoints for submitting election results, querying blockchain data, and accessing regional information. All responses are returned in JSON format.

Base URL

http://localhost:3000

Authentication

Currently, the API does not require authentication for read operations. Write operations (submitting results) are validated through blockchain cryptographic signatures embedded in the block data.

Response Format

All API responses return JSON data. Successful requests return a 200 status code with the requested data. Error responses include appropriate HTTP status codes.

Example Response

{
  "county_code": 1,
  "county_name": "Nairobi"
}

Error Handling

The API returns standard HTTP status codes:
  • 200 - Success
  • 400 - Bad Request
  • 404 - Not Found
  • 500 - Internal Server Error

Rate Limiting

There are currently no rate limits enforced on the API.

API Sections

Blocks

Query blockchain blocks and submit new results

Results

Access election results and candidate data

Regional Data

Query counties, constituencies, wards, and polling stations

Build docs developers (and LLMs) love