Welcome to the DSID API. This API provides access to data on the amounts of select ingredients in commonly consumed categories of dietary supplements that are based on analytical measurements and statistical modeling. It is intended for users who want to:
The use of this API can help increase efficiency and productivity by allowing users to analyze large volumes of dietary supplement data in a streamlined way. It is also intended to facilitate research and understanding, such as helping researchers build datasets for national, regional, or local intake studies and improve population-level estimates of nutrient intakes.
An API , or Application Programming Interface, is a tool to help users interact with complex data or servers through the help of software. Typically, this means connecting a user’s computer to a database or server that has information they are interested in working with, requesting information, and getting a response back. By providing inputs in a common format, users can make customized requests to the API without needing to understand the full dataset, processing, or statistics needed behind the scenes.
Image Source:https://www.geeksforgeeks.org/what-is-an-api/
This API provides direct access to the same data that powers the interactive, online DSID calculators. By using the API, users can input a large volume of ingredient amounts from supplement labels and retrieve the predicted amounts in a more efficient, streamlined way than using the online calculators.
Whether you are working with 5 rows of data or 5,000, you can use the API to get statistical output for a range of ingredients, studies, and label amounts. The advantage is that you won’t have to input each of your values to the online calculator one at a time.
The API also lets you more seamlessly integrate the results into your spreadsheets, programs, or software tools by providing the data input and output in a common format. No need to copy-paste your calculator results into a spreadsheet one at a time; you can directly query the API from Excel!
The API is currently focused on the DSID calculators, but later versions may include additional functionality.
The DSID API has one API endpoint (v1/calculators) for calculating predicted ingredient amounts of commonly consumed categories of dietary supplements.
There are four required input fields. For the full list of study codes, ingredients and units, refer to the Data Files Page. The output will display the four required input fields along with additional calculated fields.
Field | Definition | Example Value |
---|---|---|
study_code | Two-digit codes from “01” to “05” | 01 |
ingredient | DSID ingredient name | calcium |
label_amount | Numeric value for the label amount per serving of an ingredient | 200 |
unit | Scientific units for DSID ingredient label | mg, mcg |
Field | Definition | Example Value |
---|---|---|
pct_diff_from_label | Mean percent difference from label amount | 8.11 |
pred_mean_value | Predicted mean ingredient value per serving | 216 |
se_pred_mean | Standard error for the predicted mean | 3.92 |
se_pred_obs | Standard error for a predicted observation | 37.3 |
ci95_pred_mean_low | Lower 95% confidence limits for the predicted mean | 208 |
ci95_pred_mean_high | Upper 95% confidence limits for the predicted mean | 244 |
ci95_pred_obs_low | Lower 95% confidence limits for a predicted observation | 143 |
ci95_pred_obs_high | Upper 95% confidence limits for a predicted observation | 289 |
There are a number of accessible ways to query or reach the DSID API. New users may choose to start by accessing the DSID API through familiar tools like a web URL or Excel Power query. More comfortable programmers may choose to send requests via their command line or through software tools such as R or SAS. The API returns data in JSON format and the “Converting JSON Data into Excel” page explains how this can be read directly into Excel.
For smaller requests, you can make an API call using a using your web browser. For larger amounts of data, it is recommended to use a This can be done using Excel, your computer’s command line, or many software options such as R and SAS.
This section demonstrates how to arrange your input data to make a variety of requests to the API. All calculator requests need to provide four fields: study_code, ingredient, label_amount, and unit. The label_amount field should be a number while the others should be text surrounded by quotes. Be sure to spell the field names exactly as shown.
This table provides a history of the DSID API over time. As endpoints, datasets, and other functionality are updated, this record will indicate the changes so users can track how and what has been modified.
Version | Date | Type of Update | Changes(s) | Affected Endpoints |
---|---|---|---|---|
V1.1.0 | 12/1/24 | Endpoint, Data | DSID-5 statistical coefficients incorporated. Calculator endpoint added with 4 required fields. | Calculators |