Skip to content

Python SDK & CLI

DiscoLike publishes an official Python SDK and CLI, covering the full public API: discovery, company profiles, contacts, match, append, segment, ICP validation, saved queries, and account.

Terminal window
pip install discolike # SDK only, for use as a library
pip install discolike-cli # CLI — installs discolike as a dependency
pip install "discolike[cli]" # same thing, extras spelling

Run the CLI without installing anything:

Terminal window
uvx --from discolike-cli discolike --help

Requires Python 3.10+.

Terminal window
export DISCOLIKE_API_KEY="dl_..." # environment variable
discolike auth login # or store it via the CLI
client = Discolike(api_key="dl_...") # or pass it explicitly
from discolike import Discolike
client = Discolike()
companies = client.discover(
icp_text="Cybersecurity for SMBs, managed IT services, endpoint protection",
country=["US"],
max_records=25,
)
for company in companies:
print(company.domain, company.name, company.similarity)

Async endpoints (DiscoGen, bulk match, segment, ICP validation) return a Job — call .wait() to block until it finishes:

job = client.discogen.process(
query="Recent funding rounds and headcount growth",
domains=["stripe.com", "adyen.com"],
web_search=True,
)
result = job.wait()

Every resource has an async twin on AsyncDiscolike:

import asyncio
from discolike import AsyncDiscolike
async def main() -> None:
async with AsyncDiscolike() as client:
companies = await client.discover(icp_text="B2B SaaS for logistics", max_records=10)
print([c.domain for c in companies])
asyncio.run(main())

All responses are typed Pydantic models. Errors inherit from DiscolikeError (RateLimitError, ValidationError, AuthenticationError, PlanAccessError, NotFoundError, ServerError, APIConnectionError); transient failures retry automatically.

Terminal window
discolike discover --icp-text "managed IT services for SMBs" --country US --max-records 25
discolike match "Stripe Inc" --city "San Francisco"
discolike match --file companies.csv --name-column company_name --wait
discolike company data stripe.com

Output is JSON-first — results to stdout, errors (error, message, status_code) to stderr. Pass --format table for a human-readable table, used automatically when stdout is a TTY.

Async operations (match --file, discogen run, discogen run-personas, segment, validate-icp) take --wait to block until the job finishes; without it you get a task_id to poll with discolike discogen status <task_id> --family <family>.

Exit codeMeaning
0Success
1Server error or unexpected failure
2Validation error
3Authentication or plan-access error
4Rate limited
5Network error
6Not found

See the repo README for the full command reference, configuration options, and error handling.