I am trying to incorporate my trading212 portfolio into a wider system and would like to have access to my trading history such that I can keep a record of the market price, prices that I paid, the exchange rate at the time that I made the purchase. The exchange rate being my main stumbling block.
I have written a basic script to read through my contract note emails (I only have the last month or so of these, If I had them all, this wouldnāt be a problem) and the Monthly Statement. The Monthly Statement has the Price and Market Price, but these are mostly in USD instead of GBP. Applying an exchange rate at this point would be inaccurate regardless. What I need really is a deposit/investment total in GBP for each instrument.
I have seen others post things like this link but the data there is just what is shown on the Monthly Statement. I am wondering if there is something like that but for purchase history or anything that would help at all?
I could potentially build a webscraper to pull out the history for each investment, but I would like to avoid this if possible.
Sorry if this is a bit waffly, Itās super late over here right now.
I should say, Iāve seen someone post on here a chrome extention that generates a csv of your holdings, but it cannot handle pieās or and big enough order history.
Scrape it. Look at the network calls through your browser when logged in. Look at the āorders?ā API call and date parametersā¦ throw them at your browser and pull out the json ā¦ works well enough for meā¦
Im not sure, trying to figure out if i can get a sessionID using requests? There is always selenium of course, Iām just trying to not use that so I learn something new.
I did think I had just blocked my IP or something, but i think my internet is just being tempermental.
But something is stopping me. I think there is a value that is generated when the page loads that is required in the login post. But I am not sure yet how to get it.
Itās why I force an Internet Explorer objectā¦that loads the sessionIdā¦ then make the API call through the same browser with the same sessionIdā¦ primitive, messy, not clever but works!