How to import JSON from an API into Google Sheets
Google Sheets has no built-in JSON import. IMPORTDATA reads CSV and TSV only. You have two options: a short Apps Script, or an add-on.
Free way: a short Apps Script
- Open your sheet, then Extensions > Apps Script.
- Paste a function that calls
UrlFetchApp.fetch(url), parses the reply withJSON.parse, and writes rows withsheet.getRange(...).setValues(rows). - Pick the fields you want from each object and turn each one into a row.
- Run it once and allow the permissions Google asks for.
- For a refresh, add a time-driven trigger under Triggers.
This works for one simple, public endpoint. It gets harder with API keys, OAuth, paging, nested objects and errors you have to read in the log.
Or use Sheets API Connector
- Build the request in a sidebar: method, headers, query, JSON body, cell references like {{A1}}.
- API key, Bearer, Basic and OAuth 2.0.
- Pagination in 5 styles, including cursors and Link headers.
- Nested JSON flattened into columns, or one row per item.
- Scheduled refresh, daily or hourly, with an email if it fails twice in a row.
Get it, $39 once More about it
I make this tool and sell it.