mansaapi (Python)
Official Python SDK for Mansa API — African market data, bank codes, location, and financial identity in one clean REST layer.
Install
pip install mansaapi
Quick start
from mansaapi import MansaAPI
mansa = MansaAPI(api_key="mansa_live_sk_...")
# GTBank by code
bank = mansa.identity.get_bank("058")
print(bank["data"]["name"]) # "Guaranty Trust Bank (GTBank)"
print(bank["data"]["swift_code"]) # "GTBINGLA"
# Pan-African market movers
movers = mansa.markets.get_pan_african_movers(limit=10)
# Nigerian public holidays 2026
holidays = mansa.location.get_holidays("NG", 2026)
Get a free API key at mansaapi.com — 100 requests/day, no credit card.
Markets
mansa.markets.get_exchanges()
mansa.markets.get_stocks("NGX", sector="Banking", limit=20)
mansa.markets.get_stock("NGX", "GTCO")
mansa.markets.get_movers("NGX", type="gainers")
mansa.markets.get_pan_african_movers()
mansa.markets.get_indices("NGX")
mansa.markets.get_etfs("NGX")
mansa.markets.get_forex()
mansa.markets.get_commodities()
mansa.markets.search("Zenith", exchange="NGX")
Premium endpoints
Starter tier or higher for dividends, disclosures, recommendations. Pro tier for insider trades. See mansaapi.com/pricing.
mansa.markets.get_dividends("NGX", "GTCO") # Starter+
mansa.markets.get_disclosures("NGX", symbol="GTCO") # Starter+
mansa.markets.get_recommendations("NGX") # Starter+
mansa.markets.get_insider_trades("NGX", days=30) # Pro+
Identity
mansa.identity.get_banks() # all African banks
mansa.identity.get_banks(country="NG") # filter by country
mansa.identity.get_bank("057") # single bank by code
mansa.identity.get_mobile_networks(country="GH")
mansa.identity.lookup_mobile_network("08031234567")
mansa.identity.get_currencies()
mansa.identity.validate_nuban("0123456789", "058")
Location
mansa.location.get_countries()
mansa.location.get_country("NG")
mansa.location.get_states("NG")
mansa.location.get_lgas("NG", "LA") # Lagos LGAs
mansa.location.get_holidays("NG", 2026)
Error handling
from mansaapi import MansaAPI, MansaAPIError
mansa = MansaAPI(api_key="mansa_live_sk_...")
try:
data = mansa.markets.get_insider_trades("NGX")
except MansaAPIError as err:
print(err.code) # "TIER_REQUIRED"
print(err.status) # 403
print(err.message) # "This endpoint requires a professional tier key..."
Error codes
| Code | Status | Meaning |
|---|---|---|
INVALID_API_KEY |
401 | Key not found or revoked |
RATE_LIMIT_EXCEEDED |
429 | Daily request limit reached |
TIER_REQUIRED |
403 | Endpoint requires a higher tier |
NOT_FOUND |
404 | Resource not found |
UPSTREAM_ERROR |
502 | Upstream data source unreachable |
Supported exchanges
NGX (Nigeria), GSE (Ghana), NSE (Kenya), JSE (South Africa), BRVM (West Africa), DSE (Tanzania), LUSE (Zambia).
Links
Metadata
Release files for mansaapi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mansaapi-0.1.0.tar.gz | 4.7 kB | Without provenance | Details for mansaapi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mansaapi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mansaapi-0.1.0-py3-none-any.whl |
Total release size: 10.5 kB
Release files / mansaapi-0.1.0.tar.gz
| Download URL | mansaapi-0.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bce48a38b6dade87ff62cb5fcb3784b571bb729dc8cd44d22c08438aa35da38
|
|
BLAKE2b-256 checksum How to use checksums |
3279aa46847bf1ef87aab61ec37f368e716dd43fddff33b3fc9b2e37a3575541
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / mansaapi-0.1.0-py3-none-any.whl
| Download URL | mansaapi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f567bba28fbf3b223fbb7ee09546592f77d3d0e2fe674e72cc2c5de9c6e8570f
|
|
BLAKE2b-256 checksum How to use checksums |
4c049d6740394e7aa4a989cd6966e448d71c99ce4f32e0f973d610aa82157629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for mansaapi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.