DEV Community

kyb-api-toolkit
kyb-api-toolkit

Posted on Edited on AI-assisted

Run a UK company KYB check in one API call

Before you take on a UK business customer you usually want a few facts: is the company active, who are its current officers, and are its filings up to date. Companies House has all of it, but you have to stitch several endpoints together.

One call to a KYB endpoint returns the profile and the officers together.

import os, requests

HOST = "uk-company-kyb-api.p.rapidapi.com"
headers = {"x-rapidapi-host": HOST, "x-rapidapi-key": os.environ["RAPIDAPI_KEY"]}

kyb = requests.get(f"https://{HOST}/company/00445790/kyb",
                   headers=headers, timeout=30).json()

c = kyb["company"]
print(c["companyName"], c["statusLabel"])
print("active officers:", kyb["officers"]["active"], "of", kyb["officers"]["total"])
print("accounts overdue:", c["accounts"]["overdue"])
Enter fullscreen mode Exit fullscreen mode

For company number 00445790 this prints TESCO PLC Active, 12 active officers out of 75, and accounts overdue: False.

Find the company number first

hits = requests.get(f"https://{HOST}/search", headers=headers,
                    params={"q": "tesco", "limit": 3}, timeout=30).json()
Enter fullscreen mode Exit fullscreen mode

What is in the response

Status, company type, registered office, SIC codes, accounts and confirmation statement due dates, insolvency and charges flags, and the officer list with appointment and resignation dates.

Treat it as a screening aid. For a regulated decision, confirm on the official register.

Try it

Top comments (0)