Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this package are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
[Semantic Versioning](https://semver.org/).

## [0.3.0] - 2026-11-25

### Added

- `people.search`: `include_company` (default True) and `include_emails` (default False, on with `has_verified_email`).

### Changed

- The API counts each person as one search record and their company as another, and each work email
as one enrichment record. Pass `include_company=False` for people only.
- Search results no longer carry work emails unless you ask for them with `include_emails=True`.

## [0.2.0] - 2026-11-19

### Added
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Keep the key out of source control. A free key is available at [leadsets.ai/sign

| Method | Endpoint | Uses |
| --- | --- | --- |
| `ls.people.search(**params)` | `POST /v1/people/search` | 1 search record per record returned |
| `ls.people.search(**params)` | `POST /v1/people/search` | 1 search record per person, 1 per company, 1 enrichment record per email |
| `ls.people.enrich(**params)` | `POST /v1/people/enrich` | 1 enrichment record when found (+1 for a personal email) |
| `ls.companies.search(**params)` | `POST /v1/companies/search` | 1 search record per record returned |
| `ls.companies.enrich(**params)` | `POST /v1/companies/enrich` | 1 enrichment record when found |
Expand All @@ -103,7 +103,9 @@ Responses are dataclasses: `res.items[0].email.status`. `obj.to_dict()` returns

### People search

Filters: `title` (add `match_headline=True` to also match the LinkedIn headline), `seniority` (`c_level`, `vp`, `head`, `director`, `manager`, `ic`), `function` (`revenue`, `marketing`, `engineering`, `product`, `ops`, `finance`, `hr`), `company_domain`, `company_keywords` / `exclude_company_keywords` (what their company does), `employees` (`"50-200"`, `"1000+"`, `"<50"`), `industry` (slugs such as `"saas"`), `country` (ISO 3166-1 alpha-2), `has_verified_email`, `max_age_days`, `exclude_stale`, `limit` (1–100, default 25) and `cursor`. A string or a list works wherever a list is accepted.
Filters: `title` (add `match_headline=True` to also match the LinkedIn headline), `seniority` (`c_level`, `vp`, `head`, `director`, `manager`, `ic`), `function` (`revenue`, `marketing`, `engineering`, `product`, `ops`, `finance`, `hr`), `company_domain`, `company_keywords` / `exclude_company_keywords` (what their company does), `employees` (`"50-200"`, `"1000+"`, `"<50"`), `industry` (slugs such as `"saas"`), `country` (ISO 3166-1 alpha-2), `has_verified_email`, `include_company`, `include_emails`, `max_age_days`, `exclude_stale`, `limit` (1–100, default 25) and `cursor`. A string or a list works wherever a list is accepted.

Each person is one search record and their company another: pass `include_company=False` for people only. Work emails come with `include_emails=True` (or `has_verified_email`) and use 1 enrichment record each.

Count before you pull, for free, and find the best contacts at one company in your order of preference:

Expand All @@ -113,6 +115,7 @@ n = ls.companies.count(keywords=["clay", "gtm engineering"], exclude_keywords=["
res = ls.people.search(
company_domain="northwind.io",
priorities=[{"title": ["founder", "ceo"], "match_headline": True}, {"title": ["head of growth", "vp sales"]}],
include_emails=True,
limit=3,
)
for p in res.items:
Expand Down
1 change: 1 addition & 0 deletions examples/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
employees="20-200",
country="US",
industry="saas",
include_emails=True, # 1 enrichment record per email
limit=10,
)

Expand Down
2 changes: 1 addition & 1 deletion src/leadsets/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.3.0"
6 changes: 4 additions & 2 deletions src/leadsets/resources/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def search(
extra_headers: Mapping[str, str] | None = None,
**params: Unpack[PeopleSearchParams],
) -> PeopleSearchResponse:
"""POST /v1/people/search. 1 search record per record returned; empty results use none."""
"""POST /v1/people/search. 1 search record per person and 1 for their company, 1 enrichment
record per work email (``include_emails``); empty results use none."""
return self._client.request(
"POST",
"/people/search",
Expand Down Expand Up @@ -159,7 +160,8 @@ async def search(
extra_headers: Mapping[str, str] | None = None,
**params: Unpack[PeopleSearchParams],
) -> PeopleSearchResponse:
"""POST /v1/people/search. 1 search record per record returned; empty results use none."""
"""POST /v1/people/search. 1 search record per person and 1 for their company, 1 enrichment
record per work email (``include_emails``); empty results use none."""
return await self._client.request(
"POST",
"/people/search",
Expand Down
7 changes: 7 additions & 0 deletions src/leadsets/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ class PeopleSearchParams(TypedDict, total=False):
#: ISO 3166-1 alpha-2 country codes, e.g. "US".
country: _StrList
has_verified_email: bool
#: Company details on each person (default True): one more search record per person.
include_company: bool
#: The work email on each person when one is found (default False, on with
#: ``has_verified_email``): 1 enrichment record each.
include_emails: bool
max_age_days: int
exclude_stale: bool
#: 1–100. Default 25. Free plan: at most 10.
Expand Down Expand Up @@ -295,7 +300,9 @@ class Person(Model):
function_detail: str | None = None
linkedin_url: str | None = None
location: Location = dataclasses.field(default_factory=Location)
#: None when left out with ``include_company=False``.
company: PersonCompany | None = None
#: On ``people.search``, set only with ``include_emails`` or ``has_verified_email``.
email: Email | None = None
#: Present on ``people.enrich`` with ``include_personal_email``.
personal_email: Email | None = None
Expand Down
11 changes: 11 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,17 @@ def test_count_sends_count_only(self, ls: Leadsets, mock: respx.MockRouter) -> N
assert isinstance(sent, dict)
assert sent["count_only"] is True

def test_include_options(self, ls: Leadsets, mock: respx.MockRouter) -> None:
bare = {k: v for k, v in person().items() if k not in ("company", "email")}
route = mock.post("/v1/people/search").respond(
json={"items": [bare], "next_cursor": None, "usage": {"enrich_records_counted": 0}, "request_id": "r"}
)
res = ls.people.search(include_company=False, include_emails=True)
assert body(route) == {"include_company": False, "include_emails": True}
assert res.items[0].company is None
assert res.items[0].email is None
assert res.usage.enrich_records_counted == 0

def test_priorities_and_new_fields(self, ls: Leadsets, mock: respx.MockRouter) -> None:
route = mock.post("/v1/people/search").respond(
json={
Expand Down
Loading