How do I build a Company Health Dashboard with UK company data?

You can build a Company Health Dashboard in Python using Streamlit and the DataLedger API. This tutorial shows you step-by-step how to fetch UK company data such as assets, liabilities, equity, employees, and SIC codes and display them in an interactive dashboard.

What is the Company Health Dashboard?

The Company Health Dashboard is a simple Python + Streamlit app that connects to the DataLedger API and displays UK company financial data. By entering a Companies House company number, you can see:

  • Company profile (name, address, SIC codes, employees)

  • Balance sheet (assets, liabilities, equity - current and previous year)

  • Financial ratios (debt-to-asset, debt-to-equity)

  • Year-on-year comparison charts

How do I set up the dashboard?

Step 1 - Clone the project from our GitHub


git clone https://github.com/dataledger-uk/dl-company-health-dashboard.git
cd company-health-dashboard

Step 2 - Install dependencies (using virtual environment)


python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Step 3 - Add API key (.env example)


DL_API_KEY=YOUR_API_KEY

Step 4 - Run the Streamlit app


streamlit run app.py

Step 5 - Open http://localhost:8501 in your browser.

What data can I get with the DataLedger API?

The dashboard uses the /v1/companies/[company_number] endpoint. It returns structured UK company data, including:

  • Profile fields: company name, registered address, local authority, SIC codes, officers, employee counts

  • Balance sheet (current year): total assets, liabilities, equity

  • Balance sheet (previous year): same metrics for comparison

  • Profit ad Loss figures (where reported by the company)

  • Ratios: debt-to-asset, debt-to-equity, asset growth

This data is drawn directly from Companies House filings but structured by DataLedger for fast search and export.

Troubleshooting

Why am I getting a 401 or 403 error?

Check that your API key is set in .env. The header should be:


DATALEDGER_API_KEY=KEY_FOR_DATALEDGER

Why does the app show “null” for some fields?

Not all companies disclose the same information. Smaller firms often file abbreviated accounts without turnover or P&L.

Frequently Asked Questions

Q: How do I extend this dashboard with more fields?
You can add turnover, profit & loss, and growth rates from the DataLedger API by mapping extra JSON fields in app.py.

Q: Can I share this dashboard online?
Yes. Push the repo to GitHub and deploy it for free on Streamlit Cloud.

Q: Do I need a Companies House API key?
No. DataLedger provides structured Companies House data directly — no need to process filings yourself.