api reference · v1
Unfair Library API. Ship this week.
Structured supplement and intervention data backed by graded evidence. Stable filters, consistent pagination, clear quota headers — so you can move from discovery to ranked evidence without stitching logic.
- x-library-version
- x-contract-version
- x-snapshot-id
- x-rate-limit-remaining
- x-rate-limit-reset
Quickstart
#Start here to confirm auth, hit one endpoint, and build a real workflow.
- Create or obtain an API token from your admin panel.
- Send it as a bearer token in the
Authorizationheader. - Use
limitandoffsetfor stable pagination.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/meta"curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes?category=disease&limit=3"Core concepts
#Four concepts drive every endpoint in the API.
An ingredient with dosing ranges, safety flags, and an evidence tier summary.
A treatment approach with linked health outcomes and an aggregate evidence score.
The specific measured result — a disease, biomarker, or behavior — you're trying to improve or track.
The raw edge between one intervention and one outcome, carrying grade, effect direction, and source metadata.
Explore the typed graph in the Schema Explorer — clickable types, field lists, and the endpoints that return each one.
Most integrations follow the same path: browse or search supplements to target a health outcome, rank linked interventions by evidence quality, then drop to individual evidence links only when you need custom scoring logic or research tooling. When you already know the entities you want, use the bulk endpoints and include expansions to avoid N+1 fetches.
Versioning & freshness
#Every response includes x-library-version, x-contract-version, and x-snapshot-id. Treat them as separate signals — freshness, schema contract, and immutable snapshot identity.
- Docs snapshot version:
2026-05-17T12:07:51.000Z - Contract version:
1.0.0 - Snapshot id:
snapshot.e513f499c72cb903305a - Last supplement dataset update:
2026-05-17T12:06:39Z - Last research dataset update:
2026-05-17T12:08:43.795Z - If the version changes, invalidate cached lists and refetch.
Use /snapshots and /diffs when you need auditable changes between snapshots. Use /releases plus /changelog when you want a decision-ready change feed.
Errors
#Use the table below when integrations fail. Every error includes a cause, a fix, and whether automatic retry makes sense.
{
"ok": false,
"code": "capability_missing",
"message": "API token is missing required capabilities",
"details": {
"requiredCapabilities": ["diffs.read"],
"tokenCapabilities": ["library.read"]
}
}Structured failures include optional details. For capability_missing, the payload includes details.requiredCapabilities and details.tokenCapabilities. Query validation failures in strict mode return 400 invalid_query_param with details.fields describing each invalid parameter.
| Status | Code | Meaning | What to do | Recoverability |
|---|---|---|---|---|
| 401 | missing_token | No bearer token was provided | Send Authorization with a Bearer token and retry. | Recoverable by client |
| 401 | invalid_token | Token hash does not match any active token | Regenerate the token in admin and update your env. | Recoverable after token update |
| 403 | token_inactive | Token exists but has been revoked | Reach out to support to re-enable access. | Requires human action |
| 403 | capability_missing | Token is valid but missing required route capability | Update token capabilities in admin for premium contract routes. | Requires token update |
| 404 | not_found | Requested resource id or slug does not exist | Check slug formatting and confirm id from list endpoints. | Recoverable by request correction |
| 429 | monthly_limit_exceeded | Token exhausted its monthly request quota | Pause requests until reset. Honor the Retry-After header. | Time- or support-based recovery |
| 400 | invalid_query_param | Strict mode rejected one or more query parameters | Fix fields listed in details.fields or remove strict=true. | Recoverable by request correction |
Need help with credentials or quota updates? Reach out through our contact page.
Supplements
#Detail pages, search, and bulk hydration.
/supplementsList supplementsPaginated supplement catalog
Returns a list of supplements. Filters apply before sorting, so results are ranked by evidence tier strength and then alphabetically.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/supplements?q=creatine&category=amino-acid"/supplements/{slug}Get supplementOne supplement by slug
Returns one supplement by slug. Unknown slugs return 404. Supplement slugs are lowercase and hyphenated.
- slugstringrequiredSupplement slug (path).e.g.
5-htp - includearrayExpand with article markdown, contract metadata, or linked studies in one call.e.g.
include=content,coverage,identifiers
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/supplements/5-htp?include=content%2Ccoverage%2Cidentifiers"/supplements/{slug}/contentGet supplement articleLong-form markdown article
Returns the full article markdown for a supplement. Use this when you need the content separately from the structured data.
- slugstringrequiredSupplement slug (path).e.g.
creatine
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/supplements/creatine/content"/supplements/{slug}/product-packGet product packOne-call detail page bundle
Product-ready supplement bundle. Returns a curated response for product pages with summary, dose, safety, evidence highlights, supporting traces, and related entities.
- slugstringrequiredSupplement slug (path).e.g.
alpha-gpc - includearrayPull extra content into the pack without separate detail requests.e.g.
include=content,studies
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/supplements/alpha-gpc/product-pack?include=content%2Cstudies"/supplements/bulkBulk hydrate supplementsResolve many slugs in one request
Bulk hydration endpoint family. Send a non-empty ids array plus optional lookupBy and include values to resolve many entities in one request and avoid N+1 fetches. The same request shape is available at /health-outcomes/bulk, /interventions/bulk, and /studies/bulk.
- idsarrayrequiredNon-empty array of IDs or slugs to resolve.
- lookupBystringWhich identifier kind the
idsarray contains.e.g.lookupBy: "slug" - includearrayExpansions: coverage, identifiers, studies, content where supported.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/supplements/bulk" \
-d '{"ids":["creatine","5-htp"],"lookupBy":"slug"}'Library metadata
#Version, categories, tiers, validation contract.
/metaLibrary metadataLibrary + research metadata + facets
Returns library metadata and filter facets (categories and tiers), plus research graph metadata/facets for health outcomes and interventions. Includes contracts.validation so clients can render machine-readable query parameter rules and strict-mode support per route.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/meta"Health outcomes
#Outcome-first discovery, briefs, and ranked interventions.
/health-outcomesList health outcomesPaginated outcome catalog
Returns paginated health outcomes with category/source filters and intervention linkage counts.
sourceType=interventionDerived means the outcome was inferred from intervention mappings; healthOutcomeFile comes from curated outcome records.curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes?q=sleep&category=disease"/health-outcomes/{id}Get health outcomeOne outcome with intervention linkage
Returns one health outcome by id. Missing ids return 404 with code: not_found.
- idstringrequiredHealth outcome id (path).e.g.
sleep-latency
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes/sleep-latency"/health-outcomes/{id}/briefOutcome briefDecision-ready summary for an outcome page
Decision-ready outcome brief. Returns a compact summary, top interventions, and evidence distributions so you can render "what helps this?" without custom aggregation.
- idstringrequiredHealth outcome id (path).e.g.
sleep-latency
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes/sleep-latency/brief"/health-outcomes/{id}/interventionsInterventions for outcomeRaw intervention list ordered by evidence
Returns interventions associated with a health outcome, ordered by combined evidence strength.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes/sleep-latency/interventions?condition=Insomnia&minGrade=B"/health-outcomes/{id}/ranked-interventionsRanked interventions for outcomeGraded shortlist with score breakdowns
Ranked intervention shortlist with transparent score breakdowns, explanations, top evidence, and coverage confidence. Use this when your product needs a shortlist, not raw graph traversal.
- idstringrequiredHealth outcome id (path).e.g.
sleep-latency - minGradestringDrop weaker evidence grades.e.g.
minGrade=B - sortstringReorder the shortlist.e.g.
sort=coverage_first - limitintegerPage size. Max 200.e.g.
limit=10 - offsetintegeroffset parameter
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/health-outcomes/sleep-latency/ranked-interventions?minGrade=B&sort=coverage_first"/health-outcomes/bulkBulk hydrate outcomesResolve many outcomes in one request
Shares the bulk hydration shape with /supplements/bulk. Send a non-empty ids array plus optional include values.
- idsarrayrequiredNon-empty array of outcome IDs.
- lookupBystringOptional, but this route is ID-only. Keep
lookupByasidwhen you send it.e.g.lookupBy: "id" - includearrayExpansions supported per route.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/health-outcomes/bulk" \
-d '{"ids":["sleep-latency","abdominal-pain"],"lookupBy":"id"}'Interventions
#Rank, brief, and compare interventions.
/interventionsList interventionsPaginated intervention catalog
Returns paginated interventions with condition and linked-outcome category filters.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interventions?q=theanine&condition=Anxiety"/interventions/{id}Get interventionOne intervention with evidence
Returns one intervention by id. Missing ids return 404 with code: not_found.
- idstringrequiredIntervention id (path).e.g.
acupuncture
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interventions/acupuncture"/interventions/{id}/briefIntervention briefWhy-it-works summary
Decision-ready intervention brief. Returns the strongest linked outcomes, related conditions, and evidence distributions for a single intervention.
- idstringrequiredIntervention id (path).e.g.
acupuncture
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interventions/acupuncture/brief"/interventions/{id}/health-outcomesOutcomes for interventionOutcomes ordered by evidence strength
Returns health outcomes associated with an intervention, ordered by combined evidence strength.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interventions/acupuncture/health-outcomes?category=disease&condition=Insomnia"/interventions/bulkBulk hydrate interventionsResolve many in one request
Shares the bulk hydration shape with /supplements/bulk.
- idsarrayrequiredNon-empty array of intervention IDs.
- lookupBystringOptional, but this route is ID-only. Keep
lookupByasidwhen you send it.e.g.lookupBy: "id" - includearrayExpansions supported per route.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/interventions/bulk" \
-d '{"ids":["acupuncture","aerobic-exercise"],"lookupBy":"id"}'/interventions/rankedRanked interventionsGlobal ranked shortlist
Global ranked intervention listing with filterable condition, outcome category, and minimum grade. Use this when you want a shortlist before choosing exact outcomes to compare.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interventions/ranked?condition=Insomnia&outcomeCategory=Feel"Compare
#Pairwise decision endpoints.
/compare/interventionsCompare interventionsHead-to-head with shared outcomes + winner
Pairwise comparison endpoint. Send left, right, and optional compareOn values to get shared outcomes, advantages, safety deltas, and a winner summary without writing your own comparison logic. The same shape is available at /compare/supplements.
- leftstringrequiredLeft candidate id or slug.
- rightstringrequiredRight candidate id or slug.
- compareOnarrayOptional outcome IDs to focus the comparison.e.g.
compareOn: ["sleep-latency"] - includearrayOptional comparison expansions.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/compare/interventions" \
-d '{"left":"acupuncture","right":"aerobic-exercise","compareOn":["sleep-latency"]}'/compare/supplementsCompare supplementsHead-to-head supplement comparison
Pairwise supplement comparison. Same shape as /compare/interventions.
- leftstringrequiredLeft supplement slug.
- rightstringrequiredRight supplement slug.
- compareOnarrayOptional outcome IDs to focus on.
- includearrayOptional comparison expansions.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/compare/supplements" \
-d '{"left":"magnesium","right":"l-theanine","compareOn":["sleep-latency"]}'Evidence
#Traverse the supplement-outcome graph.
/evidenceEvidence statementsStructured statements with provenance
Returns structured evidence statements linking supplements to outcomes with predicate, population, and source metadata.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/evidence?supplementID=creatine&predicateID=improves"/evidence-linksEvidence linksRaw edges with grade and effect
Returns individual evidence links between interventions and outcomes. Most integrations don't need this unless you are building custom ranking or graph logic.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/evidence-links?q=magnesium&interventionID=l-theanine"/evidence/reverseReverse evidence lookupWhich supplements target this outcome?
Reverse evidence query: given an outcome, find which supplements have evidence for it. Returns grouped statements with supplement IDs.
- objectIDstringThe outcome to reverse-lookup.e.g.
objectID=cognitive-performance - predicateIDstringFilter by relationship direction.e.g.
predicateID=improves - populationstringNarrow to a population group.e.g.
population=athletes
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/evidence/reverse?objectID=cognitive-performance&predicateID=improves"Studies
#Citations with effect estimates and structured metadata.
/studiesList studiesSearch studies, filter by effect data
Returns paginated studies with search, PubMed ID lookup, and effect estimate filtering. Each study includes structured metadata: design details (blinding, randomization, duration), population (sample size, age range, sex), publication info (journal, year, authors), conclusions, adverse events, and funding sources.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/studies?q=creatine+cognition&pmid=12345678"/studies/{studyID}Get studyFull structured record
Returns one study by id with full metadata and linked supplement associations. Includes structured design, population, intervention, and publication objects along with author details, conclusions, adverse events, and funding.
- studyIDstringrequiredStudy id (path).e.g.
pmid-29257353
design (type, blinding, control, durationDays, randomized), population (description, sampleSize, ageRange, sex), interventions (description, dose), publication (journal, year), authors (name, affiliation, email), plus conclusions, adverseEvents, funding.curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/studies/pmid-29257353"/studies/{studyID}/contentGet study contentFull paper markdown and summary metadata
Returns the full paper content markdown for a study when available, plus summary markdown and extraction metadata. Use contentStatus and contentSource to distinguish extracted full text from compatibility fallbacks.
- studyIDstringrequiredStudy id (path).e.g.
pmid-29257353
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/studies/pmid-29257353/content"/studies/bulkBulk hydrate studiesResolve many studies in one request
Shares the bulk hydration shape with /supplements/bulk.
- idsarrayrequiredNon-empty array of study IDs.
- lookupBystringOptional, but this route is ID-only. Keep
lookupByasidwhen you send it.e.g.lookupBy: "id" - includearrayExpansions supported per route.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/studies/bulk" \
-d '{"ids":["pmid-29257353","pmid-15986863"],"lookupBy":"id"}'Safety & interactions
#Drug-supplement screening and interaction data.
/interaction-factsInteraction factsStructured interaction assertions with severity
Structured interaction facts view over the assertion ledger with supplement, target typing, severity, and coverage fields.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interaction-facts?supplementID=st-johns-wort&targetType=drug"/interactionsList interactionsSupplement-drug and supplement-supplement interactions
Returns supplement-drug and supplement-supplement interactions with target typing and external code references.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/interactions?targetType=drug&system=rxnorm"/safety/screenSafety screenClear · warn · block decision
Productized safety screen. Submit candidate supplements plus medication, condition, stack, and profile context to receive a machine-readable clear, warn, block, or insufficient_coverage decision with blockers, warnings, and trace IDs.
- candidatesarrayrequiredCandidate supplements to screen.
- medicationsarrayPatient medication list.
- conditionsarrayConditions or states to consider.
- profile.strictnessstringUse
high_safetyto surface coverage gaps asinsufficient_coverage.
curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \
-H "Content-Type: application/json" \
"https://unfairapp.com/api/library/v1/safety/screen" \
-d '{"candidates":[{"supplementID":"st-johns-wort"}],"medications":[{"label":"sertraline"}],"profile":{"strictness":"high_safety"}}'Lookup & identifiers
#Cross-system ID resolution.
/identifiersIdentifier graphCrosswalk across all entity types
Identifier graph and crosswalk lookup across supplements, studies, outcomes, and interventions.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/identifiers?entityType=supplement&entityID=creatine"/lookupLookupForward or reverse ID resolution
Cross-reference lookup. Maps external identifiers (PubChem, UNII, RxNorm) to Unfair entity IDs and back. Use this to bridge your existing data with the Unfair graph.
- systemstringThe external identifier system.e.g.
system=pubchem - codestringThe external code to resolve.e.g.
code=586 - sourcestringAlternative crosswalk system.e.g.
source=unii - externalIDstringAlternative crosswalk code.e.g.
externalID=MU72812GK0
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/lookup?system=pubchem&code=586"Assertions & coverage
#Contract-grade facts you can cite.
/assertionsList assertionsClaims, interactions, contraindications, regulatory
Canonical assertion ledger endpoint. Query claims, interactions, contraindications, regulatory facts, and intervention-outcome edges from one schema.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/assertions?kind=claim&subjectType=supplement&subjectID=creatine"/assertions/{id}Get assertionOne assertion with provenance
Returns one assertion by deterministic id for audit trails and deep links.
- idstringrequiredAssertion id (path).e.g.
assertion.avoid_if.5-htp.44b8953e5ddc78ca
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/assertions/assertion.avoid_if.5-htp.44b8953e5ddc78ca"/coverageCoverage reportsPer-entity coverage transparency
Per-entity coverage transparency for evidence linkage, coding completeness, and unresolved gaps.
- entityTypestringScope coverage to one entity kind.e.g.
entityType=supplement - entityIDstringCheck coverage for one entity.e.g.
entityID=ashwagandha - gapstringFilter to entities with a specific gap type.e.g.
gap=missing_evidence - limitintegerPage size.e.g.
limit=100 - offsetintegerPagination offset.e.g.
offset=0
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/coverage?entityType=supplement&entityID=ashwagandha"Snapshots & change intel
#Audit trail for every change.
/changelogChangelog feedHuman-readable change stream
Human-readable companion feed to /releases. Stream the latest impactful changes classified by kind (safety, evidence, content, coverage).
- limitintegerPage size.e.g.
limit=10 - offsetintegerPagination offset.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/changelog?limit=10"/diffsDiffsClassified diffs between snapshots
Classified diff feed. Compare two snapshots to see added, modified, and removed entities plus impact type, severity, and recommended downstream action.
- fromSnapshotIDstringrequiredPreferred baseline snapshot to diff from.e.g.
fromSnapshotID=snap-2026-02 - toSnapshotIDstringOptional, defaults to current snapshot.e.g.
toSnapshotID=snap-2026-03 - entityTypestringScope the diff to one entity kind.e.g.
entityType=supplement - limitintegerPage size.e.g.
limit=100 - offsetintegerPagination offset.
If-None-Match.fromSnapshotID nor sinceSnapshotID is provided, the API returns 400 missing_from_snapshot.curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/diffs?fromSnapshotID=snap-2026-02&toSnapshotID=snap-2026-03"/releasesReleasesClassified release summaries
Change-intelligence feeds built on top of snapshots and diffs. Use /releases for classified release summaries and /changelog for a more human-readable stream.
- limitintegerPage size.e.g.
limit=5 - offsetintegerPagination offset.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/releases?limit=5"/snapshotsList snapshotsPoint-in-time manifests with digests
Snapshot manifests with contract version, artifact digests, and immutable snapshot identifiers.
- limitintegerPage size.e.g.
limit=20 - offsetintegerPagination offset.e.g.
offset=0
If-None-Match. Successful cache validation returns 304 with an ETag header.curl -sS -H "Authorization: Bearer $UAF_TOKEN" \
"https://unfairapp.com/api/library/v1/snapshots?limit=20&offset=0"Workflows · 7
#Job-based examples you can copy and adapt. Each workflow is a numbered sequence of requests — the response from one step feeds the next.
Ranked shortlist for an outcome
Your user asks for sleep. You return the top candidates ranked by evidence grade — no stitching, no custom scoring.
curl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/health-outcomes?q=sleep&limit=1"NextThe first hit's `id` feeds the next step.- Ask for a ranked shortlistSkip raw graph traversal — request the shortlist endpoint with a minimum grade.GET
/health-outcomes/{id}/ranked-interventionscurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/health-outcomes/OUTCOME_ID/ranked-interventions?minGrade=B&limit=10" - Pull a brief to explain the top pickGet a why-it-works summary for the candidate you want to feature.GET
/interventions/{id}/briefcurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/interventions/INTERVENTION_ID/brief?minGrade=B&limit=5"
Build a supplement detail page fast
One call returns dose, safety, evidence highlights, and related entities — then bulk hydrate adjacent cards to avoid N+1.
- Fetch the product packCurated bundle with dose, safety, evidence highlights, and related entities.GET
/supplements/{slug}/product-packcurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/supplements/alpha-gpc/product-pack?include=content,studies" - Bulk hydrate adjacent cardsSend slugs for the related rail in one request — no N+1 fetches.POST
/supplements/bulkcurl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \ -H "Content-Type: application/json" \ "https://unfairapp.com/api/library/v1/supplements/bulk" \ -d '{"ids":["alpha-gpc","citicoline"],"lookupBy":"slug","include":["coverage","identifiers"]}'NextRender dose, safety, evidence highlights, and related entities from one response.
Compare ranked candidates
Narrow to a shortlist, then compare head-to-head with shared outcomes and a winner summary.
- Rank interventions for a conditionGET
/interventions/rankedcurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/interventions/ranked?condition=Insomnia&minGrade=B&limit=5" curl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \ -H "Content-Type: application/json" \ "https://unfairapp.com/api/library/v1/compare/interventions" \ -d '{"left":"magnesium","right":"l-theanine","compareOn":["sleep-latency"]}'NextUse the winner, shared outcomes, and score summary in your chooser UI.
Safety check before recommending
Submit the candidate, the patient's meds, and the profile context. Receive a machine-readable clear / warn / block verdict.
- Run the screenUse `strictness=high_safety` to surface coverage gaps as `insufficient_coverage` instead of silently downgrading.POST
/safety/screencurl -sS -X POST -H "Authorization: Bearer $UAF_TOKEN" \ -H "Content-Type: application/json" \ "https://unfairapp.com/api/library/v1/safety/screen" \ -d '{ "candidates": [{"supplementID": "st-johns-wort"}], "medications": [{"label": "sertraline"}], "conditions": [{"label": "pregnancy"}], "profile": {"strictness": "high_safety"} }'
Audit trail across data updates
Watch classified releases, read the changelog, then fall back to raw diffs when you need entity-level action.
- See the most recent releasesGET
/releasescurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/releases?limit=5" - Pull the changelog feedGET
/changelogcurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/changelog?limit=10" curl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/diffs?fromSnapshotID=snap-2026-02&toSnapshotID=snap-2026-03&entityType=supplement"
Cross-reference external identifiers
Map between Unfair entity IDs and external systems like PubChem, UNII, or RxNorm.
- List external identifiers for a supplementGET
/identifierscurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/identifiers?entityType=supplement&entityID=creatine" - Reverse lookup from an external codeGET
/lookupcurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/lookup?system=pubchem&code=586"
Deep evidence drill-down with studies
Trace claims back to primary sources. Search studies, query evidence statements, then reverse-lookup to find related supplements.
- Search studies with effect estimatesGET
/studiescurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/studies?q=creatine&hasEffectEstimates=true&limit=5" - Get structured evidence statementsGET
/evidencecurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/evidence?supplementID=creatine&limit=10" - Reverse query: which supplements help this outcome?GET
/evidence/reversecurl -sS -H "Authorization: Bearer $UAF_TOKEN" \ "https://unfairapp.com/api/library/v1/evidence/reverse?objectID=cognitive-performance"
Field glossary
#Domain-specific fields you'll meet across responses.
tierThe normalized evidence strength bucket. Higher quality evidence sorts first in ranked responses.endpointRelevanceScores how directly a study endpoint supports the claim. Higher is more aligned.biasRiskEstimates methodological risk of bias for an evidence entry. Lower is better.predicateThe relationship between subject and object in an evidence statement — e.g. `improves`, `worsens`, `no_effect`.coverageMachine-readable completeness status: `full`, `partial`, `text_only`, or `has_gaps`. Use `high_safety` strictness to convert gaps into `insufficient_coverage` decisions.snapshotAn immutable point-in-time manifest with artifact digests. Snapshots are the basis for diffs, releases, and audit trails.contract versionThe response schema contract. Returned on every response as `x-contract-version`. Treat it as separate from freshness.
Evidence definitions
#Evidence tier
Evidence tier is a normalized confidence label used for sorting and filtering. Higher tiers represent stronger supporting evidence and are surfaced first in ranked responses. Use tiers to control strictness in your product — start with `minGrade=B` in decision-focused views, then allow lower tiers in exploration views.
Evidence quality metadata
Quality metadata explains why an item was ranked a certain way. `endpointRelevance` describes how directly a study supports a claim; `biasRisk` estimates the likelihood of bias. Surface both to users when you want transparency — show stronger endpoint alignment and lower bias as higher confidence, and flag weaker entries.
Rate limits
#Build clients that respect quotas by reading response headers on every request.
- Read
x-rate-limit-remainingto decide when to throttle prefetching. - Use
x-rate-limit-resetto schedule retries after quota resets. - Use
x-library-versionas a cache key so clients skip unnecessary refetches. - Monthly quota is per token — limits vary by plan.
- At zero remaining, calls fail with
429 monthly_limit_exceededuntil reset. - For 429s, use
Retry-Afterto pick the next attempt window. - Conditional requests on
/meta,/snapshots,/diffsviaETag+If-None-Match. Quota still applies before a possible 304. - In production, back off early at low remaining values and alert your team before zero.
- If traffic grows, request a higher limit through the contact page before launch windows.
Sample JSON responses
#{
"ok": true,
"total": 386,
"limit": 50,
"offset": 0,
"data": [
{
"slug": "5-htp",
"displayName": "5-HTP",
"scientificName": "5-Hydroxy-L-tryptophan",
"categoryID": "amino-acid",
"summary": "5-HTP is a serotonin precursor...",
"dose": { "typical": "100-300 mg/day" },
"evidence": { "tier": "C", "effectWindow": "2-4 weeks" }
}
]
}