PHP Classes

PHP Companies Lookup: Find companies in the Companies House Database

Recommend this page to a friend!
  Info   View files Example   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 57 All time: 10,533 This week: 524Up
Version License PHP version Categories
companieslookup 1.0.0GNU General Publi...7Web services, PHP 7, Business


This package is specific mainly for applications used in United Kingdom .

This package can be used to find companies in the Companies House Database.

It can send HTTP requests to the Companies House Database API to find companies from the United Kingdom by their name or identifier.

The class can return company details like the name, type, status, address and date of creation.

Innovation Award
PHP Programming Innovation award nominee
February 2021
Number 7
Many business need to support other companies in a secure way. Usually they need to verify if those other companies are legitimate and are active.

This package provides a solution to perform such kind of verification in quick and easy way by accessing the Companies House Database API available for companies in the United Kingdom.

This way, this package can simplify the process of companies work with other companies with greater security.

Manuel Lemos
Picture of Pierre-Henry Soria
  Performance   Level  
Name: Pierre-Henry Soria <contact>
Classes: 46 packages by
Country: United Kingdom
Age: 33
All time rank: 37716 in United Kingdom
Week rank: 17 Up1 in United Kingdom Up
Innovation award
Innovation award
Nominee: 17x

Winner: 3x


#!/usr/bin/env php
* @author Pierre-Henry Soria <>
* @copyright (c) 2017, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; <>
require __DIR__ . '/../vendor/autoload.php';

// PHP 7+
use Monolog\{
Logger, Handler\StreamHandler


$oDotEnv = new Dotenv(dirname(__DIR__));

$oLogger = new Logger('CompaniesLookup');
$oLogger->pushHandler(new StreamHandler("php://stdout", Logger::DEBUG));

$oApp = new Application(
"Welcome to \"Companies House\" lookup console interface.\n\n",

$oClient = new Client(getenv('COMPANIES_HOUSE_API_KEY'));
$aCommands = [





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.

  Files folder image Files  
File Role Description
Files folder imageassets (2 files)
Files folder imagebin (1 file)
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file companies Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  assets  
File Role Description
  Accessible without login Image file companies-lookup-example.png Data Auxiliary data
  Accessible without login Image file CompaniesHouseLookup.gif Icon Icon image

  Files folder image Files  /  bin  
File Role Description
  Accessible without login Plain text file companies Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file Search.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file SearchTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,533
This week:524Up