The biomarker list provided by Ornament is large and updated infrequently - typically once every few months. For this reason, it is not recommended to call the Biomarkers endpoint frequently, as doing so can be inefficient and unnecessary.
To help manage this, the API includes a mechanism to detect whether the biomarker list has changed since your last request. This is done using the digest
parameter.
How it works
When you request the biomarker list from the API (Biomarkers endpoint), the response includes two relevant fields:
{
"needToUpdate": true,
"digest": "6599E679FA1AD8400D94CA669954EEE163684B4F1B1F797984D0C6F875072940"
}
digest
: A hash representing the current version of the biomarker list.
needToUpdate
: A boolean indicating whether the list has changed since the digest value you provided (if any). If true, a new version of the list is available.
Using digest to check for updates
To avoid downloading the full list unnecessarily, you can include the digest value from your last successful request in your next API call.
{
"lang": "EN",
"digest": "6599E679FA1AD8400D94CA669954EEE163684B4F1B1F797984D0C6F875072940"
}
If the data hasn’t changed, the API will return needToUpdate: false
, and you can skip updating your local copy. If it has changed, you'll get the new list and a new digest value to use in future checks.