Search and count
Count (free)
Section titled “Count (free)”POST /v1/count says how many records of a data product match a filter, with
optional facets (the most common values of a field, with their counts).
{ "entity": "person", "product": "fl-restaurant-owners", "filter": { "all": [ { "field": "job.role.rank", "gte": 90 }, { "field": "has_mobile", "eq": true } ] }, "facets": ["location.place"] }The answer has data.count and data.facets (each bucket has code, label and count).
"""Count the records a filter selects: POST /v1/count (free).
Not live yet: count needs the search engine and answers 503 `unavailable` today."""
import jsonimport osimport urllib.request
BASE = os.environ.get("ZEMO_API_BASE", "https://api.zemodata.com")body = { "entity": "person", "product": os.environ.get("ZEMO_PRODUCT", "demo-people"), "filter": {"all": [{"field": "has_work_email", "eq": True}]},}request = urllib.request.Request( f"{BASE}/v1/count", data=json.dumps(body).encode(), headers={"Authorization": f"Bearer {os.environ['ZEMO_API_KEY']}", "Content-Type": "application/json"}, method="POST",)with urllib.request.urlopen(request, timeout=30) as response: print(json.load(response)["data"]["count"], "records")// Count the records a filter selects: POST /v1/count (free).// Not live yet: count needs the search engine and answers 503 `unavailable` today.
const BASE = process.env.ZEMO_API_BASE ?? "https://api.zemodata.com";
const response = await fetch(`${BASE}/v1/count`, { method: "POST", headers: { Authorization: `Bearer ${process.env.ZEMO_API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ entity: "person", product: process.env.ZEMO_PRODUCT ?? "demo-people", filter: { all: [{ field: "has_work_email", eq: true }] }, }),});if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);console.log((await response.json()).data.count, "records");# Count the records a filter selects: POST /v1/count (free).# Not live yet: count needs the search engine and answers 503 `unavailable` today.set -euo pipefailBASE="${ZEMO_API_BASE:-https://api.zemodata.com}"
curl --silent --show-error --fail-with-body \ -H "Authorization: Bearer $ZEMO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"entity": "person", "product": "demo-people", "filter": {"all": [{"field": "has_work_email", "eq": true}]}}' \ "$BASE/v1/count"echoSearch (free)
Section titled “Search (free)”POST /v1/person/search and POST /v1/company/search return pages of matching records with contact
values hidden: you see names, jobs, employers, places and has_* flags (for example has_mobile),
and owned_bundles for records you already own. Then unlock the IDs you
want.
size: up to 100 per page;sort: sortable fields (the order always ends withid).next_cursorgets the next page (see Pagination); a cursor lasts 10 minutes and only works for the same query and key.exclude_owned: trueskips records you already own.- Paging stops at your plan’s depth (10,000 by default): beyond it the answer is
422 search.depth_exceeded. Use a bulk job to take everything a filter selects.
Other free calls
Section titled “Other free calls”GET /v1/autocomplete?field=company.name&q=bri&product=…suggests values of a text field.GET /v1/productslists your products with a record count (see Data products).GET /v1/fields,GET /v1/taxonomy/categories,GET /v1/taxonomy/rolesandGET /v1/geo/placesgive the fields and codes filters use.