Data and measurement
Use campaign delivery, invoices and outcomes to find which audiences, publishers and Deal IDs earn their fees. A randomized comparison against a BAU Control Line can establish the net gain from a buying change. Download the public Parquet files to check the sample numbers in DuckDB.
On this page
What you can do today
| Capability | Runtime | Status |
|---|---|---|
| Query the synthetic book with read-only SQL | Sandbox | Live |
| Run the 21 exposed Gateway methods and five workflows | Sandbox | Live |
| Size an Audience Holdout and check its integrity | Sandbox | Live |
| Reproduce a public sample figure from its Parquet files in DuckDB | Sandbox | Live |
| Read authorized AWS, Google Cloud, Snowflake or Databricks tables after connection | Tenant Cloud | Preview |
| Estimate distinct counts and quantiles on the tenant Gateway | Tenant Cloud | Preview |
| Match the synthetic partner data with the public-test worker | Sandbox | Preview |
| Run the two-owner worker on approved inputs with tenant credentials | Tenant Cloud | Preview |
The public sandbox uses the Sample Book · Synthetic Data. For a tenant deployment, your data engineer authorizes the named views, columns and export destination.
Run a query now
This query totals media spend and impressions by format across the sample book.
POST /api/sql/runSELECT format,
ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,
SUM(impressions) AS impressions
FROM gold_daily_cube
GROUP BY format
ORDER BY media_spend_usd DESCcurl -sS --fail-with-body https://sandbox.precise.ai/api/sql/run \
-H 'content-type: application/json' \
-d '{
"sql": "SELECT format,\n ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,\n SUM(impressions) AS impressions\nFROM gold_daily_cube\nGROUP BY format\nORDER BY media_spend_usd DESC"
}'import json, sys, urllib.error, urllib.request
SQL = """
SELECT format,
ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,
SUM(impressions) AS impressions
FROM gold_daily_cube
GROUP BY format
ORDER BY media_spend_usd DESC
"""
request = urllib.request.Request(
"https://sandbox.precise.ai/api/sql/run",
data=json.dumps({"sql": SQL}).encode(),
headers={"content-type": "application/json"},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(answer["run_id"], answer["result_digest"])
for row in answer["rows"]:
print(row)const sql = `
SELECT format,
ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,
SUM(impressions) AS impressions
FROM gold_daily_cube
GROUP BY format
ORDER BY media_spend_usd DESC
`;
const response = await fetch("https://sandbox.precise.ai/api/sql/run", {
method: "POST",
headers: {"content-type":"application/json"},
body: JSON.stringify({ sql }),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const answer = JSON.parse(text);
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer.run_id, answer.result_digest);
console.table(answer.rows);{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "query",
"arguments": {
"sql": "SELECT format,\n ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,\n SUM(impressions) AS impressions\nFROM gold_daily_cube\nGROUP BY format\nORDER BY media_spend_usd DESC"
}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "query",
"arguments": {
"sql": "SELECT format,\n ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,\n SUM(impressions) AS impressions\nFROM gold_daily_cube\nGROUP BY format\nORDER BY media_spend_usd DESC"
}
}
}'-- Paste into the duckdb shell. It reads the same public Parquet files the sandbox reads.
CREATE OR REPLACE VIEW gold_daily_cube AS SELECT * FROM read_parquet('https://sandbox.precise.ai/data/parquet/gold_daily_cube.parquet');
SELECT format,
ROUND(SUM(media_spend_usd), 2) AS media_spend_usd,
SUM(impressions) AS impressions
FROM gold_daily_cube
GROUP BY format
ORDER BY media_spend_usd DESC;Observed · Log-only · no holdout. The sample query returns online_video $9,262,672.56 on 947,760,000 impressions, ctv $6,045,887.44 on 335,736,000, and audio $4,543,211.68 on 716,504,000. These are media costs. Supply, DSP and data fees require their own source rows before calculating post-fee return.
| Field | What it is |
|---|---|
run_id | The Gateway run that computed the rows. GET /api/runs/<run_id> returns the stored record |
result_digest | SHA-256 of the result record. For this deterministic query, identical pinned inputs and settings reproduce the rows. Preserve its digest and run ID; the sandbox lookup is process-local |
catalog_digest | The digest of the pinned catalog the query read |
engine, method | precise-gateway/datafusion-56 and dataset/columnar-query@1.0.0 |
The DuckDB tab on the panel gives a script that reads the same public Parquet files. Cloud connections shows the comparison.
The sample book
The sandbox models a quarter of programmatic buying from 2026-07-01 to 2026-09-30, Eastern time. It holds 84 orders for 18 advertisers across 48 campaigns, $19,851,771.68 of media spend, and 13 Audience Holdouts.
| Table | Rows | What it holds |
|---|---|---|
orders | 84 | One row per order line, with its booked rate, flight and budget |
line_items | 168 | DSP line items under an order line, each with its segment, fee and deal |
deals | 10 | Supply agreements with their contracted floor and any shared cap |
segments | 18 | Audience segments with their fee and fee structure |
tests | 13 | One row per Audience Holdout, with its planned split and planned lift |
gold_daily_cube | 32,979 | The whole book by day: delivery, spend, booked revenue and segment fees |
outcomes | 25,963 | Retail results by exposure date, line item, seller and holdout arm |
invoices | 251 | What was billed per order and month, beside what the DSP delivered |
wins | 250,000 | A systematic sample of won auctions. Multiply by sample_weight to estimate totals across 2,000,000,000 impressions |
bid_sample | 173,181 | A sample of submitted bids. Weight each row by 1 / sample_rate |
The guide lists the type and grain of every column. Invoke the MCP tool get_guide with {"section": "catalog"}, or read the resource precise://catalog.
Query rules on the sandbox
- One read-only
SELECTover the pinned catalog. A standaloneVALUESstatement is refused. max_rowsaccepts 1 to 200. SQL text is limited to 20,000 characters.timeout_msruns from 100 to 120,000.- A field name that carries personal data, such as
email,ip_addressoruser_id, returns HTTP 400 withpii_not_accepted.
Limits and errors has the limits and the error codes.
Decide what the evidence supports
| Evidence | How to use it |
|---|---|
| Forecast | Compare the expected net lift and its prediction interval with the fees and opportunity cost of testing. |
| Observed · Log-only · no holdout | Compare spend, delivery or cost per outcome in the logs. A difference between two sellers can reflect inventory mix. |
| Holdout-Proven | Check randomized assignment, BAU delivery, exposure leakage, maturity of outcomes and independent readback of the change. Count the net difference once per eligible measurement window. |
A sample holdout assigned 4,516,160 units to treatment and 4,523,200 to control with zero control exposure. That checks assignment integrity. Estimating lift still requires outcomes on both arms. Keep source and evidence separate: a Recorded Replay can reproduce an experiment on synthetic data.
Check the inputs, method and result
- Cloud connections lists provider grants, export SQL and dataset snapshot checks.
- Methodology and holdouts shows how to reproduce attribution scores, size a BAU Control Line or Audience Holdout, check forecast calibration, and rank launch audiences from priors.
- Partner Clean Room shows how to match campaign exposures with partner outcomes under both owners' approvals, and how to build a launch audience with a data partner.
- API and MCP playground, Data boundaries, Offline verification and the Glossary.