Last Updated: January 28, 2021
·
57
· apipheny

How to connect a JSON API to Google Sheets

2 different ways of importing JSON into Google Sheets

  1. Use a Github script and Google Apps Script

Here's the steps:

A. Open your Google Sheet
B. In the menu click "Tools" > "Script Editor"
C. Delete what's already in the editor
D. Copy and paste a script from Github like this one: https://gist.github.com/paulgambill/cacd19da95a1421d3164
E. Click "File" > "Save"
F. Title the code something like "Import JSON"
G. Close the Script Editor
H. In your Google Sheet, in cell A, start typing "ImportJSON("https://example.com/api")" but replace the URL with your real API URL and endpoint
I. Press enter and the JSON API data will import directly in to your Google Sheet

  1. Use a Google Sheets App

If you want to try a different method, there's a Google Sheets add-on called Apipheny that you can also try using.

Here's the steps:

A. Install Apipheny: https://apipheny.io
B. Open your Google Sheet
C. In the menu click "Add-ons" > Apipheny > Import API
D. The Apipheny app will open up as a sidebar. In Apipheny, enter your API URL and headers/key if you need to
E. Click "Run" and your data will import

Enjoy!