Welcome - note that Companies House have actually split their API into sections. The part for retrieving information about documents or the document contents is a separate API, with its own subdomain e.g. you need to make requests of the form:
https://document-api.company-information.service.gov.uk/document/{document_id}
So not https://api.company-information.service.gov.uk/…
I believe their intent with the api was that you would just follow the links e.g. request the Filing History List or a single Filing. Each Filing History item will contain a links
member and that will have a document_metatdata
member with the URL to request e.g. for your example company and document I can request this via curl, snipping lots of information (“…”):
curl -u MY_API_KEY: "https://api.company-information.service.gov.uk/company/00446417/filing-history"
{
"items": [
{
"action_date": "2021-12-31",
"category": "accounts",
"date": "2022-10-21",
"description": "accounts-with-accounts-type-full",
...
"links": {
"self": "/company/00446417/filing-history/MzM1NjExMzUwOWFkaXF6a2N4",
"document_metadata": "https://frontend-doc-api.company-information.service.gov.uk/document/yFROnrh17RpxPH0MM3ccdb2PPnoudhMUm_CUe6svRPM"
},
...
},
...
],
...
}
So you then request:
https://frontend-doc-api.company-information.service.gov.uk/document/yFROnrh17RpxPH0MM3ccdb2PPnoudhMUm_CUe6svRPM"
(Or - per their documentation - https://document-api.company-information.service.gov.uk/document/yFROnrh17RpxPH0MM3ccdb2PPnoudhMUm_CUe6svRPM"
- both work)
That gives you the document metadata (not the content):
{
...
"links": {
"self": "https://document-api.company-information.service.gov.uk/document/yFROnrh17RpxPH0MM3ccdb2PPnoudhMUm_CUe6svRPM",
"document": "https://document-api.company-information.service.gov.uk/document/yFROnrh17RpxPH0MM3ccdb2PPnoudhMUm_CUe6svRPM/content"
},
"resources": {
"application/pdf": {
"content_length": 712506
},
"application/xhtml+xml": {
"content_length": 1413148
}
}
}
You would then request the URL in the links.document
member to get the actual data. Note that this is also a slightly involved process - or at least it seems to cause many people some problems. There are several posts on threads here which aim to help explain the process e.g. mine here and the posts linked in my response:
https://forum.aws.chdev.org/t/document-api-implementation/1927/5
You can see the details in the Companies House documentation at:
https://developer-specs.company-information.service.gov.uk/document-api/reference
Hope this helps.