Skip to main content

Official Python SDK for Mansa API — African market data, bank codes, location, and identity.

Project description

mansaapi (Python)

Official Python SDK for Mansa API — African market data, bank codes, location, and financial identity in one clean REST layer.

PyPI version License: MIT

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mansaapi-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mansaapi-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mansaapi-0.1.0.tar.gz.

File metadata

  • Download URL: mansaapi-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mansaapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5bce48a38b6dade87ff62cb5fcb3784b571bb729dc8cd44d22c08438aa35da38
MD5 6029a87e148f08704a67c63310fcef9a
BLAKE2b-256 3279aa46847bf1ef87aab61ec37f368e716dd43fddff33b3fc9b2e37a3575541

See more details on using hashes here.

File details

Details for the file mansaapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mansaapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mansaapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f567bba28fbf3b223fbb7ee09546592f77d3d0e2fe674e72cc2c5de9c6e8570f
MD5 d432cafee9c5fdcf51b15f6899564f17
BLAKE2b-256 4c049d6740394e7aa4a989cd6966e448d71c99ce4f32e0f973d610aa82157629

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page