Advertisement

logo
APIDocumentationPricing

Documentation

Welcome to the API documentation - your comprehensive source for real-time and historical financial market data. Our API provides access to commodities, currencies, forex rates, treasury yields, stock prices, and global market indexes.

Base URL:https://api.financialdata.com/api/v1

Commodities

Access real-time and historical commodity prices including gold, silver, oil, natural gas, copper, and agricultural products.

Endpoints

EndpointDescriptionParameters
GET /commoditiesGet all commodities with their current pricesNone
GET /commodities/:codeGet a specific commodity by its codecode - Commodity code (e.g., GOLD, SILVER, OIL)
GET /commodities/:code/historyGet complete price history for a commoditycode - Commodity code
GET /commodities/:code/history/period/:periodGet price history for a specific time periodcode - Commodity code
period - Time period (e.g., 1d, 1w, 1m, 3m, 6m, 1y)
GET /commodities/:code/history/latestGet the latest price entry for a commoditycode - Commodity code

Example Response

{ "status": "success", "data": { "code": "GOLD", "name": "Gold", "current_price": 2150.45, "change": 12.30, "change_percent": 0.58, "previous_close": 2138.15, "high_24h": 2155.20, "low_24h": 2135.80, "volume": 15234000, "updated_at": "2024-01-15T14:30:00Z" } }

Currencies (Forex)

Live and historical foreign exchange rates for major and minor currency pairs.

Endpoints

EndpointDescriptionParameters
GET /forexGet all forex currency pairs with current ratesNone
GET /forex/:codeGet a specific forex pair by its codecode - Currency pair (e.g., EURUSD, GBPUSD, USDJPY)
GET /forex/:code/historyGet complete exchange rate history for a currency paircode - Currency pair code
GET /forex/:code/history/period/:periodGet exchange rate history for a specific time periodcode - Currency pair code
period - Time period (e.g., 1d, 1w, 1m, 3m, 6m, 1y)
GET /forex/:code/history/latestGet the latest exchange rate entry for a currency paircode - Currency pair code

Example Response

{ "status": "success", "data": { "code": "EURUSD", "name": "Euro / US Dollar", "bid": 1.0892, "ask": 1.0895, "spread": 0.0003, "change": 0.0021, "change_percent": 0.19, "updated_at": "2024-01-15T14:30:00Z" } }

Interbank Forex (Bank of Ghana Rates)

Average exchange rates between banks provided by the Bank of Ghana. These represent the interbank market rates.

Endpoints

EndpointDescriptionParameters
GET /interbank-pairsGet all interbank currency pairsNone
GET /interbank-pairs/:idGet an interbank pair by its database IDid - Database ID of the interbank pair
GET /interbank-pairs/code/:codeGet an interbank pair by currency codecode - Currency code (e.g., USD, EUR, GBP)
GET /interbank-pairs/bank/:bankCodeGet interbank rates for a specific bankbankCode - Bank identifier code
GET /interbank-pairs/:id/historyGet price history for an interbank pairid - Interbank pair ID
GET /price-history/:bankCode/period/:periodGet price history for a bank over a specific periodbankCode - Bank code
period - Time period (e.g., 1d, 1w, 1m)
GET /price-history/:bankCode/latestGet the latest price history entry for a bankbankCode - Bank code

Example Response

{ "status": "success", "data": { "code": "USD", "bank_code": "BOG", "bid_rate": 12.45, "ask_rate": 12.50, "mid_rate": 12.475, "change": 0.05, "change_percent": 0.40, "updated_at": "2024-01-15T14:30:00Z" } }

Market Indexes

Major global market indexes including FTSE 100, GSE Composite, S&P 500, Dow Jones, NASDAQ, DAX, and Nikkei.

Endpoints

EndpointDescriptionParameters
GET /indicesGet all market indexes with current valuesNone
GET /indices/:codeGet a specific index by its codecode - Index code (e.g., FTSE100, GSE, SPX)
GET /indices/:code/historyGet historical data for a specific indexcode - Index code

Example Response

{ "status": "success", "data": { "code": "GSE", "name": "Ghana Stock Exchange Composite Index", "value": 3450.25, "change": 15.50, "change_percent": 0.45, "previous_close": 3434.75, "high_52week": 3600.00, "low_52week": 3200.50, "updated_at": "2024-01-15T16:00:00Z" } }

Stocks & Equity

Comprehensive stock market data including company profiles, statistics, dividends, earnings, financials, and price history.

Company Information Endpoints

EndpointDescriptionParameters
GET /equity/profiles/:company_idGet company profile informationcompany_id - Company identifier
GET /equity/statistics/:company_idGet company statistics (P/E ratio, market cap, etc.)company_id - Company identifier
GET /equity/dividends/:company_idGet dividend history for a companycompany_id - Company identifier
GET /equity/earnings/:company_idGet earnings reports for a companycompany_id - Company identifier
GET /equity/financial/:company_idGet financial statements for a companycompany_id - Company identifier
GET /equity/holders/:company_idGet institutional and insider holdingscompany_id - Company identifier
GET /equity/company/:company_id/allGet all data for a company in one requestcompany_id - Company identifier

Price History Endpoints

EndpointDescriptionParameters
GET /equity/price-history/:company_idGet complete price history for a companycompany_id - Company identifier
GET /equity/price-history/:company_id/24hGet price history for last 24 hourscompany_id - Company identifier
GET /equity/price-history/:company_id/1wGet price history for last weekcompany_id - Company identifier
GET /equity/price-history/:company_id/3mGet price history for last 3 monthscompany_id - Company identifier
GET /equity/price-history/:company_id/6mGet price history for last 6 monthscompany_id - Company identifier
GET /equity/price-history/:company_id/ytdGet price history from year to datecompany_id - Company identifier
GET /equity/price-history/:company_id/1yGet price history for last yearcompany_id - Company identifier
GET /equity/price-history/:company_id/2yGet price history for last 2 yearscompany_id - Company identifier
GET /equity/price-history/:company_id/5yGet price history for last 5 yearscompany_id - Company identifier
GET /equity/price-history/:company_id/10yGet price history for last 10 yearscompany_id - Company identifier
GET /equity/price-history/:company_id/allGet all-time price historycompany_id - Company identifier

Market Analysis Endpoints

EndpointDescriptionParameters
GET /equity/exchange/:exchangeSymbol/top-gainersGet top gaining stocks on an exchangeexchangeSymbol - Exchange symbol (e.g., GSE, NYSE, NASDAQ)
GET /equity/exchange/:exchangeSymbol/top-losersGet top losing stocks on an exchangeexchangeSymbol - Exchange symbol
GET /equity/exchange/:exchangeSymbol/performance-by-industryGet performance metrics grouped by industryexchangeSymbol - Exchange symbol
GET /equity/exchange/:exchangeSymbol/market-moversGet stocks with highest volume and activityexchangeSymbol - Exchange symbol
GET /equity/gse/statusGet current market status for GSENone

Example Response

{ "status": "success", "data": { "company_id": "MTNGH", "name": "MTN Ghana", "current_price": 1.45, "change": 0.03, "change_percent": 2.11, "volume": 2500000, "market_cap": 2450000000, "pe_ratio": 12.5, "dividend_yield": 6.8, "updated_at": "2024-01-15T16:00:00Z" } }

Treasury Bonds

Government bond yields, treasury bills, notes, bonds, and yield curve data.

Endpoints

EndpointDescriptionParameters
GET /treasuryGet all treasury bonds and billsNone
GET /treasury/activeGet currently active treasury bondsNone
GET /treasury/highest-yieldingGet bonds with the highest yieldsNone
GET /treasury/:idGet a specific treasury bond by IDid - Treasury bond identifier

Example Response

{ "status": "success", "data": { "id": "TB-2024-001", "name": "Government of Ghana 5-Year Bond", "face_value": 1000, "coupon_rate": 14.5, "yield_to_maturity": 15.2, "maturity_date": "2029-01-15", "issue_date": "2024-01-15", "days_to_maturity": 1825, "current_price": 985.50, "updated_at": "2024-01-15T14:30:00Z" } }
📝 Note:

All GET endpoints accept an optional ?api_key=YOUR_API_KEY query parameter or you can include it in the request headers as X-API-Key. Rate limits apply based on your subscription tier.