Skip to main content

ALETHEIA Examples

Live playground — five evidence lenses, three supply-chain stages, synthesised on every /api/compound/{id} request.

Install the SDK

Free tier: 500 requests/day, no API key required for read endpoints. Drop the SDK into your project to skip the JSON parsing.

# Python
pip install aletheia-safety

# Node.js
npm install aletheia-safety

Both SDKs ship typed responses + a webhook-signature verifier. Same risk-synthesis payload as the curl examples below.

Playground

Pick a compound and context, then run. The URL preview updates live.

GET /api/compound/hq-c-org-000074?context=human_adult

How disagreement renders

When sources don't converge, the synthesis preserves the shape of the disagreement instead of manufacturing a midpoint. Glyphosate × human_adult is the canonical example — the three agencies span the magnitude scale almost end-to-end:

IARC
0.750
EPA
0.150
EFSA
0.180

Consensus: false (disagreement_magnitude: 0.422)
Mean: 0.360, Std Dev: 0.284
95% CI: [0.082, 0.638]

Run the Disagreement tab above to see this in the live response.

Understanding the Output

consensus.exists: Boolean. True when std_dev < 0.15 AND max_distance < 0.25

consensus.strength: 0-1 scale. Higher = tighter agreement

disagreement_magnitude: Normalized max distance between any two sources

source_positions: Each source's position with its calculated weight

Using your API key

Read endpoints (compound lookup, cas lookup, contexts) are free with no key. Paid-tier endpoints (compounds list, batch, compare, webhooks) require an X-API-Key header.

curl

curl -H "X-API-Key: $ALETHEIA_API_KEY" \
     https://api.aletheia.holisticquality.io/api/compounds?limit=50

Python

from aletheia_safety import Aletheia

client = Aletheia(api_key=os.environ["ALETHEIA_API_KEY"])
compounds = client.compounds(limit=50)

Node

import { Aletheia } from "aletheia-safety";

const client = new Aletheia({ apiKey: process.env.ALETHEIA_API_KEY });
const compounds = await client.compounds({ limit: 50 });

Get a key on the dashboard or via the pricing page. The free tier issues a key on request — useful for higher quotas on the read endpoints, too.

Error responses

Every error response carries a JSON body with an error code and a message string. HTTP status code matches the error class. No special parsing required.

401 UNAUTHORIZED

Missing or invalid API key

{
  "error": "Unauthorized",
  "message": "API key required for /api/compounds",
  "hint": "Pass via X-API-Key header"
}
404 NOT FOUND

Unknown compound ID or endpoint

{
  "error": "Not found",
  "message": "No compound with ID hq-c-org-999999",
  "hint": "Try CAS lookup: /api/compound/cas/{cas}"
}
429 TOO MANY REQUESTS

Rate limit exceeded

{
  "error": "Rate limit exceeded",
  "message": "Free tier: 500 requests/day per IP",
  "retry_after_seconds": 3600
}
400 BAD REQUEST

Malformed input

{
  "error": "Invalid compound ID",
  "message": "ID must match: hq-[c|m|p](-tier)-NNNN(NN)",
  "hint": "e.g. hq-c-org-000001"
}

All error responses include a request_id (UUIDv7) that lets you reference the specific call when contacting support — included in the body and in the X-Request-ID response header.

See it visualized

The same JSON you just queried, rendered as a concentric pentagon — magnitude, confidence, recency, methodology, and specificity for three compounds across compound / material / product stages. The Looking Glass is the methodology made visible.

Open the Looking Glass → theobromine · glyphosate · lead

Next steps

For free use: the read endpoints above are free forever — no key, no account, 500 requests/day per IP. Plug them straight into your app.

For higher volume or write access: Developer or Pro tiers unlock 10k/day or 100k/day, plus batch endpoints, the compounds list, comparisons, and webhooks.

For methodology: the synthesis explained, sources catalogued, and the team behind it.

For comparison: how ALETHEIA differs from PubChem and EPA CompTox for marketplace and consumer-product safety work.