Skip to content

Quickstart

From sign-up to your first API calls in about 15 minutes. You need Python 3.11+, Node.js 18+ or curl.

  1. 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).

  2. 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.

  3. 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_read and usage_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.

  4. 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 json
    import os
    import urllib.request
    BASE = 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)")

    A 401 means the secret is wrong or missing: see auth.invalid_key.

  5. Unlock a record. POST /v1/unlock delivers the bundles of fields you ask for, for up to 100 record IDs. POST /v1/estimate tells you the cost first, for free. Every spending call needs an Idempotency-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 json
    import os
    import urllib.request
    import uuid
    BASE = 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_key
    request = 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 request
    result = 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"))

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.