Page 1 of 1

Hargreaves Lansdown API access

Posted: June 15th, 2023, 6:53 am
by ArunC
Hi
Does anyone know if its possible to get API access to fund performance data at Hargreaves Lansdown - want to get daily data into my spreadsheet to monitor fund performance.
Cheers
Arun

Re: Hargreaves Lansdown API access

Posted: June 15th, 2023, 7:48 am
by kiloran
ArunC wrote:Hi
Does anyone know if its possible to get API access to fund performance data at Hargreaves Lansdown - want to get daily data into my spreadsheet to monitor fund performance.
Cheers
Arun

Not API access but you can probably scrape the data from a web page.

An alternative is HYPTUSS https://lemonfoolfinancialsoftware.weeb ... op-up.html
This does have a worksheet which scrapes fund prices from the FT

--kiloran

Re: Hargreaves Lansdown API access

Posted: June 18th, 2023, 8:10 am
by ArunC
Tried scraping, but the column headers change every day, so it works on the day the power query in excel was set up, but the next day the headers change so cant find the data, does anyone know a way around this, been trying for hours....

Re: Hargreaves Lansdown API access

Posted: June 18th, 2023, 8:23 am
by Itsallaguess
ArunC wrote:
Tried scraping, but the column headers change every day, so it works on the day the power query in excel was set up, but the next day the headers change so cant find the data, does anyone know a way around this, been trying for hours....


Sorry to be blunt, but *which* column headers...?

As far as I can tell at the moment, you're looking for a mind-reader first and foremost...

Why not provide a sample URL, and then specify just which field or fields you're looking to use, and then people might be able to engage with your query more effectively, because as things stand, I can't see how anyone can help with such a vague and confusing request...

Cheers,

Itsallaguess

Re: Hargreaves Lansdown API access

Posted: June 18th, 2023, 8:24 am
by ArunC
HI think AI may have found a solution :)

Re: Hargreaves Lansdown API access

Posted: June 18th, 2023, 8:27 am
by ArunC
The problem was this. The table on the page has a header row with dates, and a first row of data with annual return.
The dates change every day, so when the power query runs on the date it is set up the data returns fine, but the next dat, because the column headers have changes, the query cant find the data because the query if looking for headers from the previous day.

AI found this solution, replacing the power query code with the following (where the URL is the page being scraped, and Source(0) refers to the table reference on that page

let
Source = Web.Page(Web.Contents("URL")),
Data = Source{0}[Data],
Headers = Table.PromoteHeaders(Data, [PromoteAllScalars=true]),
NoHeaders = Table.Skip(Headers, 1)
in
NoHeaders

The example is on this page: https://www.hl.co.uk/funds/fund-discoun ... s-i-income table 5 (annual return)