Getting Financial Data

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