SDKs & Examples
Minimal examples to get you live fast. See API Reference for full schemas and error handling.
Environment variables
MATCHAUDIT_API_KEY— public API key for client/server calls (keep secret in browsers via proxy if possible).API_AUTH_SECRET— server-only secret for usage endpoints.
cURL
curl -X POST https://your-domain.com/api/v1/screen \
-H "Authorization: Bearer $MATCHAUDIT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "names": ["Vladimir Putin"], "entityTypes": ["individual"] }'Node / TypeScript (fetch)
export async function screen(names: string[]) {
const res = await fetch("https://your-domain.com/api/v1/screen", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.MATCHAUDIT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ names, entityTypes: ["individual"] }),
});
if (!res.ok) throw new Error(`Screen failed: ${res.status}`);
return res.json();
}Python (requests)
import os, requests, uuid
def screen(names):
resp = requests.post(
"https://your-domain.com/api/v1/screen",
headers={
"Authorization": f"Bearer {os.getenv('MATCHAUDIT_API_KEY')}",
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"names": names, "entityTypes": ["individual"]},
timeout=30,
)
resp.raise_for_status()
return resp.json()