QuickstartΒΆ

Here is a quick introduction to chwrapper.

First, make sure that:

Creating a search object with chwrapper is simple. Begin by importing the chwrapper module:

>>> import chwrapper

And then create a Search object

>>> s = chwrapper.Search(access_token="12345")

This creates a Search object called s.

An access token can be obtained from Companies House and can either be passed explicitly to the Search object, or implicitly as an environment variable called COMPANIES_HOUSE_KEY or CompaniesHouseKey.

To query the API, we can use the Search object’s methods. For example:

>>> r = s.search_companies("1234567")
>>> r.status_code
200
>>> r.json
{'start_index': 0, 'kind': 'search#companies', 'page_number': 1,
'total_results': 1,...}

All the Search class methods can be found in the Developer Interface.