Companies API
List, search companies and fetch contacts within companies.
Methods
list(options)List companies with optional filters: industry, size.
get(id)Get a single company by ID.
search(query)Search companies by name.
listContacts(id)List all contacts belonging to a company.
listAll()Async generator for automatic pagination over all companies.
Example
// List
const { data } = await lystica.companies.list({
industry: "Technology",
size: "51-200",
});
// Get by ID
const company = await lystica.companies.get("cmp_abc123");
// Search
const { data: results } = await lystica.companies.search("acme");
// List contacts in a company
const { data: contacts } = await lystica.companies.listContacts("cmp_abc123");
// Iterate all
for await (const company of lystica.companies.listAll()) {
console.log(company.name);
}