Previous addresses, previous company names, and expanded info

Hi there CH forum

I’m trying to return a number of datapoints about a long list of companies, and some of my information is old or just wrong.

For example, the company 3193619, now called ‘IRIS group’, is listed in my list as ‘IRIS software’, I also however have the former name of ‘Transaction Technology’, as well as previous addresses (riding house court)

My first question is is there any functionality in the API which can return company information as rich as the button in [‘More’ tab, then button 'View company information snapshot] on the main page when you search a company? The page which gets downloaded is really rich with data, and has former names and addresses. If I could somehow return these fields, that would be great. Then I could iterate over my python dataframe and confirm the correct identity of each company. I also have some companies in my list which do not have a registration number - for these companies, I could search the database, and find a company with a similar previous address, then return the company reg no (for use in FAME)

Any thoughts?

Q1: making your own “View company information snapshot”

The main API is the way to go with this. Since CH release most of their code too you can actually re-use their template if you like. I think this is it - in Perl / tx template - or you can recreate it.

You’ll need to call the various endpoints to fill that all in. For each company in your list the Company Profile endpoint is the one to start with. You request it for a given company number. That’ll give you much of the detail including registered office address, company type info, former names, accounting periods etc. The returned object also contains links to e.g. Officers, Charges (mortgages), insolvency records if any etc. should you wish to fill that information in too.

You mention you might have both former names and also missing registration numbers. If you have the registration number you’re fine - that’s the “key field” for the API. You can actually use that directly as a parameter in most of the endpoints - no need to search first. Just ensure you capitalise and (left) pad the numeric part so you have 8 characters. If you weren’t sure or didn’t have that there are two search APIs. Be aware that these are designed to try to give you a “best match” in a small number of results so your mileage may vary:

Standard search: Companies House Public Data API: Search companies

Advanced search: Companies House Public Data API: Advanced search for a company

You may find some more information - particularly about the advanced search - by searching this forum (magnifier icon in top right).

You don’t mention how much data you’re processing nor whether this is an on-demand, batch or one-off process. If you have a lot of data (10000 - 100000 + range) and you’ve able to run this as a batch you might be better off with the Companies House snapshot data product.

The API is “live” and has all the data (e.g. you can look up officers etc. but you’re rate-limited (600 requests / 5 min).

The Companies House snapshot data product can be downloaded whenever you like. The downside is that you get a small subset of all the info, the data is not “live” (but updated regularly) and you’ve then the issue of managing very large files.

Hi Voracityemail,

Thanks so much for your detailed response!

I can tell you are an expert here - I must admit some of that went over my head, I’m a little newer to tech than you are I get the feeling.

Few points/questions:

  1. I had a look at some of your links to API’s and noticed that one of them, the ‘company register’ one (companies-house-public-data-api/resources/companyregister?v=latest) has a section in it that returns previous addresses, I think…
    This could certainly address one of my needs. The problem for me is just getting it working. The CH website seems to have no examples from what I can tell, so isn’t so novice friendly.

At the moment, I’m trying this code:

apiKey = “xxxxxxxxxxxxxxxxxxxxxxxxx”
url = “https://api.companieshouse.gov.uk/search/company/00445790/registers
data = requests.get(url, auth=(apiKey, ‘’)).json()

And I am hoping I will get some kind of info returned in my variable called ‘data’, like when I run the search code:

apiKey = “7xxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
url = “https://api.companieshouse.gov.uk/search/companies?q=Raphael Healthcare&items_per_page=5”
data = requests.get(url, auth=(apiKey, ‘’)).json()

But it does not seem to work.

Any resources you know of that will demo the code? I’m perennially confused why developer sections of websites do not simply paste an example (or maybe I missed it)

Re quantity, I only have about 2300 entries to process, so not many, and it does not need to be live.

Cheers
Nels

Post edit:

I’ve since been able to pull up the company filing history with this code:

apiKey = “xxxxxxxxxxxxxxxxxx”
url = “https://api.companieshouse.gov.uk/company/00445790/filing-history
data = requests.get(url, auth=(apiKey, ‘’)).json()

but that was a pure guess. Is there somewhere I can learn what other inputs will deliver various results? I just threw ‘filing history’ in there as a guess

Also, this seems to limit me to the most recent 25 results, is there a way I can pull up the full history? Often address changes were ages ago, so are not in teh first 25

Read the documentation - see below.

As always things you don’t know will confuse you - it would help to have a basic understanding of how Companies House and UK companies work. I’ve not got a good reference for that to hand, sorry. Search!

The “Registers” endpoint is rarely any use. It sounds useful but most companies will have no data available here. This is a particular feature of how companies can choose to be administered and is used by very few. Unless you know that a particular company has chosen to keep some of its data on the public register I’d ignore this. (You should be able to find this by examining the links member in the Company Profile).

Search only returning 25 results? Read the documentation - pay attention to items_per_page and start_index. Note that they won’t let you just set this to some arbitrary number (100000). The latter is zero-based and should be a multiple of items_per_page. Unless the bug has been fixed don’t set items_per_page to 1. Search this forum for information on “paging”.

More “editorial” comments:

The Companies House documentation - last time I checked - is neither complete nor fully up-to-date (not sure I’ve ever found one that is…). However that’s where to start. I recommend you work read their overviews (links on left) and then work through from the main docs area.

What you need to start with - if you have a company number - is the Company Profile endpoint. I linked the documentation about that in my last post.

For any API you’ll need to have some understanding of the subject area. For Companies House this may involve tangling in the arcane corners of UK business law! The API just lets you get the data, not understand it.

There are several reasons why many places don’t post code examples. Companies House used to I think but I think not doing so makes more sense. For two - code for what, in which languages? Then, suppose you copy-paste the code into your system, and it gives some error? Now what do you do?

They do still give examples using curl, I think. I recommend using that. It’s simple and it reduces exposure to one source of confusion (how your environment / language handles http requests - or even how your language / environment works!)

G’day Voracity

Cheers for that info, that is very helpful.

Have had a look at all those docs but still cannot get this paramaters working in the API

So for example, I try with the filing history endpoint as I did with the company search method:

url = ‘https://api.company-information.service.gov.uk/company/03193619/filing-history&items_per_page=6

Just as it worked with the search method:

url = ‘https://api.company-information.service.gov.uk/search/companies?q=Raphael Healthcare&items_per_page=6’

But no luck, no object returned

Can you advise what syntax is appropriate here? Should I not be seperating the string with ‘&’? The docs don’t actually say

Cheers
Nels

Also, checked some of the posts re paging, didn’t have any luck :frowning:

It’s a URL. Possibly the concept of “REST API” is confusing here. That means you can have “parameters” as part of the “path” as well as “query parameters” on the end of that. Possibly not the most “ergonomic” format ever but it follows the normal syntax for URLs and there are reasons behind the design.

By the way - that means that if you have spaces or you want a literal “&” or “?” etc. you’ll need to url-encode these (unless your language / environment is doing that for you). Wikipedia and stackoverflow are your friends!

So in your example you want:

https://api.company-information.service.gov.uk/company/03193619/filing-history

Or

https://api.company-information.service.gov.uk/company/03193619/filing-history?items_per_page=6

Or

https://api.company-information.service.gov.uk/company/03193619/filing-history?items_per_page=6&start_index=0

Or (for the next “page” of results after that)

https://api.company-information.service.gov.uk/company/03193619/filing-history?items_per_page=6&start_index=6

Did you read the documentation yet? I see Companies House no longer “spell this out” in full but I think they would assume some basics. They’ve got a short overview with links to wikipedia here.

Awesome!
That has worked. brilliant!!

Thanks again VE

for now at least, I’m on my way

Thanks so much!