Can’t figure out what the Document ID is? there seems to be no unique ID for each document documented on Companies House. Am I missing something here? is the document ID in the url of each document?
grateful for any advice
I have been referring to the Document API here: Document API: Specification summary
As always the question is “what are you trying to do / achieve”? e.g. where are you starting from - are you trying to find a particular filing? Are you trying to get all the documents for a particular company? etc.
You don’t really need to worry about document IDs. The API is based on following URIs. You look up the Filing History List for a company. Each entry in this has a links
member including a URI to get the “document metadata” for the document. That in turn has a link to the actual file data - see details later on exactly how to do that).
As far as I know the whole design of the API is essentially mirroring the flow of the Companies House search website e.g. the assumption is you’ll start from a given company number (or a search, which will then give you a link to the company profile). You then follow the links in the Company Profile e.g. to the filing history (or just make the appropriate URI for the filing history for the company yourself using the company number). Finally the links to the documents are available from the Filing History list.
See my post e.g. here:
https://forum.aws.chdev.org/t/document-api-implementation/1927/5
Also one here covering similar ground:
https://forum.aws.chdev.org/t/how-to-get-document-id/2706/5
Beware that the document metadata is on Companies House servers but the actual document data is hosted elsewhere, so you may need care with authorization as described in the thread posts above.
Thank you for the detailed explanation, I am basically trying to retrieve the count of employees (“Average number of employees during the period”) and Capital and Reserves. Ideally for a list of Company Numbers that I have, or just for a 1 single Company Number that I have. Appreciate any suggestions on this
We do not use this or parse accounts documents so I know little about this. Fortunately it’s possible to search this forum! You can also, but when I did I see some of those questions are maybe answered here. In fact it looks like a thread asking some of these questions (with answers) has come back to life:
https://forum.aws.chdev.org/t/getting-financial-data/4605
There were some other enquiries about the individual points you made:
Employees:
https://forum.aws.chdev.org/t/can-i-get-number-of-employees-from-api/908
https://forum.aws.chdev.org/t/number-of-employees/4755
Capital
Probably you will need to look in any accounts filings.
Companies can file a statement of capital but not sure if / when that is required.
Previously this could be reported as an associated filing with the Annual Return but that type of filing has not been made for a number of years. (Example here in one example in my post):
https://forum.aws.chdev.org/t/document-description-values-for-filings-api-call/4256/2
Reserves
Again you will probably need to parse the Accounts filings.
You can also find Accounts information in bulk. @ebrian101 has a guide on the bulk data here: Bulk Data products from Companies House | CH Guide
If you are planning to look at the Filing History list to find accounts filings in XBRL documents note that not all accounts are filed electronically / not all will have XBRL documents (some will be just PDFs e.g. pictures).
There is information on how to find out if there is XBRL data available for a filing and if so download that rather than e.g. a PDF in my post on the Document API I think.