No commit activity in last 3 years
No release in over 3 years
A wrapper around Companies House Open API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.10.5
~> 2.9.0
~> 1.8.8

Runtime

~> 0.8.4
>= 0
 Project Readme

Open Companies House

Simple ruby wrapper around Companies House Open API

Installation

In your Gemfile

gem "open-companies-house", "~> 0.2.0", require: 'companies_house'

Usage

company = CompaniesHouse.lookup "07495895"
=> #<CompaniesHouse:0x00000100932870 @registration_number="07495895"... >

company["CompanyName"]
=> "GOCARDLESS LTD"

company.sic_code # convenience method
=> "62090"

Caching

If you'd like to cache your requests, you can configure the gem:

# file config/initializers/companies_house.rb

# swap in your own cache here
CompaniesHouse.cache = Rails.cache

# Optional
CompaniesHouse.cache_args = { expires_in: 10.minutes }

Specs

rspec spec

Available Data

The following data is currently available on the company object returned by CompaniesHouse.lookup

You can access the data in one of two ways:

  1. Directly from the hash:
company["RegAddress"]["AddressLine1"]
=> "22-25 FINSBURY SQUARE"
  1. As a human-readable method:
company.reg_address.address_line1
=> "22-25 FINSBURY SQUARE"

Note that for more complicated keys, you may have to check the precise translation between the camelcase hash key and the human readable method.

All data:

{
  "CompanyName" : "GOCARDLESS LTD",
  "CompanyNumber" : "07495895",
  "RegAddress" : {
     "AddressLine1" : "22-25 FINSBURY SQUARE",
     "PostTown" : "LONDON",
     "Country" : "UNITED KINGDOM",
     "Postcode" : "EC2A 1DX"
  },
  "CompanyCategory" : "Private Limited Company",
  "CompanyStatus" : "Active",
  "CountryOfOrigin" : "United Kingdom",
  "IncorporationDate" : "17/01/2011",
  "PreviousNames" : [
     {
        "CONDate" : "25/08/2011",
        "CompanyName" : "GROUPAY LIMITED"
     }
  ],
  "Accounts" : {
     "AccountRefDay" : "31",
     "AccountRefMonth" : "01",
     "NextDueDate" : "31/10/2013",
     "LastMadeUpDate" : "31/01/2012",
     "AccountCategory" : "TOTAL EXEMPTION SMALL"
  },
  "Returns" : {
     "NextDueDate" : "14/02/2013",
     "LastMadeUpDate" : "17/01/2012"
  },
  "Mortgages" : {
     "NumMortCharges" : "1",
     "NumMortOutstanding" : "1",
     "NumMortPartSatisfied" : "0",
     "NumMortSatisfied" : "0"
  },
  "SICCodes" : {
     "SicText" : [
        "62090 - Other information technology service activities"
     ]
  }
}