# Check a domain list for tech stack over the HTTP API

> Check a list of domains for the tools each one runs, through the Cookie Crowbar HTTP API: a short Python script that sends the list with a saved config, waits for the batch, and prints each row with its confidence and verification labels and the checks that did not complete.

To check a list of domains for tech stack through the API, save a config once (explore up to 3 sample domains, test a draft config on them, save it), then send the list to POST /v1/scans with that config_id and poll GET /v1/scans/:batchId until there is nothing left to wait for. Read each row’s confidence and verification labels together with its coverage gaps. Explore and scan count each requested domain that doesn’t fail against the key’s monthly allowance, if it has one; reading shared results with GET /v1/domains/:domain does not.

**Figure: Save a config once, send the list to POST /v1/scans with that config_id, and poll GET /v1/scans/:batchId until there is nothing left to wait for. Reading shared results with GET /v1/domains/:domain does not count against the allowance.**

1. **save a config once** (explore, test, save): POST /v1/explore · POST /v1/configs/test · POST /v1/configs → config_id
2. **send the list** (POST /v1/scans): the config_id and the domains · each requested domain that doesn't fail counts against the allowance
3. **wait for the batch, then read** (GET /v1/scans/:batchId): poll until there is no next · rows: confidence, verification · gaps: partial, coverage gaps, note

The script in this post takes a list of domains and returns, for each one, the tools Cookie Crowbar observed on its public website and DNS, with how strong and what kind of evidence is behind each. You save a config once, send the list, wait for the batch and read the rows.

Everything here is from the [HTTP API reference](https://cookiecrowbar.com/docs/http-api). Examples use invented domains (`acme.example`,
`globex.example`, `initech.example`) and the placeholder key `cs_live_YOUR_KEY`. Every route except
`GET /v1/health` needs the key in the `X-API-Key` header.

## 1. Read what is already known, for free

`GET /v1/domains/:domain` returns shared results that anyone's earlier checks collected. It never collects, and
it doesn't count against the allowance:

```bash
curl -s https://api.cookiecrowbar.com/v1/domains/acme.example -H "X-API-Key: cs_live_YOUR_KEY"
```

A `404 NOT_FOUND` with `No shared observations for this domain` means nothing has been collected for it yet.

## 2. What counts against the allowance

Explore and scan count each requested domain against the key's allowance for the UTC calendar month (`limit` is `null` when the key has no cap), including
domains answered from cached observations. Failed domains don't count. The shared reads (`GET /v1/domains/:domain`
and its evidence route) don't count. A request that would pass the allowance is rejected in full with
`429 MONTHLY_LIMIT`, and nothing is queued.

`GET /v1/credits` shows this key's usage and the rules. There is no
route to cancel a batch, so start with a few dozen domains.

## 3. Save a config once

A scan runs a saved config, which says which checks to run and which categories to report. To make one:

1. `POST /v1/explore` with 1 to 3 sample domains. It answers `200` when every domain finished, otherwise `202`
   with what is ready so far. Poll `GET /v1/scans/:batchId` with its `batch_id` until nothing is left to wait for,
   then take each domain's `scan_id`.
2. `POST /v1/configs/test` with a draft `config` and those `scan_ids`. It runs over the stored evidence: no
   collection, no allowance. Each entry in its `results` has its own `missing` list: checks the config wants that
   the explore never collected. An entry can also carry an `error`, and `stale` lists scans whose evidence predates
   what the config reads. Explore those again before you rely on the test.
3. `POST /v1/configs` saves it and returns a `config_id`. Saved configs never change, so you can reuse the id
   for every list.

The config syntax is in the `guide` MCP tool. If you use an assistant with the [MCP server](https://cookiecrowbar.com/docs/quickstart),
it can draft, test and save the config for you ([using it](https://cookiecrowbar.com/docs/using-it)), and this script takes the id from
there. The same kind of check also runs through the assistant, with no script.

## 4. The script

Python 3, standard library only. It sends the list, waits for the batch, then prints one tab-separated line
per row: domain, vendor, category, confidence, verification. Domains with gaps get a line on stderr.

```python
#!/usr/bin/env python3
"""Scan a domain list with a saved Cookie Crowbar config.
Usage: CC_KEY=cs_live_YOUR_KEY python3 scan_list.py CONFIG_ID domains.txt > rows.tsv"""
import json, os, sys, time, urllib.error, urllib.parse, urllib.request

API = "https://api.cookiecrowbar.com"
KEY = os.environ["CC_KEY"]

def call(method, path, body=None):
    while True:
        req = urllib.request.Request(
            API + path, method=method,
            data=None if body is None else json.dumps(body).encode(),
            headers={"X-API-Key": KEY, "Content-Type": "application/json"})
        try:
            with urllib.request.urlopen(req, timeout=60) as r:
                return json.load(r)
        except urllib.error.HTTPError as e:
            err = json.load(e)
            if err.get("code") == "RATE_LIMIT_EXCEEDED":  # per-minute budget: wait and retry
                time.sleep(int(e.headers.get("Retry-After", 2)))
                continue
            sys.exit(f"{e.code} {err.get('code')}: {err.get('error')}")

config_id, path = sys.argv[1], sys.argv[2]
domains = [line.strip() for line in open(path) if line.strip()]
batch = call("POST", "/v1/scans", {"config_id": config_id, "domains": domains})
print(f"batch {batch['batch_id']}: {batch['domains']} domains, {batch['usage']['month']['domains']} counted this month", file=sys.stderr)

status = f"/v1/scans/{batch['batch_id']}"
while (page := call("GET", status + "?view=summary&limit=1")).get("next"):
    print(page["counts"], file=sys.stderr)
    time.sleep(page["next"]["poll_after_seconds"])

after = None
while True:
    query = {"view": "summary", "limit": 100, **({"after": after} if after else {})}
    page = call("GET", status + "?" + urllib.parse.urlencode(query))
    for scan in page["scans"]:
        result = scan.get("result") or {}
        for t in result.get("technologies", []):
            print("\t".join([scan["domain"], t["name"], t["category"], t["confidence"], t["verification"]]))
        if scan["status"] != "completed" or result.get("partial") or result.get("coverageGaps") or result.get("note"):
            print(f"# {scan['domain']}: {scan['status']}, partial={result.get('partial')}, "
                  f"gaps={result.get('coverageGaps')}, note={result.get('note')}", file=sys.stderr)
    after = page.get("next_after")
    if not after:
        break
```

Run it with a file of domains, one per line:

```bash
printf 'acme.example\nglobex.example\ninitech.example\n' > domains.txt
CC_KEY=cs_live_YOUR_KEY python3 scan_list.py 5b8f0c11-0000-4000-8000-000000000003 domains.txt > rows.tsv
```

How it follows the reference:

- **Waiting.** It polls no faster than `next.poll_after_seconds`, and stops when the batch has no `next`: then
  nothing is left to wait for.
- **Paging.** It reads 100 domains a page and passes each page's `next_after` as `after`, and stops when a page
  has none. Once the batch is done it doesn't need `order=completed`; use that on every page if you read while
  the batch is still running.
- **Errors.** It retries only `429 RATE_LIMIT_EXCEEDED`, after `Retry-After`. Anything else stops it with the
  `code`:
  - `429 MONTHLY_LIMIT`: nothing was queued.
  - `429 TOO_MANY_QUEUED`: this key has too many unfinished domains. It returns `pending`, `limit` and `batch_ids`,
    so poll those batches instead of resubmitting.
  - `503 TOO_MANY_QUEUED`: the shared queue is full. It carries a `Retry-After` header.
  - `400 INVALID_DOMAIN`: the bad inputs are in `invalid`.

The script waits for the whole batch to keep it short. Each domain is readable as soon as it has a `result`, so a
longer job can read `status=completed` pages while the batch is still running.

## 5. Read the rows

Each row carries two separate labels. Confidence (confirmed, likely, possible, weak) says how strong the evidence
is. Verification (`used`, `registered`, `inferred`) says what kind it is: evidence that supports use on the pages
visited (not proof of a successful call to the vendor), configured or listed, or a name match only. [Scoring](https://cookiecrowbar.com/docs/scoring) has the full definitions.

The example below is three rows from stripe.com, observed on 2026-11-06. Marketo Munchkin is `used` on page
evidence: the checks found evidence that supports use on the pages visited. Zendesk rests on a DNS record and Salesforce on a trust-page listing: set up or listed, not seen running.

## 6. Read the gaps

A vendor with no row was not observed in the checks performed, and that is never proof of absence. Before you treat
a gap as a no, read the stderr line for that domain: a `partial` result, a check that was blocked or skipped, or a
`note` that nothing third-party ran on the homepage all make a missing row weaker. A quiet stderr doesn't settle
it either: even completed checks only see the company's public website and DNS, and a tool with no public
footprint leaves no row.

For HubSpot-specific checks, see [how to find companies using HubSpot](https://cookiecrowbar.com/blog/find-companies-using-hubspot).

## Worked example: stripe.com, observed 2026-11-23

| Vendor | Confidence | Verification | Activity | Evidence |
|---|---|---|---|---|
| Marketo Munchkin | confirmed | used | active | page |
| Zendesk | likely | registered | listed-only | DNS |
| Salesforce | possible | registered | listed-only | trust page |

## Read in the docs

- [HTTP API](https://cookiecrowbar.com/docs/http-api.md): Every public /v1 route with its parameters, request and response shapes, errors, rate limit and allowance behaviour.
- [Using it](https://cookiecrowbar.com/docs/using-it.md): The prompts that work, what comes back, and how to read an empty row.
- [Scoring](https://cookiecrowbar.com/docs/scoring.md): What a finding's confidence, verification and activity labels mean, and how to read them together.
