FoodData Central is an integrated data system that provides expanded nutrient profile data and links to related agricultural and experimental research. We can use the FoodData Central API to import data from FoodData Central into Google Sheets. In this tutorial, I’ll show you how to connect the FoodData Central REST API to Google Sheets in 5 steps:
To pull data from the FoodData Central API to Google Sheets, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.
1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.
Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
Go to https://fdc.nal.usda.gov/api-key-signup.html to sign up for an API key. After completing all the required fields, click the Signup button:
After signing up, you will receive the API key:
You will also receive an email containing the API key. You will need the API key in the next steps.
In this section, we’ll show you how to browse the FoodData Central API documentation to find the endpoint that retrieves the information you need from your account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.
First, open the FoodData Central API documentation page: https://fdc.nal.usda.gov/api-spec/fdc_api.html#/
This page contains a list of endpoints, each one with its description:
An example endpoint is Foods, which fetches details for multiple food items using input FDC IDs. The URL for this endpoint is:
If you use this URL, don’t forget to replace FOOD_DATA_ID with a real id and YOUR_API_KEY with your API key.
The endpoint’s documentation contains a short description of the endpoint’s purpose, its HTTP method (GET) and URI, a list of accepted parameters and an example response:
All endpoints can be accessed with the following base domain: https://api.nal.usda.gov/fdc/v1/
All endpoints should be appended to this base domain.
Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import tab open, enter these details into the add-on:
API URL: In Step 3, we explained how you can find the FoodData Central REST API endpoint that you need. Now copy and paste your complete FoodData Central API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
For this example, we are using the List endpoint, which returns a paginated list of foods, in the ‘abridged’ format. This is what the whole URL looks like:
If you use this URL, don’t forget to replace YOUR_API_KEY with the value of the API key you previously obtained in Step 2.
Headers aren’t required. You can leave the Headers section blank in Apipheny.
Here’s what our API request looks like in Apipheny:
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the FoodData Central API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
That’s it! You’ve successfully connected your FoodData Central account to Google Sheets using the FoodData Central API, Google Sheets API, and the Apipheny add-on.
After making a successful request to the FoodData Central API, try querying a different FoodData Central API endpoint, or try using one of the more advanced features in the Apipheny add-on.
Constant Contact API
Facebook Graph API
Facebook Ads API
Google SERP API
Linkedin Ads API
Product Hunt API
Reddit Ads API
Riot Games API