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 shows you how to look up detailed information about companies listed on the Uganda Securities Exchange using their ticker symbols.

Getting company details

The getCompanyDetails() method retrieves comprehensive information about a specific company, including contact details, market capitalization, and listing information.

Basic company lookup

1

Initialize the library

<?php
include 'PortfolioManager.php';
$portfolioManager = new PortfolioManager();
2

Call getCompanyDetails()

Pass the company ticker symbol as a parameter:
$companyDetails = $portfolioManager->getCompanyDetails('BOBU');
print_r($companyDetails);
The ticker symbol must match exactly as it appears on the Uganda Securities Exchange. Common symbols include BOBU, UCL, UMEME, and others.

Code examples

<?php

include 'PortfolioManager.php';

$portfolioManager = new PortfolioManager();

// Get details for Bank of Baroda Uganda
$companyDetails = $portfolioManager->getCompanyDetails('BOBU');
print_r($companyDetails);

?>

Expected response

The getCompanyDetails() method returns a JSON object with the following structure:
{
  "companyName": "BOBU",
  "logoURL": "https://www.use.or.ug/sites/default/files/company_logos/bobu_logo.png",
  "isin": "UG0001000001",
  "listingDate": "January 15, 2002",
  "sharesIssued": "50,000,000",
  "marketCap": "UGX 75,000,000,000",
  "address": "Plot 18, Kampala Road, Kampala",
  "phone": "+256 414 233 680",
  "email": "info@bobu.co.ug",
  "website": "https://www.bobu.co.ug"
}

Response fields

FieldDescription
companyNameThe company’s ticker symbol
logoURLURL to the company’s logo image
isinInternational Securities Identification Number
listingDateDate the company was listed on the exchange
sharesIssuedTotal number of shares issued
marketCapCurrent market capitalization in UGX
addressCompany’s physical address
phoneContact phone number
emailContact email address
websiteCompany website URL

Practical use cases

Building a company directory

<?php

include 'PortfolioManager.php';

$portfolioManager = new PortfolioManager();

// Get all companies first
$allCompaniesJson = $portfolioManager->getAllPortfolioCompanies();
$allCompanies = json_decode($allCompaniesJson, true);

// Build a directory with full details
$directory = [];
foreach ($allCompanies as $company) {
    $ticker = $company[0];
    $detailsJson = $portfolioManager->getCompanyDetails($ticker);
    $details = json_decode($detailsJson, true);
    $directory[] = $details;
}

// Save to file or database
file_put_contents('company_directory.json', json_encode($directory, JSON_PRETTY_PRINT));

echo "Directory created with " . count($directory) . " companies.\n";

?>
Combine getAllPortfolioCompanies() with getCompanyDetails() to build a comprehensive database of all listed companies.

Creating a company profile page

<?php

include 'PortfolioManager.php';

$portfolioManager = new PortfolioManager();

// Get company from URL parameter (in a real application)
$ticker = $_GET['ticker'] ?? 'BOBU';

// Fetch company details
$detailsJson = $portfolioManager->getCompanyDetails($ticker);
$company = json_decode($detailsJson, true);

// Display in HTML
?>
<!DOCTYPE html>
<html>
<head>
    <title><?php echo $company['companyName']; ?> - Company Profile</title>
</head>
<body>
    <h1><?php echo $company['companyName']; ?></h1>
    <img src="<?php echo $company['logoURL']; ?>" alt="Company Logo">
    
    <h2>Market Information</h2>
    <p>Market Cap: <?php echo $company['marketCap']; ?></p>
    <p>Shares Issued: <?php echo $company['sharesIssued']; ?></p>
    <p>Listing Date: <?php echo $company['listingDate']; ?></p>
    <p>ISIN: <?php echo $company['isin']; ?></p>
    
    <h2>Contact Information</h2>
    <p>Address: <?php echo $company['address']; ?></p>
    <p>Phone: <?php echo $company['phone']; ?></p>
    <p>Email: <a href="mailto:<?php echo $company['email']; ?>"><?php echo $company['email']; ?></a></p>
    <p>Website: <a href="<?php echo $company['website']; ?>"><?php echo $company['website']; ?></a></p>
</body>
</html>

Error handling

The library will throw errors if the company ticker doesn’t exist or if the USE website is unavailable. Always wrap your calls in try-catch blocks for production use.
<?php

try {
    $portfolioManager = new PortfolioManager();
    $details = $portfolioManager->getCompanyDetails('INVALID');
    print_r($details);
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}

?>

Next steps

Market data

Learn how to retrieve historical market data and exchange rates

Build docs developers (and LLMs) love