Getting day gainers and losers data for trading.


One of the traders everyday activities is catching the stocks trends and using statistics on day gainers and loosers you can deside to join the common market trend or on contrary to guess backward market direction. In our case we will use Python to access trading statistics from Mboum Finance Official API which provides stocks day gainers and losers data.

Trading day gainers and losers.



To use necessary API you need to get "your-api-key" directly from Mboum Finance, or using rapidapi.com, the way I recommend. Output data is in JSON format which can be easily converted to any suitable form for further visualisation and analysis, stocks day gainers/losers are stocks ordered in descending/ascending order by price percent delta.



Python code to get trading day gainers:


Day gainers are simply stocks ordered in descending order by price percent change with respect to the previous close.



import requests

url = "https://mboum-finance.p.rapidapi.com/co/collections/day_gainers"

querystring = {"start":"0"}

headers = {
"X-RapidAPI-Key": "your-api-key",
"X-RapidAPI-Host": "mboum-finance.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

Trading day gainers output (shown partly):


trading day gainers.



Python code to get trading day losers:


Day losers are simply stocks ordered in ascending order by price percent change with respect to the previous close.



import requests

url = "https://mboum-finance.p.rapidapi.com/co/collections/day_losers"

querystring = {"start":"0"}

headers = {
"X-RapidAPI-Key": "your-api-key",
"X-RapidAPI-Host": "mboum-finance.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

Trading day losers output (shown partly):


trading day losers.





See also related topics: