### Install mansaapi via pip Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Install the official Python SDK for Mansa API using pip. ```bash pip install mansaapi ``` -------------------------------- ### Quick start with MansaAPI Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Initialize the client with an API key and use identity, markets, and location endpoints. Prints bank name and SWIFT code for GTBank. ```python 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) ``` -------------------------------- ### Error handling with MansaAPIError Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Catch MansaAPIError to access error code, status, and message. Example shows TIER_REQUIRED error. ```python 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..." ``` -------------------------------- ### MansaAPI(api_key) Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Initializes the Mansa API client with your API key. This is the entry point for all API calls. ```APIDOC ## MansaAPI(api_key) ### Description Initializes the Mansa API client with your API key. This is the entry point for all API calls. ### Parameters - **api_key** (string) - Required - Your Mansa API key. ### Example ```python from mansaapi import MansaAPI mansa = MansaAPI(api_key="mansa_live_sk_...") ``` ``` -------------------------------- ### Premium market endpoints Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Endpoints requiring Starter or Pro tier: dividends, disclosures, recommendations, and insider trades. ```python 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+ ``` -------------------------------- ### Markets endpoints Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md List of market data methods: exchanges, stocks, movers, indices, ETFs, forex, commodities, and search. ```python 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") ``` -------------------------------- ### Location endpoints Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Country, state, LGA, and holiday data methods. ```python 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) ``` -------------------------------- ### Identity endpoints Source: https://github.com/heyzod/mansaapi-python/blob/main/README.md Bank, mobile network, currency, and NUBAN validation methods. ```python 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") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.