PHP Classes


Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP Companies Lookup   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Companies Lookup
Find companies in the Companies House Database
Author: By
Last change:
Date: 3 years ago
Size: 1,889 bytes


Class file image Download


Simple and fast tool to find companies (from their Company Number or Company Name).

I realized there was no such console tools for finding a company from Companies House database (similar to the Unix whois command for finding the domain names' details).

Find Companies with console interface


  • Be sure PHP 7.0 or higher is installed
  • Install Composer (
  • Then run:
$ composer install

  • Rename `.env.example` to `.env`
$ mv .env.example .env

  • Request your Companies House API key =>
  • Open the file (with your favourite text editor)
$ nano .env

  • Add the Companies House API Key between the double quote `"` `"`
  • Change the permissions of the `companies` bash file (if you use the bash shortcut file)
$ chmod u+x ./companies

  • Run the script:
$ ./companies <COMPANY_NAME / COMPANY_ID>


php bin/companies companies:search <COMPANY_NAME / COMPANY_ID>

Example to find HSBC company

With the Company Name:

$ ./companies HSBC

Or with the Company ID:

$ ./companies 06388542

  • Enjoy!

Companies House Lookup, real example


About me

I'm Pierre-Henry Soria, Software Engineer (love that!) and also passionate about marketing and e-businesses.

Where to contact me?

You can by email at pierrehenrysoria+github [[AT]] gmail [[D0T]] com


Under General Public License 3 or later.