(Example: “noInherit,noTruncate,rawHeaders”) “parseOptions” – a comma-separated list of options that alter processing of the data.(Example: “/feed/entry/title,/feed/entry/content”) Any path starting with one of these paths gets imported. “query” – a comma-separated list of paths to import.Your Google Sheet should now populate with your JSON data.Īlongside “url”, there are two additional parameters you can use with =ImportJSON(): Be sure to keep the quotes “” and parentheses (). Close the Script editor and navigate back to your Google Sheet tab.Return to your empty script editor window and paste the script code.Click the Raw button in the top right corner of the script window to select all and copy the entire code.Head over to the Gist containing the ImportJSON script.In the code window, delete the default placeholder function to leave a blank window.This will open a new Google Apps Script tab. Click on the Tools menu and select the option Script editor.For this example we'll use CoinDesk's historical price of Bitcoin: Let’s use ImportJSON to retrieve data from an API endpoint. With ImportJSON the JSON data gets transformed so that it’s correctly formatted in rows and columns in your spreadsheet. While Google Sheets offers a built-in =ImportData() function that can retrieve JSON data, we recommend using a trusted community script that adds an =ImportJSON() function to Google Sheets. Importing JSON is a powerful way to pull data from public data sources to store, enrich or analyse.
0 Comments
Leave a Reply. |