Queries and previews
Both /v1/count and /v1/search (root requests) take a query object:
{
"query": {
"domain": "example.org",
"sources_yes": ["a", "b"],
"sources_no": ["c"]
}
}
| Field | Type | Rules |
|---|---|---|
query.domain |
string, required | Exactly one domain, with at most one prefix: none, ^, or *. |
query.sources_yes |
array of strings, optional | Absent or empty = all sources. Non-empty = whitelist. |
query.sources_no |
array of strings, optional | Absent or empty = exclude nothing. |
Unknown fields anywhere in a request body are rejected with 422 unknown_field — a typo can't silently change your query's meaning.
Domain match modes
| Pattern | Meaning | Matches foo.example.org? |
Matches evilexample.org? |
|---|---|---|---|
example.org |
the domain itself, or any subdomain (label-aligned) | yes | no |
^example.org |
the exact domain only | no | no |
*example.org |
raw string suffix | yes | yes |
Warning — the
*prefix is a raw suffix match.*example.orgalso matches unrelated domains that merely end in those characters, such asevilexample.org. This is intentional. Use the no-prefix form for subdomain matching; use^when you want exactly one domain.
Source filters
- A source name present in both
sources_yesandsources_no→422 source_in_both_lists. - An unknown source name in either list →
422 unknown_source. sources_noexcludes a unit entirely, even when a whitelisted source also holds it. There is no "deliver from the allowed source instead" fallback: exclusion wins.
POST /v1/count — free preview
POST /v1/count
{"query": {"domain": "example.org"}, "max_rows": 1000}
{
"total_count": 2234,
"delivered_count": 1000,
"by_source": {"a": 1000, "b": 100, "c": 1134},
"est_total_cost_cents": 33971,
"est_cost_cents": 15206
}
total_count,delivered_count, andby_sourceare post-dedup unit counts;by_sourcecovers the full match (cheapest-source attribution) and sums tototal_count.est_cost_centsprices the delivered subset in expectation — withmax_rowsabsent it equalsest_total_cost_cents./v1/countis free and never returns402; it does validate query shape (422on malformed queries).- Counts and cost figures are estimates against live data, not quotes. Run the search to lock in a snapshot.