Sitemap
Ntwanano Rikhotso

Ntwanano Rikhotso

Free JSE API

2 min readMar 14, 2021

--

Get real time Johannesburg Stock Exchange data for FREE

I have published a python package and an API endpoint that allows anyone to get real time JSE Stock data for free

yes!!! no signing up, no b*** 💩 you just plugin and play

The API returns

  • share
  • price
  • move
  • move change
  • market cap

How use the JSE Tracker python package

find the package here https://pypi.org/project/JSETracker/

  1. Install the JSE Tracker package
pip3 install JSETracker

2. Create a python file “call it whatever you want”, I am gonna call it main.py for this example.

main.py

from jsetracker import Stocksstock = Stocks()

The jsetracker package has a class called Stocks which has two methods

  1. get_all()

Get all returns all the stocks listed on the JSE

print(stock.get_all())

2. get()

Get Ntwanano Rikhotso’s stories in your inbox

Join Medium for free to get updates from this writer.

The get() method takes a JSE CODE of a stock as a parameter and returns data about the specified Stock

see this link to find the codes

print(stock("JSE CODE HERE"))

How to use the JSE Tracker API endpoint

You can access the end point here

https://jse-tracker.herokuapp.com/api/v1/

Please see the Javascript and axios API call implementation on CODEPEN

JSE Tracker Endpoint call implementation

We can easily make a get request to the endpoint using axios js

url = "https://jse-tracker.herokuapp.com/api/v1/";axios.get(url).then((data) => {
console.log(data):
});

We can also get a specific stock by passing the stocks JSE CODE

url = "https://jse-tracker.herokuapp.com/api/v1/";axios.get(url+ "JSE CODE" ).then((data) => {
console.log(data):
});

see my personal website ntwanano.me

follow me on facebook and github

--

--