# Retrieve Companies Number using Company Name

**URL:** <http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260>\
**Category:** Bulk Data Requests\
**Created:** [August 11, 2021, 2:58pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260 "2021-08-11T14:58:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sara.pereira](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@sara.pereira](http://forum.companieshouse.gov.uk/u/sara.pereira)\
**Post date:** [August 11, 2021, 2:58pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/1 "2021-08-11T14:58:50Z")

</div>

Hi everyone,  
Need your help, please.  
So I´ve got a spreadsheet with several companies’ names and I´ll need to find their companies’ number.

creating an API that automatically searches from my list and then retrieves companies number is the solution?  
already tried with python, but seems that the code isn´t correct 😕

Cheers  
Sara

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [August 11, 2021, 6:23pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/2 "2021-08-11T18:23:25Z")

</div>

Welcome - thanks for stating your overall goal:

> I´ve got a spreadsheet with several companies’ names and I´ll need to find their companies’ number.

If you’re having trouble with code and want to stay in the spreadsheet you could download the [bulk Companies House data files](http://download.companieshouse.gov.uk/en_output.html) and process those to get company names from numbers.

Alternatively, search this forum, you’ll find other people wanting to accomplish the same goal e.g. on this thread:

[https://forum.aws.chdev.org/t/how-to-get-data-into-a-spreadsheet/324](https://forum.aws.chdev.org/t/how-to-get-data-into-a-spreadsheet/324)

I believe there are some spreadsheet-based tools / plugins for Companies House. I don’t have details though, sorry - try search.

If neither of those approaches helps, you’ll need to explain the detail. So that would be:

What it is you’re doing e.g. what system / what code you’re using (simplified if possible)  
What part of Companies House API you’re accessing  
The data you send  
The errors / data you get back.

Don’t put any of your API key details / passwords in your post though!

Good luck.

---

<div class="post-metadata">

**Author:** ![frank](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/f/3d9bf3/32.png) [@frank](http://forum.companieshouse.gov.uk/u/frank)\
**Post date:** [August 11, 2021, 9:06pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/3 "2021-08-11T21:06:30Z")

</div>

Sara

You might find this link helpful

[GitHub - previsedigital/companies\_house: Companies’ House API](https://github.com/previsedigital/companies_house)

or

[Search · companies house · GitHub](https://github.com/search?q=companies+house)

I can’T vouch for any of the material but most of what reaches Github does work!

**If you would prefer not reinvent existing wheels you could also reach out to my team at**

[admin@statbooks.co.uk](mailto:admin@statbooks.co.uk)

StatBooks® puts the Companies House Register at your fingertips! We have a Names & Numbers API that auto populates Names from Numbers.

---

<div class="post-metadata">

**Author:** ![gordan719](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/g/aca169/32.png) [@gordan719](http://forum.companieshouse.gov.uk/u/gordan719)\
**Post date:** [August 22, 2024, 12:01pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/4 "2024-08-22T12:01:02Z")

</div>

Hi, i am looking to perform similar tasks, i.e., search for company registration number based on company name.

The API page shows this request: [https://api.company-information.service.gov.uk/search/companies](https://api.company-information.service.gov.uk/search/companies).

However, i am not sure where to put in the parameter q which in my case will be the company name.

Can someone help me on this please? Thanks,

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [August 22, 2024, 3:03pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/5 "2024-08-22T15:03:02Z")

</div>

The documentation (for Companies Search - there are other types) is here:

[https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/search/search-companies](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/search/search-companies)

When you say “am not sure where to put in the parameter q”:

- That is just [a parameter in the URL](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL). So e.g. you’d request:

> [https://api.company-information.service.gov.uk/search/companies?q=mycompanyname](https://api.company-information.service.gov.uk/search/companies?q=mycompanyname)

… where `mycompanyname` is the thing you’re searching for. And of course as it’s a URL parameter you will need to appropriately encode this ([URL encode](https://en.wikipedia.org/wiki/Percent-encoding)) - although depending on the tool you’re using to communicate with the API that might be done automatically, and normally there are mechanisms available to do that for you (e.g. in javascript [encodeURIComponent](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)).

- … which brings us to the second answer which is “it depends” - there will be differences between different languages, tools and environments for exactly how you specify and request a URL (pretty much all will allow you just to put the whole thing in as text, if you encode parameters yourself though).

---

<div class="post-metadata">

**Author:** ![gordan719](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/g/aca169/32.png) [@gordan719](http://forum.companieshouse.gov.uk/u/gordan719)\
**Post date:** [August 22, 2024, 7:13pm UTC](http://forum.companieshouse.gov.uk/t/retrieve-companies-number-using-company-name/4260/6 "2024-08-22T19:13:27Z")

</div>

> [@voracityemail](#):
>
> [https://api.company-information.service.gov.uk/search/companies?q=mycompanyname](https://api.company-information.service.gov.uk/search/companies?q=mycompanyname)

yeah, that worked. thank you!
