Â
API - Google Spreadsheet
Google Spreadsheet Code Example
Using the awesome ImportJSON tool in combination with this wonderful script, you are able to get the GuruFocus API data into a google spreadsheet in a matter of minutes. Here’s how:
- Create a new Google Spreadsheet.
- Click on Tools -> Script Editor.
- Click Create script for Spreadsheet.
- Delete the placeholder content and paste the code from this script.
- Rename the script to ImportJSON.gs and click the save button.
- Back in the spreadsheet, in a cell, you can type “=ImportJSON()” and begin filling out it’s parameters.
For example, if you want to use GuruFocus API to get valuation ratios in Google Spreadsheet, just try the following function in your spreadsheet
=ImportJSON(("https://api.gurufocus.com/public/user/{api_token}/stock/AAPL/keyratios"), "/Valuation", "")
The output will be: