Skip to main content

langchain-groundtruth

LangChain tools that look up a company from its website domain: who runs the domain, what its website runs on, whether it is hiring, and how to reach it. Every item in the answer links to the page or record it came from.

pip install -U langchain-groundtruth

Python 3.10+ (the minimum for langchain-core). Works without a key on the free tier (10 calls a day).

Two lines

from langchain_groundtruth import GroundTruthCompanyLookup

print(GroundTruthCompanyLookup().invoke({"domain": "stripe.com"}))

The tools

Class Tool name Input Returns
GroundTruthCompanyLookup groundtruth_company_lookup domain; optional name, country, ticker JSON: registrar and DNS record, email provider, tech stack, hiring (open roles, salary ranges where published, roles opened and closed in the last 30 days). With name and country the official register entry; with ticker revenue reported to the SEC. A part with nothing to report is listed under missing with the reason
GroundTruthCompanyContacts groundtruth_company_contacts domain JSON: phone numbers, role inboxes such as sales@, contact page, postal address, read from the company's own website. For US companies also the other addresses it published at its own domain. Nothing is guessed from a name pattern

Both are BaseTool subclasses with pydantic input schemas, sync and async.

Agent example

from langchain.agents import create_agent
from langchain_groundtruth import GroundTruthCompanyContacts, GroundTruthCompanyLookup

agent = create_agent(
    model="openai:gpt-5.5",  # any chat model you have configured
    tools=[GroundTruthCompanyLookup(), GroundTruthCompanyContacts()],
)
result = agent.invoke(
    {"messages": [{"role": "user", "content": "Is stripe.com hiring, and what does its website run on?"}]}
)
print(result["messages"][-1].content)

Key

export GROUNDTRUTH_API_KEY="your-key"

or pass it in: GroundTruthCompanyLookup(api_key="your-key"). Without a key you get 10 calls a day per caller, no sign-up.

Free tier 10 calls a day, no key
$10 once 2,000 calls that never expire. Buy
$49 a month 20,000 calls a month. Buy

A company lookup uses 2 of a key's calls, a contacts lookup 4. A call that fails is not charged. Live prices: https://companyfacts.dev/pricing

Errors

A failed call does not crash the agent. The tools set handle_tool_error, so the message comes back as the tool result (a ToolMessage with status error) and the model can read it and tell the user. That covers a spent free allowance (the message includes where to buy a key), a malformed domain, a site that blocks automated readers, a domain with nothing found, and an upstream source being down.

tool = GroundTruthCompanyLookup()
print(tool.invoke({"domain": "stripe.com"}))
# If the free allowance is used up this prints the explanation and the buy link, it does not raise.

To get exceptions instead, set handle_tool_error=False.

Options

Argument Default
api_key GROUNDTRUTH_API_KEY env var, else none Stored as a secret, never shown in repr
base_url https://companyfacts.dev Point at another deployment
timeout 60.0 Seconds per call. A company lookup runs several checks in parallel

Tests

pip install pytest pytest-asyncio langchain-tests
PYTHONPATH=src python -m pytest tests/unit_tests
GROUNDTRUTH_LIVE=1 PYTHONPATH=src python -m pytest tests/integration_tests   # calls the real API

The unit tests run LangChain's standard ToolsUnitTests and ToolsIntegrationTests suites, plus behaviour tests, with the HTTP layer faked.

Other ways in

The same data is available as a Python client (groundtruth-company), a remote MCP server at https://companyfacts.dev/mcp, and plain REST. Docs: https://companyfacts.dev/llms.txt

MIT licensed.

Metadata

Release files for langchain-groundtruth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-groundtruth 0.1.0
File Size Uploaded Provenance Actions
langchain_groundtruth-0.1.0.tar.gz 8.6 kB Without provenance Details for langchain_groundtruth-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-groundtruth 0.1.0
File Interpreter ABI Platform Actions
langchain_groundtruth-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_groundtruth-0.1.0-py3-none-any.whl

Total release size: 16.0 kB

Release files / langchain_groundtruth-0.1.0.tar.gz

Download URL langchain_groundtruth-0.1.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
88496e14ea3cf73378773ddf494ee398e71b14f316aef541af252d97808eab9e
BLAKE2b-256 checksum
How to use checksums
b24f57cccf51bee6be66f353e7dbbd812a4e2d545fee5cf31d3cab1ed01f17a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / langchain_groundtruth-0.1.0-py3-none-any.whl

Download URL langchain_groundtruth-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f94d0c8c5e00a7c242a4a6fdce67ab333cdbc33211928404fd23621a04b0cb87
BLAKE2b-256 checksum
How to use checksums
f00d041ced439dee32070da9aeb9cc193631d251dc8e56891b607085cb1f9a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for langchain-groundtruth 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page