If you’re struggling here Companies House has a basic tutorial on REST APIs:
https://developer.company-information.service.gov.uk/overview
There’s a longer tutorial here:
Sorry - can’t provide you with more of a step-by-step really. I mean, I could but I’m not convinced it would clarify it for you. I recommend actually trying this for yourself.
Well OK, I’ll give you the final step for example 1. (Example 2 ends the same way). Although again I recommend you actually try this. Say I took the first entry from example 1:
"links": {
"self": "/officers/vcZz6vfqyrlqjUqezTzS7wa9rWM/appointments"
},
(See that “vcZz6vfqyrlqjUqezTzS7wa9rWM” - that’s an officer ID. It doesn’t do me any good outside of this URL though - unlike e.g. company number you can’t fill it in anywhere else to do something.)
I just add “https://api.company-information.service.gov.uk” to the front of all that, then request this (again using curl - again in the response I’ve snipped out details and replaced with “…” for clarity):
curl -u YOUR_API_KEY: "https://api.company-information.service.gov.uk/officers/vcZz6vfqyrlqjUqezTzS7wa9rWM/appointments"
{
"items": [
{
"officer_role": "corporate-llp-designated-member",
"name": "GIBSON TULLBERG RECRUITMENT LIMITED",
"appointed_on": "2010-06-30",
"links": {
"company": "/company/OC316568"
},
"appointed_to": {
"company_name": "GIBSON TULLBERG LLP",
"company_number": "OC316568",
"company_status": "dissolved"
},
...
}
],
...
"start_index": 0,
"items_per_page": 35,
"name": "GIBSON TULLBERG RECRUITMENT LIMITED",
"is_corporate_officer": true
}
In this case there is only one item in the list - this officer is only appointed to one company. That company is given in:
-
The links.company
member (the company number on the end of “/company/” - OC3166568). You could add the “https://api…” part to the front of that and request it via e.g. curl and that would give you the company profile.
-
The appointed_to
member which saves you even needing to request the company profile - it gives you the company name, number and status here. (I can’t recall if you always get this though - but if not just call the company profile endpoint).
So there you are - example 1. We started from an officer name (“gibson”) and we got to a list of companies they are an officer of (above). To do that I called first called the /search/officers endpoint and got back a list of “gibsons”. I picked the one we wanted (the first here) and used the links.self
field. I called that (which is the Officers appointments endpoint - the link just has the officer-id already filled in) and got another list - the companies they were appointed to.
If you’re still working this through “on paper” I really recommend signing up and giving it a try. The API is much clearer when you actually experiment with it. There are many ways you can access the system - search this forum for some. I recommend curl as it’s very simple and widely available. Companies House also have examples using it.