Bilirubin API for EHR access

Endpoint: https://peditools.org/bilirubin/

Send the patient's values in the query string (GET) and the tool opens with the results, or returns them as JSON. It picks the guideline automatically from gestational age at birth and age:

  • Born at 35 weeks or more: AAP 2022.
  • Born before 35 weeks: Stanford Premie BiliRecs (PBR), from 27 0/7 to 35 0/7 weeks postmenstrual age (PMA).
  • Born before 35 weeks and now past 35 0/7 weeks PMA: outside both guidelines' intended populations. By default the tool shows gap analysis (see below); gap=0 turns it off.

Parameters

ParameterValueNotes
gawhole weeks, e.g. 38Gestational age at birth. Required
gadayswhole days, 0–6Days beyond ga. Below 35 weeks a missing value is assumed to be 0, with a warning; send it whenever you have it
agehours, e.g. 20,30Ages at the TSB measurements; can be comma-separated list
bilie.g. 8,13.5TSB values; can be comma-separated list in the same order as age
tcbagehoursAges at the TcB measurements (optional); can be comma-separated list
tcbe.g. 12TcB values; can be comma-separated list in the same order as tcbage
risknone, any or bothNeurotoxicity risk factors (AAP only): no risk factors, any risk factors, or both (show results with and without risk factors, the default)
notimetrueTime of birth unknown: adds a caution and assumes the most conservative time (23:59)
si1Bilirubin values are mg/dL by default. With si=1, values in the link are µmol/L and results are shown in µmol/L
gap0Turn gap analysis off (see below). Leave it out to allow gap analysis for babies born before 35 weeks and now past 35 0/7 weeks PMA
formatjsonReturn JSON instead of the web page
  • Lists are comma-separated. Use a dot for decimals (13.5).
  • Ages are hours of life and may have decimals (36.5).
  • The latest measurement decides the recommendation. The rate of increase uses TSBs only.

Gap analysis (gap)

Babies born before 35 weeks who are now past 35 0/7 weeks PMA fall between the two guidelines: too old for Stanford PBR, born too early for AAP 2022. No published guideline covers them.

  • Allowed (default, no gap parameter): the tool shows a caution, "OUTSIDE BOTH INTENDED POPULATIONS", and the closest recommendations from both guidelines side by side for comparison: PBR at 35 0/7 weeks PMA, and AAP 2022 as if born at 35 completed weeks.
  • Turned off (gap=0): the tool shows only "OUTSIDE THE RANGE OF BOTH GUIDELINES", with no thresholds, recommendations or graph (JSON: guideline is out_of_range).

gap=0 changes only these babies; every other result is the same. Add it to every link if your users should never see gap analysis. The result depends only on the link: the gap analysis setting on the tool's form doesn't change what a link shows.

Examples

JSON response

FieldContent
guidelineaap2022, pbr2012, gap (both shown), out_of_range, or null (missing or invalid input)
unitsmg/dL or umol/L
inputThe values as read, and invalid: the names of any parameters that couldn't be used
warningsEvery caution shown on the page: code, title, detail
aap2022, pbr2012Thresholds and results for each guideline shown (otherwise null), in the display units
copy_textThe summary text, as on the page's copy button (ready to paste into a note)

Show the warnings wherever the results are shown: some results come with an important caution, such as gap analysis or missing gestational age days.

PediTools
© 2012 – 2026 Joseph Chou