Getting Financial Data

Hi,

Is it possible to get data such as revenue, expenses etc through the Companies House API.

Have gone through the API requests, the filling history seems to be metadata rather than being able to view account history.

Please correct me if I’m missing something.

Thanks,

Paul

Link used for API references:

Companies House Public Data API: Specification summary (company-information.service.gov.uk)

I believe the accounts.last_accounts object in the companyProfile resource contains the last accounts filed (or links to them).

Hi Phillip,

Thanks for the reply.

Have checked and the accounts.last_accounts does not appear using a company profile request.
Google Sheet below for reference.

It maybe deliberate that companies house want you to pay to access financial data like this so would not be too surprised if it’s not available via the API.

Paul

Can you check the link in inks.filing_history in the response? It is column AK in your file.

PS> No it is not deliberate to make you pay for access, you can also get those links to filling history in the streaming API

1 Like

Searching for that shows the filing history metadata not account specifics unfortunantely.

Good to know it’s not meant to be paywalled.

Thanks.

What metadata do you get?

As an aside, you can also get bulk data downloads of account for all companies here: Companies House

It’s in the Copy of Sheet 1 tab.

I only see a link in row 2 of column AK of your .spreadsheet.

To get the documents, you need to do this via the Document API: Specification summary (company-information.service.gov.uk)

Could you give me an example request please for that, which will show say revenue numbers, as can’t seem to get it to work.

Appreciate the help.

Did you get the document and is it an iXBRL or a pdf?

You do realise that the documents are the accounts filed at CH, so you’ll have to get that from the P&L, if available (not mandatory for all companies), otherwise you may have to deduce / guesstimate that from the BS (it helps if you have prior year’s accounts too).

PS: The spec shows how to fetch the document, i.e a GET request to: https://document-api.company-information.service.gov.uk/document/{document_id}/content

where you replace the document_id with the one from your metadata

Hi Paul,
I’ve written an example in JavaScript to show how to get financial accounts documents from Companies House Document API. I’ve posted it on GitHub and my wiki (linked below), let me know if you have any more questions about using it or scanning the accounts.

Regards,
Brian

Hey Paul,

I’d say the easiest way to get financial information for companies in the UK is to process every company in the UK which submits their accounts in a digital (XBRL) format through this link:

http://download.companieshouse.gov.uk/en_accountsdata.html

Adding all this to a database would allow you to query the data and find TO/Revenue for the company you’re interested in. If a company’s turnover is less than 10mil they don’t have to report it.

Also, when you process all these digital accounts you will miss companies which do not report their accounts in a digital format (e.g. TESCO PLC). Generally these companies tend to be Large companies (<250 employees) and there are around 1.25m of them hence the problem with processing this data yourself.

There are companies which will sell you data for any company (disclaimer: I work for one). Examples include: The Data City (who I work for), FAME, D&B, Red Flag, CreditSafe.

Hi Brian,

Thanks, appreciate the detailed step by step guide.

I may be mistaken but ultimately that will output a PDF of the accounts, so not necessarily value of say the revenue figure which I’d hope to, via the API, load directly into Google Sheets/Excel.

Paul

Thanks Lewis.

That’s good to know I suspect going down an API route for financial accounts information is probably not the best way.

Data City is super cool by the way, we currently use DataGardener for our Companies House info for reference.

Paul

Not a problem.

Thanks! I reckon the way you’re doing it via DataGardener is certainly reasonable and it’s definitely not an easy task to do it yourself. If all accounts were filed digitally, I think that would remove a blockade for using services such as ourselves or DataGardener!

Haha yeah that’s true.

Hi Paul,
You can get the iXBRL document by specifying the accept header like this:

GET https://document-api.companieshouse.gov.uk/document/DR2uueIff1_ydir2xBw6ilyEjTTbN-s2b64v1wpqGl0/content

Accept: application/xhtml+xml

Or in JavaScript with

headers: {Accept:'application/xhtml+xml'}

This will return to you an XML document (if one is available for the company) with financial details in, such as number of employees and revenue for companies over 10 million TO.

You can use the open source Arelle software to scan those XML documents into a CSV file to open in Excel.

The command is something like this:

./arelleCmdLine -f {XBRL filename} --facts output.csv

This will write a CSV file to output.csv containing rows like this:

Label,Name,contextRef,Value,EntityIdentifier,Start,End/Instant,unitRef,Dec
Net assets (liabilities),uk-core:NetAssetsLiabilities,icur1,"2,438.00",00009918,,2020-02-15,GBP,2
Creditors,uk-core:Creditors,iprev10,5.00,00009918,,2019-02-15,GBP,2
Fixed assets,uk-core:FixedAssets,icur1,"2,114.00",00009918,,2020-02-15,GBP,2
Equity,uk-core:Equity,iprev8,"2,434.00",00009918,,2019-02-15,GBP,2

And then you can find the row labelled profit or revenue and get the value.

2 Likes

Hi,

You’re correct that the Companies House API primarily provides access to metadata and filing history rather than detailed financial data like revenue and expenses. For detailed financial information, such as revenue and expenses, you should refer to the Companies House Data Products which offer comprehensive datasets including financial statements.