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.
- Repository: github.com/Discolike/discolike-python
- SDK on PyPI: pypi.org/project/discolike
- CLI on PyPI: pypi.org/project/discolike-cli
Install
Section titled “Install”pip install discolike # SDK only, for use as a librarypip install discolike-cli # CLI — installs discolike as a dependencypip install "discolike[cli]" # same thing, extras spellingRun the CLI without installing anything:
uvx --from discolike-cli discolike --helpRequires Python 3.10+.
Authenticate
Section titled “Authenticate”export DISCOLIKE_API_KEY="dl_..." # environment variablediscolike auth login # or store it via the CLIclient = Discolike(api_key="dl_...") # or pass it explicitlySDK quickstart
Section titled “SDK quickstart”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 asynciofrom 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.
CLI quickstart
Section titled “CLI quickstart”discolike discover --icp-text "managed IT services for SMBs" --country US --max-records 25discolike match "Stripe Inc" --city "San Francisco"discolike match --file companies.csv --name-column company_name --waitdiscolike company data stripe.comOutput 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 code | Meaning |
|---|---|
| 0 | Success |
| 1 | Server error or unexpected failure |
| 2 | Validation error |
| 3 | Authentication or plan-access error |
| 4 | Rate limited |
| 5 | Network error |
| 6 | Not found |
See the repo README for the full command reference, configuration options, and error handling.