DEV Community

Cover image for I built a free African Stock Market API because the official data cost $19,500/year
Asare Baffour King David
Asare Baffour King David

Posted on

I built a free African Stock Market API because the official data cost $19,500/year

The Problem

I needed live data from the Ghana Stock Exchange (GSE) for a project.

The reality of financial data in Africa is a massive barrier to entry:

  • Official GSE Data: Costs $19,500 yearly to license.
  • Alternatives: Everything else was out-of-date, broken, or required an enterprise license.

That's why I created it.

The Solution: AfricanMarkets

AfricanMarkets is a TypeScript REST API providing live and historical data for the Ghana Stock Exchange (GSE) and Nigerian Exchange (NGX). Itโ€™s designed to be fast, free, and developer-friendly.

Technical Approach

All the data was there, hiding in the open. I used got-scraping and Regex to extract data points directly from the Highcharts JS embedded on existing public pages.

The pattern looks like this:
[[d("2018-09-03"), 0.75], ...] โ€” which gives us roughly 1,900 data points per ticker, dating all the way back to the IPO.

Tech Stack:

  • Backend: Node.js, Express, TypeScript, Cheerio
  • Dashboard: Next.js
  • Deployment: Render + Vercel

Why this matters

Innovation in African Fintech is often hindered by the sheer cost of data. This API is my contribution to lowering that barrier and allowing developers to build the next generation of financial tools without a $20k overhead.

Live Links

GitHub logo abkd1211 / african-markets-api

Open financial data infrastructure for African markets. GSE + NGX, normalized JSON, built for the global developer economy.

๐ŸŒ African Markets

The definitive data layer for African financial markets.

Project Status: Active Tech Stack Markets Support

African Markets is a high-performance, developer-first platform designed to bridge the data gap in African stock exchanges. It provides real-time and historical data for the Ghana Stock Exchange (GSE) and the Nigerian Exchange (NGX), offering both a premium web dashboard and a robust API for builders.


๐Ÿš€ Vision: The AI-Ready Data Layer

We are building more than just a dashboard. We are establishing the standard data primitive for African finance.

  • Current Stage: Web Dashboard + REST API
  • Upcoming Stage: MCP (Model Context Protocol) โ€” enabling AI agents (Claude, ChatGPT, etc.) to query African market data natively.

๐Ÿ›  Features

๐Ÿ“ˆ Comprehensive Market Data

  • Real-time Tickers: Live prices and daily performance for GSE and NGX.
  • Historical Analysis: 10+ years of historical price data with interactive charts.
  • Company Profiles: In-depth information for listed companies.

๐Ÿ•ธ Professional API

  • Scraper Adapters: Intelligent, resilientโ€ฆ

โ†’ Live Dashboard: african-markets.vercel.app

Next Steps

Currently, I'm developing professional MCP (Model Context Protocol) servers for AI agents. If you are developing an AI agent that would benefit from real-time African market data, reach out!


typescript #api #fintech #africa #webdev #showdev

Top comments (0)