Quickstart
From sign-up to your first API calls in about 15 minutes. You need Python 3.11+, Node.js 18+ or curl.
-
Sign up at app.zemodata.com with your work email. Accept the terms of use: zemoData data may never be used to decide credit, employment, insurance or housing (the purposes the US Fair Credit Reporting Act regulates).
-
Confirm your email with the link we send you. Some accounts are reviewed before they can use live data; you can use a test key straight away while that happens.
-
Create a test key. In the portal, open API keys and choose Create key. Pick Test, the Bearer authentication mode, and the scopes
unlock,enrich,ledger_readandusage_read. Copy the secret (zd_test_sk_…): it is shown once. Store it like a password, for example in an environment variable:Terminal window export ZEMO_API_KEY="zd_test_sk_..."Test keys read a made-up test dataset and never spend credits. Live keys (
zd_live_…) read real data and spend credits; they need a confirmed email, an approved account and, for owners and admins, two-step sign-in. -
Check the key with
GET /v1/whoami. It is free and needs no scope.python/whoami.py """Check that your API key works: GET /v1/whoami (free, needs no scope)."""import jsonimport osimport urllib.requestBASE = os.environ.get("ZEMO_API_BASE", "https://api.zemodata.com")SECRET = os.environ["ZEMO_API_KEY"] # zd_test_sk_… or zd_live_sk_…request = urllib.request.Request(f"{BASE}/v1/whoami",headers={"Authorization": f"Bearer {SECRET}"},)with urllib.request.urlopen(request, timeout=30) as response:me = json.load(response)print("organization:", me["org_id"])print("key:", me["public_id"], f"({me['env']}, {me['auth_mode']})")print("scopes:", ", ".join(me["scopes"]))print("products:", ", ".join(me["products"]) or "(all granted products)")javascript/whoami.mjs // Check that your API key works: GET /v1/whoami (free, needs no scope). Node 18 or later.const BASE = process.env.ZEMO_API_BASE ?? "https://api.zemodata.com";const SECRET = process.env.ZEMO_API_KEY; // zd_test_sk_… or zd_live_sk_…const response = await fetch(`${BASE}/v1/whoami`, {headers: { Authorization: `Bearer ${SECRET}` },});if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);const me = await response.json();console.log("organization:", me.org_id);console.log("key:", me.public_id, `(${me.env}, ${me.auth_mode})`);console.log("scopes:", me.scopes.join(", "));console.log("products:", me.products.join(", ") || "(all granted products)");curl/whoami.sh # Check that your API key works: GET /v1/whoami (free, needs no scope).set -euo pipefailBASE="${ZEMO_API_BASE:-https://api.zemodata.com}"curl --silent --show-error --fail-with-body \-H "Authorization: Bearer $ZEMO_API_KEY" \"$BASE/v1/whoami"echoA
401means the secret is wrong or missing: seeauth.invalid_key. -
Unlock a record.
POST /v1/unlockdelivers the bundles of fields you ask for, for up to 100 record IDs.POST /v1/estimatetells you the cost first, for free. Every spending call needs anIdempotency-Key, so a retry never charges twice.python/unlock.py """Estimate the cost (free), then unlock records by ID with an Idempotency-Key.Test keys (zd_test_…) read the test dataset and never spend credits:meta.credits_would_charge shows what a live key would pay."""import jsonimport osimport urllib.requestimport uuidBASE = os.environ.get("ZEMO_API_BASE", "https://api.zemodata.com")SECRET = os.environ["ZEMO_API_KEY"]def post(path: str, body: dict, idempotency_key: str = "") -> dict:headers = {"Authorization": f"Bearer {SECRET}", "Content-Type": "application/json"}if idempotency_key:headers["Idempotency-Key"] = idempotency_keyrequest = urllib.request.Request(f"{BASE}{path}", data=json.dumps(body).encode(), headers=headers, method="POST")with urllib.request.urlopen(request, timeout=30) as response:return json.load(response)body = {"entity": "person","product": os.environ.get("ZEMO_PRODUCT", "demo-people"),"ids": [os.environ["ZEMO_RECORD_ID"]], # up to 100 IDs per call"bundles": ["profile", "work_email"],"max_credits": 50, # never pay more than this for the call}estimate = post("/v1/estimate", body)["data"]print("estimate:", estimate["credits"], "credits")key = str(uuid.uuid4()) # one key per logical request; reuse it only to retry the same requestresult = post("/v1/unlock", body, idempotency_key=key)meta = result["meta"]print("charged:", meta["credits_charged"], "would charge:", meta.get("credits_would_charge"))for item in result["data"]["records"]:emails = item["record"].get("emails", {}).get("work", [])print(item["id"], item["record"]["name"]["full"], [email["value"] for email in emails])for rejected in result["data"]["rejected"]:print("not delivered:", rejected["id"], rejected["reason"])# With a live key, a retry with the same key and body returns the stored answer and charges# nothing again (meta.replayed is true). Test keys answer afresh each time, also for free.again = post("/v1/unlock", body, idempotency_key=key)print("replayed:", again["meta"].get("replayed"))javascript/unlock.mjs // Estimate the cost (free), then unlock records by ID with an Idempotency-Key.// Test keys (zd_test_…) read the test dataset and never spend credits:// meta.credits_would_charge shows what a live key would pay.import { randomUUID } from "node:crypto";const BASE = process.env.ZEMO_API_BASE ?? "https://api.zemodata.com";async function post(path, body, idempotencyKey) {const headers = { Authorization: `Bearer ${process.env.ZEMO_API_KEY}`, "Content-Type": "application/json" };if (idempotencyKey) headers["Idempotency-Key"] = idempotencyKey;const response = await fetch(`${BASE}${path}`, { method: "POST", headers, body: JSON.stringify(body) });if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);return response.json();}const body = {entity: "person",product: process.env.ZEMO_PRODUCT ?? "demo-people",ids: [process.env.ZEMO_RECORD_ID], // up to 100 IDs per callbundles: ["profile", "work_email"],max_credits: 50, // never pay more than this for the call};const estimate = (await post("/v1/estimate", body)).data;console.log("estimate:", estimate.credits, "credits");const key = randomUUID(); // one key per logical request; reuse it only to retry the same requestconst result = await post("/v1/unlock", body, key);console.log("charged:", result.meta.credits_charged, "would charge:", result.meta.credits_would_charge);for (const item of result.data.records) {const emails = item.record.emails?.work ?? [];console.log(item.id, item.record.name.full, emails.map((email) => email.value));}for (const rejected of result.data.rejected) console.log("not delivered:", rejected.id, rejected.reason);// With a live key, a retry with the same key and body returns the stored answer and charges// nothing again (meta.replayed is true). Test keys answer afresh each time, also for free.const again = await post("/v1/unlock", body, key);console.log("replayed:", again.meta.replayed ?? null);curl/unlock.sh # Estimate the cost (free), then unlock records by ID with an Idempotency-Key.# Test keys (zd_test_…) never spend credits: meta.credits_would_charge shows what a live key would pay.set -euo pipefailBASE="${ZEMO_API_BASE:-https://api.zemodata.com}"PRODUCT="${ZEMO_PRODUCT:-demo-people}"body="{\"entity\": \"person\", \"product\": \"$PRODUCT\", \"ids\": [\"$ZEMO_RECORD_ID\"],\"bundles\": [\"profile\", \"work_email\"], \"max_credits\": 50}"curl --silent --show-error --fail-with-body \-H "Authorization: Bearer $ZEMO_API_KEY" -H "Content-Type: application/json" \-d "$body" "$BASE/v1/estimate"echokey="unlock-$(date +%s)-$RANDOM" # one key per logical request; reuse it only to retry itfor attempt in first retry; doanswer="$(curl --silent --show-error --fail-with-body \-H "Authorization: Bearer $ZEMO_API_KEY" -H "Content-Type: application/json" \-H "Idempotency-Key: $key" \-d "$body" "$BASE/v1/unlock")"echo "$answer"done# On the retry a live key gets the stored answer, charged once ("replayed": true).# Test keys answer afresh each time, also for free.echo "replayed: $(printf '%s' "$answer" | sed -n 's/.*"replayed": *\([a-z]*\).*/\1/p')"
Next steps
Section titled “Next steps”- Authentication: signed requests and OAuth, for production.
- Getting records: unlock, enrich and records by ID in detail.
- Credits and idempotency: what each call costs and how to retry.
- Errors: read problem responses and handle them.
Running the samples against your own machine
Section titled “Running the samples against your own machine”The samples read their settings from environment variables: ZEMO_API_KEY (and ZEMO_KEY_ID,
ZEMO_API_SECRET for signed requests), ZEMO_PRODUCT, ZEMO_RECORD_ID, ZEMO_EMAIL, and
ZEMO_API_BASE (default https://api.zemodata.com). They are in the zemoData repository under
tools/docs-samples/, and every one of them runs as a test against a local API before the docs are
published.