Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jessebyarugaba/Unofficial-Uganda-Securities-Exhange-API/llms.txt

Use this file to discover all available pages before exploring further.

This guide demonstrates the basic usage of the Uganda Securities Exchange API library, showing you how to instantiate the class and make simple method calls.

Installation

1

Include the library

First, include the PortfolioManager class in your PHP file:
<?php
include 'PortfolioManager.php';
2

Create an instance

Instantiate the PortfolioManager class:
$portfolioManager = new PortfolioManager();
The constructor doesn’t require any parameters. The library will handle all API connections automatically.
3

Make your first API call

Start retrieving data from the Uganda Securities Exchange:
// Get all listed companies
$allCompanies = $portfolioManager->getAllPortfolioCompanies();
print_r($allCompanies);

Complete example

Here’s a complete working example that demonstrates basic instantiation and usage:
<?php

include 'PortfolioManager.php';

// Create instance
$portfolioManager = new PortfolioManager();

// Get all portfolio companies
$allCompanies = $portfolioManager->getAllPortfolioCompanies();
print_r($allCompanies);

?>

Expected output

The getAllPortfolioCompanies() method returns JSON data with all listed companies on the Uganda Securities Exchange:
[
  [
    "BOBU",
    "1,500",
    "https://www.use.or.ug/listed/BOBU"
  ],
  [
    "UCL",
    "2,300",
    "https://www.use.or.ug/listed/UCL"
  ],
  [
    "UMEME",
    "450",
    "https://www.use.or.ug/listed/UMEME"
  ]
]
Each array contains the company ticker symbol, current share price, and a direct URL to the company’s listing page.

Available methods

The PortfolioManager class provides four main methods:
MethodDescription
getAllPortfolioCompanies()Returns all companies listed on the exchange
getCompanyDetails($companyName)Returns detailed information about a specific company
getPortfolioCompanyData($companyName)Returns historical market data for a company
getExchangeRateDetails()Returns current UGX exchange rate information

Next steps

Company lookup

Learn how to retrieve detailed information about specific companies

Market data

Explore how to work with historical market data and exchange rates

Build docs developers (and LLMs) love