Freetrade Portfolio Tracker
Fetches live stock prices from Freetrade and calculates portfolio holdings values.
Setup
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac
pip install requests beautifulsoup4
Usage
Copy the sample file and add your own positions:
cp holdings.sample.csv holdings.csv
Format (name,ticker,market,shares):
Greatland Resources,GGP,GB,6
Pan African Resources,PAF,GB,78
Nvidia,NVDA,US,0.09761572
Markets: GB for UK stocks, US for US-listed stocks.
Run:
python price.py # uses holdings.csv by default
python price.py my_portfolio.csv # custom file
Output (JSON):
[
{
"name": "Greatland Resources",
"ticker": "GGP",
"market": "GB",
"shares": 6,
"currency": "GBP",
"price": 7.69,
"fx_rate": 1.0,
"total_value_gbp": 46.14
}
]
Description
Languages
Python
100%