U.S. flag

An official website of the United States government

API Guide

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:

  • find and incorporate DSID data on dietary supplement ingredients into their analyses,
  • use statistical software such as R and SAS to retrieve DSID data on dietary supplement ingredients, and/or
  • create data visualizations or web applications that incorporate DSID data on dietary supplement ingredients

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.

Are you new to APIs?

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/External link icon

What’s available in this 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.

API Endpoints

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.

Input Fields
FieldDefinitionExample Value
study_codeTwo-digit codes from “01” to “05”01
ingredientDSID ingredient namecalcium
label_amountNumeric value for the label amount per serving of an ingredient200
unitScientific units for DSID ingredient labelmg, mcg
Output Fields
FieldDefinitionExample Value
pct_diff_from_labelMean percent difference from label amount8.11
pred_mean_valuePredicted mean ingredient value per serving216
se_pred_meanStandard error for the predicted mean3.92
se_pred_obsStandard error for a predicted observation37.3
ci95_pred_mean_lowLower 95% confidence limits for the predicted mean208
ci95_pred_mean_highUpper 95% confidence limits for the predicted mean244
ci95_pred_obs_lowLower 95% confidence limits for a predicted observation143
ci95_pred_obs_highUpper 95% confidence limits for a predicted observation289

How can I access the API?

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.

Sample calls

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.

API version history

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.

VersionDateType of UpdateChanges(s)Affected Endpoints
V1.1.012/1/24Endpoint, DataDSID-5 statistical coefficients incorporated. Calculator endpoint added with 4 required fields.Calculators