https://github.com/maxmekiska/companieshouse_api
Code to interface with the Companies House API.
https://github.com/maxmekiska/companieshouse_api
api companies-house company registry uk wrapper-api
Last synced: 6 months ago
JSON representation
Code to interface with the Companies House API.
- Host: GitHub
- URL: https://github.com/maxmekiska/companieshouse_api
- Owner: maxmekiska
- Created: 2022-04-03T01:29:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T11:44:06.000Z (over 1 year ago)
- Last Synced: 2024-10-09T12:57:51.713Z (about 1 year ago)
- Topics: api, companies-house, company, registry, uk, wrapper-api
- Language: Jupyter Notebook
- Homepage:
- Size: 6.37 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CompaniesHouse API Wrapper
This code serves as a wrapper to interface with the Companies House API. Please create an API key to use this wrappers functionalities. You can crate an API key by following the official instructions: https://developer.company-information.service.gov.uk/get-started
Feel free to use the Jupyter Notebook "API prod.ipynb" as an interface.
## Launch virtual Jupyter Notebook
[](https://mybinder.org/v2/gh/maxmekiska/CompaniesHouse_API/main?labpath=API%20prod.ipynb)
## Creating a CHouse object
To interface with the companies house API, a CHouse object needs to be created. This is possible by passing a valid API key string into the CHouse class.
After a successful object creation, it is possible to filter companies after their SIC codes and current status (active, inactive). This filter and extraction process is done via the filter\_sic(sic\_code, status, start index) method. Please note that the start index determines where the extraction process should begin. If all filter specified companies shall be extracted, please set the start index to 0.

## Creating a company location Map
The filtered data can be enriched with the geographical location of the different companies. This can be achieved by calling the method create\_map(data, display map). The second argument of the method allows the user to specify if the map shall be instantly rendered within a Jupyter Notebook. Please note that the map will be saved within an CompanyMap.html file if the second argument is set to False.


## Enriching data with significant owner
The method enrich\_founder(data) will add information to the existing data by retrieving all owners with significant control based on the company id.
## Retrieve company filings
The method retrieve\_filings(company id) will retrieve the latest company filings based on the passed in company id.

## Saving data in a .xlsx file
You can save your retrieved data anytime as an xlsx file by using the export\_excel(data) method. The file generated will be named as follows: CompaniesExport.xlsx