How to use the Companies House API with Postman?
This post will explain how to retrieve UK companies’ information using the Companies House API and the Postman software.
Why do you need UK companies’ House data?
Well, maybe you need to add company data to your CRM, or you need the data to perform an analysis. Data such as:
What is the Companies House API?
Companies House is the United Kingdom’s organization that registers and collects UK companies’ data. They also offer an API that pulls data directly from their database using HTTP requests. The advantage of an API is that you can pull data programmatically via a programming language.
What is Postman?
Postman is a software platform where you can execute API calls and retrieve data. You can make all types of API calls and interact with other software. The good news is that Postman is very user-friendly, and you don’t need to know a programming language to use it.
Step by Step process to download the data using Postman
This post will explain how to retrieve the data in JSON format step by step. It also explains how to put it in Excel (so you can process the data).
Step 1: Download Postman
Download Postman from https://www.postman.com/downloads/. Install it and open the platform.
Step 2: Get an API Key from the Companies House API
Go to this web page https://developer.company-information.service.gov.uk/ and create an API KEY.
Click on create an application:
Then fill the form:
After submitting the form, you will see your application listed on your live application list:
Finally, go to your application and get the API key:
Step 3: Read the documentation of the Companies House API
Yes, I know this is the boring part. But, trust me, the documentation is well explained and easy to read.
Go to the web page https://developer-specs.company-information.service.gov.uk/.
For this example, we are going to review only the search API. Don’t worry. UK APIs endpoints are very similar. Please follow this tutorial with the other APIs, and you will be fine.
Great, so if you click on the Search API, you will see the get HTTP request and the required parameters. In this case, only one parameter is needed.
Step 4: Go to postman and execute the get request
Now, here the tricky part is the autorization, just follow the instructions, and you will be fine.
As you can see the HTTP request is a get request with the following address https://api.company-information.service.gov.uk/search/companies
Remember to add the mandatory parameter using the following command: ?q=ibm
In other words, we are searching for companies related to IBM.
Finally, set the variable Authorization in the headers tab. Assign the following value: Basic COPY YOUR API KEY HERE==
For example, if your API key is 4129312lñejl12oeu12dsd2109dsu21j, then you have to put: Basic 4129312lñejl12oeu12dsd2109dsu21j==
Step 5: Click send and save your data in excel
Save your response to your local drive.
The response is a JSON file.
Finally, put the JSON in excel using the following tutorial.
That’s all. Follow a similar process for the other APIs (just remember to read the documentation).
You can also use Matchkraft software (www.matchkraft.com) to get UK data.
Do you need any help? Feel free to contact me at email@example.com.