langchain-companystack
LangChain tools for the CompanyStack API. Agents can search UK companies by name and read a company's register profile, officers and persons with significant control (PSC).
CompanyStack's data is a copy of public registers, mainly the Companies House register. It may be incomplete or out of date. Check anything important against the company's entry at Companies House. CompanyStack is not affiliated with or endorsed by Companies House. Contains public sector information licensed under the Open Government Licence v3.0.
Install
pip install -U langchain-companystack
API key
Create an account at https://companystack.co.uk/signup to get a free API key, then set it:
export COMPANYSTACK_API_KEY="cs_your_key"
You can also pass it in code: CompanyStackAPIWrapper(api_key="cs_your_key").
Tools
| Tool | Name the model sees | API call | Plans |
|---|---|---|---|
CompanyStackSearchTool |
companystack_search_companies |
GET /company/search |
Free (first 10 results) and above |
CompanyStackCompanyTool |
companystack_get_company |
GET /company/{number} |
Free and above |
CompanyStackOfficersTool |
companystack_get_officers |
GET /officers/company/{number} |
Starter and above, or pay-as-you-go credits |
CompanyStackPSCTool |
companystack_get_persons_with_significant_control |
GET /psc/company/{number} |
Starter and above, or pay-as-you-go credits |
Each tool returns the API's JSON as a string. When a call is not on the key's plan, the tool returns a plain message with the upgrade link instead of raising, so the agent can tell the user. A missing or refused key, a rate limit and an unknown company number are reported the same way.
Use
from langchain_companystack import CompanyStackCompanyTool, CompanyStackSearchTool
search = CompanyStackSearchTool()
print(search.invoke({"query": "tesco", "limit": 3}))
company = CompanyStackCompanyTool()
print(company.invoke({"company_number": "00445790"}))
All four tools at once, sharing one key:
from langchain_companystack import CompanyStackToolkit
tools = CompanyStackToolkit().get_tools()
With an agent (any chat model that supports tool calling; this example needs pip install langchain langchain-anthropic and an Anthropic key):
from langchain.agents import create_agent
from langchain_companystack import CompanyStackToolkit
agent = create_agent("anthropic:claude-sonnet-4-5", tools=CompanyStackToolkit().get_tools())
result = agent.invoke({"messages": [{"role": "user", "content": "When are Tesco PLC's next accounts due?"}]})
print(result["messages"][-1].content)
Plans and limits
From https://companystack.co.uk/llms.txt, where current prices and limits are kept:
- Free: £0. 1,000 requests a day, 30 a minute. Search companies (top 10 results) and pull a full company profile by number.
- Starter: £29/month or £288/year. 10,000 requests a day, 60 a minute. Adds officers, owners (PSC) and filing history, among other things.
- Pay as you go: prepaid credits, from £10 for 1,000 credits, for calls your plan does not include. A standard lookup costs 1 credit.
Full details: https://companystack.co.uk/pricing?product=api.
Development
pip install -e ".[test]"
pytest
The tests use a mocked HTTP transport and make no network calls. They include LangChain's standard tool tests (langchain-tests).
Licence
MIT. See LICENSE.
Metadata
Release files for langchain-companystack 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_companystack-0.1.0.tar.gz | 9.2 kB | With provenance | Details for langchain_companystack-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_companystack-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_companystack-0.1.0-py3-none-any.whl |
Total release size: 19.2 kB
Release files / langchain_companystack-0.1.0.tar.gz
| Download URL | langchain_companystack-0.1.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b1e7bd36a25da4b3ac81c29e05fb71ae9a9a82cb59c7de92e85a9442f5188fc
|
|
BLAKE2b-256 checksum How to use checksums |
2a6d164de770bb1faf697847d15a86194d24f7c55d88d8cccde75d2118694bdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / langchain_companystack-0.1.0-py3-none-any.whl
| Download URL | langchain_companystack-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b51c03cfbf3675ff9896ce8ad70bcc3b2d48f68f1b67fcb1357ead49c5107cbf
|
|
BLAKE2b-256 checksum How to use checksums |
9766ef2c610b65b8f832ca4c8080698a5e8772d8c19c9950b3ef6f78f26d9030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for langchain-companystack 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for langchain_companystack-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.