Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to johnstevens77,Bhoddhisatva,scotia,Anonymous,Cornytiv34, for Donating to support the site

Free/Cheap API for LSE Data

Discussions regarding financial software
csearle
Lemon Quarter
Posts: 4762
Joined: November 4th, 2016, 2:24 pm
Has thanked: 4809 times
Been thanked: 2083 times

Free/Cheap API for LSE Data

#301382

Postby csearle » April 17th, 2020, 4:48 pm

Just been musing about writing an app to display my High Yield Portfolio (HYP) top-up ranking and my watchlist. I would really like to find an application program interface (API) where I can get the dividend yield (forecast and/or historical), earnings per share, sector, etc. of London Stock Exchange (LSE) listed companies, ideally in JSON format.

Does anyone know of such an API? I'm looking around but haven't convinced myself that any I've seen quite hit the spot.

Thanks,
Chris
PS Please I'm not really interested in a discussion on the merits of an HYP, which are better handled on HYP-S.

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#301386

Postby kiloran » April 17th, 2020, 5:01 pm

The only API or API-like tool I'm aware of is Yahoo. See http://lemonfoolfinancialsoftware.weebl ... nload.html

However, although Yahoo is generally OK for prices, the data for EPS etc, especially for UK shares, is sketchy at best.

I think you will have to resort to web scraping from a site (or sites) of your choice :(

--kiloran

csearle
Lemon Quarter
Posts: 4762
Joined: November 4th, 2016, 2:24 pm
Has thanked: 4809 times
Been thanked: 2083 times

Re: Free/Cheap API for LSE Data

#301396

Postby csearle » April 17th, 2020, 6:01 pm

A trouble with web-scraping (as I do with my rather personalised spreadsheet) is that the entity effectively providing the source of the data is not actually entering into any sort of contract, however informal, with the user of that data. With an API more value is given by that entity to providing some sort of consistency/continuity. So an API supplies the data in a more standardised way, which is less at the whimsy of some web presenter.

I feel that there maybe a business opportunity! :) Buy a paid source of the relevant data and sell it at low cost to any group with a need for it?

Or am I missing something?

Chris

mc2fool
Lemon Half
Posts: 7812
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3017 times

Re: Free/Cheap API for LSE Data

#301416

Postby mc2fool » April 17th, 2020, 7:30 pm


csearle
Lemon Quarter
Posts: 4762
Joined: November 4th, 2016, 2:24 pm
Has thanked: 4809 times
Been thanked: 2083 times

Re: Free/Cheap API for LSE Data

#301423

Postby csearle » April 17th, 2020, 7:41 pm

Excellent, thank you. Several of those I've had a cursory look at but many are new! I'll let you know!

Cheers,
Chris

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#301748

Postby kiloran » April 19th, 2020, 12:52 pm

csearle wrote:
Excellent, thank you. Several of those I've had a cursory look at but many are new! I'll let you know!

Cheers,
Chris

There's some stuff new to me in the link from mc2fool (many thanks!).

Most of these APIs tend to only provide share price (and/or historic price) so are somewhat limited. https://finnhub.io/ seemed to have a lot of other stuff which is interesting, so I had a gander at dividends since that's of interest to many people. Data for Dunedin Income Growth (DIG) shows:

[{"symbol":"DIG.L","date":"2019-11-07","amount":3},{"symbol":"DIG.L","date":"2019-08-01","amount":3},{"symbol":"DIG.L","date":"2019-05-02","amount":3.45}]

The dates are ex-div (I think most of us would prefer payment date), and it is missing the payment with ex-div 2020-02-06 (2 months ago) and also that for 2020-05-07 (though that does have an ex-div date in the future. I found similar issues with more mainstream shares such as BP.
The site is fast, allows 60 queries/min and data is in a very usable form, but I'm not sure it is reliable or greatly useful. It may just be an issue for non-US shares.

I'll continue to review these sites.

--kiloran

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#304609

Postby kiloran » April 30th, 2020, 8:44 pm

kiloran wrote:
csearle wrote:
Excellent, thank you. Several of those I've had a cursory look at but many are new! I'll let you know!

Cheers,
Chris

There's some stuff new to me in the link from mc2fool (many thanks!).

Most of these APIs tend to only provide share price (and/or historic price) so are somewhat limited. https://finnhub.io/ seemed to have a lot of other stuff which is interesting, so I had a gander at dividends since that's of interest to many people. Data for Dunedin Income Growth (DIG) shows:

[{"symbol":"DIG.L","date":"2019-11-07","amount":3},{"symbol":"DIG.L","date":"2019-08-01","amount":3},{"symbol":"DIG.L","date":"2019-05-02","amount":3.45}]

The dates are ex-div (I think most of us would prefer payment date), and it is missing the payment with ex-div 2020-02-06 (2 months ago) and also that for 2020-05-07 (though that does have an ex-div date in the future. I found similar issues with more mainstream shares such as BP.
The site is fast, allows 60 queries/min and data is in a very usable form, but I'm not sure it is reliable or greatly useful. It may just be an issue for non-US shares.

I'll continue to review these sites.

--kiloran

I've had a further look at FinnHub, the breadth of data looked quite interesting.

Price:

Code: Select all

Symbol | Price   
LLOY.L |    32.57
MRCH.L | 387.9824
BP.L   |   316.25
RDSA.L |   1328.6
RDSB.L |  1284.39
SSE.L  |   1261.5
CTY.L  | 343.9665
VWRL.L | 64.55928
BHP.L  |   1352.4
MUT.L  | 756.2432
CRV.L  |      2.9
At first sight, the prices looked OK, but......
Most shares are normally quoted in pence. and they look OK. However, VWRL.L in in pounds, and CRV.L is in USD, and there is no indication of currency. One of the API elements does indicate currency, but this is a premium feature, not free, and I don't know if the currency is just the currency used for accounting purposes, or price quote.

Trailing 12m dividends:

Code: Select all

Symbol | dividendsPerShareTTM
LLOY.L |               0.0112
MRCH.L |                0.204
BP.L   |               0.3321
RDSA.L | n/a                 
RDSB.L | n/a                 
SSE.L  |                0.922
CTY.L  |                0.095
VWRL.L | n/a                 
BHP.L  | n/a                 
MUT.L  |               0.4275
I did not check the values, but a lot of gaps, which also applies to other dividend and yield data elements

Dividend Payments. Looked interesting with data going back 20 years or so, but the date is ex-div, not payment date, and no indication of currency (though it typically is in pence)

Code: Select all

Symbol | Ex-Div Date | Amount |         
LLOY.L | 16 Apr 20   |   2.25 | Wrong.... this was cancelled
LLOY.L | 08 Aug 19   |   1.12 |         
LLOY.L | 04 Apr 19   |   2.14 |         
LLOY.L | 16 Aug 18   |   1.07 |         
LLOY.L | 19 Apr 18   |   2.05 |         
LLOY.L | 10 Aug 17   |      1 |         
LLOY.L | 06 Apr 17   |    1.7 |         


Code: Select all

MRCH.L | 23 Apr 20 |   6.8 | pence
MRCH.L | 30 Jan 20 | 0.068 | pounds
MRCH.L | 03 Oct 19 |   6.8 | pence
MRCH.L | 11 Jul 19 |   6.7 | pence
MRCH.L | 11 Apr 19 |   6.6 | pence
MRCH.L | 31 Jan 19 | 0.065 | pounds
MRCH.L | 04 Oct 18 | 0.065 | pounds
MRCH.L | 12 Jul 18 | 0.064 | pounds


Code: Select all

BP.L | 13 Feb 20 | 8.1558
BP.L | 07 Nov 19 |  7.825
BP.L | 08 Aug 19 | 8.3475
BP.L | 09 May 19 | 8.0655
BP.L | 14 Feb 19 | 7.7382
BP.L | 08 Nov 18 | 8.0251
OK, but until yesterday, the data for 13Feb20 showed a value of 10.5, which was the declared dividend in USD cents. It's taken around 10 weeks to display in pence (and there is no indication of currency.

Code: Select all

CTY.L | 23 Apr 20 |   4.75
CTY.L | 23 Jan 20 | 0.0475
CTY.L | 24 Oct 19 |   4.75
CTY.L | 25 Jul 19 |   4.75
CTY.L | 25 Apr 19 |   4.75
CTY.L | 24 Jan 19 | 0.0455
CTY.L | 18 Oct 18 | 0.0455
CTY.L | 26 Jul 18 | 0.0455
Again, a random mixture of pounds and pence

Code: Select all

BHP.L | 05 Mar 20 | 38.9402
BHP.L | 05 Sep 19 | 42.8283
BHP.L | 07 Mar 19 | 28.4244
BHP.L | 06 Sep 18 | 48.7182
BHP.L | 08 Mar 18 | 39.7916
I can't make any sense of the 3 most recent payments, the values just don't make sense

Overall, it's a real shame. There's a load of data there, it's fast, the data is in JSON format which is easy to handle. Pity the quality of the data is so poor, on my random sample.

--kiloran

finnhub
Posts: 3
Joined: May 18th, 2020, 7:55 pm
Been thanked: 3 times

Re: Free/Cheap API for LSE Data

#309749

Postby finnhub » May 18th, 2020, 7:59 pm

kiloran wrote:
kiloran wrote:
csearle wrote:
--kiloran


Hi guys,

I'm from Finnhub. Thank you for checking our API out. We have people constantly collect feedback from users to improve our product. We have released a new Dividends endpoint with cleaned data + pay date + record date, and currency.

You can check it out here: finnhub.io/docs/api#stock-dividends

If you have any further questions or feature requests, feel free to shoot us an email.

Finnhub Support,

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#309751

Postby kiloran » May 18th, 2020, 8:06 pm

finnhub wrote:
kiloran wrote:
kiloran wrote:


Hi guys,

I'm from Finnhub. Thank you for checking our API out. We have people constantly collect feedback from users to improve our product. We have released a new Dividends endpoint with cleaned data + pay date + record date, and currency.

You can check it out here: finnhub.io/docs/api#stock-dividends

If you have any further questions or feature requests, feel free to shoot us an email.

Finnhub Support,

Wow!! That was unexpected, but a very pleasant surprise. :D :D :D

Many thanks, I'll have a look at the new data

--kiloran

uspaul666
2 Lemon pips
Posts: 232
Joined: November 4th, 2016, 6:35 am
Has thanked: 195 times
Been thanked: 111 times

Re: Free/Cheap API for LSE Data

#309760

Postby uspaul666 » May 18th, 2020, 9:15 pm

Pretty fabulous. Seriously.
It’d be great if the uk pence equivalent could be provided for dividends declared in USD like RDSB.L and BP.L otherwise we’ll have to trawl through the RNS’s for the declared conversion rate. Perhaps this could go on the finhub.io roadmap?

finnhub
Posts: 3
Joined: May 18th, 2020, 7:55 pm
Been thanked: 3 times

Re: Free/Cheap API for LSE Data

#310829

Postby finnhub » May 22nd, 2020, 2:56 am

uspaul666 wrote:Pretty fabulous. Seriously.
It’d be great if the uk pence equivalent could be provided for dividends declared in USD like RDSB.L and BP.L otherwise we’ll have to trawl through the RNS’s for the declared conversion rate. Perhaps this could go on the finhub.io roadmap?


Unfortunately we need to keep the original record for now to make the data collection process more consistent and less error-prone.

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#314152

Postby kiloran » June 1st, 2020, 10:34 am

finnhub wrote:
Hi guys,

I'm from Finnhub. Thank you for checking our API out. We have people constantly collect feedback from users to improve our product. We have released a new Dividends endpoint with cleaned data + pay date + record date, and currency.

You can check it out here: finnhub.io/docs/api#stock-dividends

If you have any further questions or feature requests, feel free to shoot us an email.

Finnhub Support,

That did sound good. I started to check it out and found some significant errors, some of which appear to be due to a badly-structured database.
Then last night I got an email stating that dividends are now a premium feature. Sorry, I could not justify $50 per month for poor data. I can get better quality data for free.

--kiloran

finnhub
Posts: 3
Joined: May 18th, 2020, 7:55 pm
Been thanked: 3 times

Re: Free/Cheap API for LSE Data

#318052

Postby finnhub » June 12th, 2020, 8:31 pm

kiloran wrote:
finnhub wrote:
Hi guys,

I'm from Finnhub. Thank you for checking our API out. We have people constantly collect feedback from users to improve our product. We have released a new Dividends endpoint with cleaned data + pay date + record date, and currency.

You can check it out here: finnhub.io/docs/api#stock-dividends

If you have any further questions or feature requests, feel free to shoot us an email.

Finnhub Support,

That did sound good. I started to check it out and found some significant errors, some of which appear to be due to a badly-structured database.
Then last night I got an email stating that dividends are now a premium feature. Sorry, I could not justify $50 per month for poor data. I can get better quality data for free.

--kiloran


Our data has been thoroughly cleaned by our team. If you find any errors, feel free to shoot us an email. We will take a look for you. 5B+ AUM of hedge funds and mutual funds is being traded on top of our data so we are confident that our data is institutional-grade. If you can shoot us an email, we can give you a free trial and explain any discrepancies to you as well.

p/s: I also just checked our backlog. A dividend database update was done during Saturday-Sunday time period of your comment which might be reason for the "badly-structured database" issue you encountered. This is a 1-time update to clean up some of the data so it won't happen again. Our apology for the issue. Reference issue: github.com/finnhubio/Finnhub-API/issues/267

Finnhub Support,

kiloran
Lemon Quarter
Posts: 4092
Joined: November 4th, 2016, 9:24 am
Has thanked: 3234 times
Been thanked: 2827 times

Re: Free/Cheap API for LSE Data

#318063

Postby kiloran » June 12th, 2020, 9:01 pm

finnhub wrote:
kiloran wrote:
finnhub wrote:
Hi guys,

I'm from Finnhub. Thank you for checking our API out. We have people constantly collect feedback from users to improve our product. We have released a new Dividends endpoint with cleaned data + pay date + record date, and currency.

You can check it out here: finnhub.io/docs/api#stock-dividends

If you have any further questions or feature requests, feel free to shoot us an email.

Finnhub Support,

That did sound good. I started to check it out and found some significant errors, some of which appear to be due to a badly-structured database.
Then last night I got an email stating that dividends are now a premium feature. Sorry, I could not justify $50 per month for poor data. I can get better quality data for free.

--kiloran


Our data has been thoroughly cleaned by our team. If you find any errors, feel free to shoot us an email. We will take a look for you. 5B+ AUM of hedge funds and mutual funds is being traded on top of our data so we are confident that our data is institutional-grade. If you can shoot us an email, we can give you a free trial and explain any discrepancies to you as well.

Finnhub Support,

Many thanks for the response. I can't provide detailed examples of the problems I found since I no longer have access to the Finnhub dividend data, and a free trial would not really belp since I would not be able to justify the ongoing $50 per month. Sorry, I don't want to sound ungrateful for your offer, I realise that you need to make money somehow.

One of the data errors concerned special dividends. Your database appeared to record only one transaction per date. Sometimes it showed the normal dividend and sometimes it showed the special dividend, apparently randomly. The database needs to allow multiple records per date, and ideally add a flag to indicate if the dividend payment is normal or special.
I can't remember which stocks I checked, but some examples of stocks that have paid special dividends are:

https://uk.advfn.com/p.php?pid=financia ... ol=L%5EMRW
https://uk.advfn.com/p.php?pid=financia ... ol=L%5Eadm
https://uk.advfn.com/p.php?pid=financia ... ol=L%5Eaas

Another problem related to inconsistent currencies for dividends. Sometimes it showed the currency of the dividend declaration, sometimes the currency of the actual dividend payment, but I cannot recall any examples of this.

--kiloran

stooz
Site Admin
Posts: 1447
Joined: November 3rd, 2016, 11:03 pm
Has thanked: 10 times
Been thanked: 502 times

Re: Free/Cheap API for LSE Data

#396225

Postby stooz » March 16th, 2021, 5:11 pm

Hi,
Did you get any further along with this?
Im not against paying the $50 for an account, as we could look to integrate the data into the fool as well.

PM me.


Return to “Financial Software - Discussion”

Who is online

Users browsing this forum: GPhelan and 4 guests