Skip to content

Instantly share code, notes, and snippets.

@pimpelsang
Last active August 24, 2022 08:19
Show Gist options
  • Select an option

  • Save pimpelsang/2d7573424fc3cb97af1a1eb480b1dd38 to your computer and use it in GitHub Desktop.

Select an option

Save pimpelsang/2d7573424fc3cb97af1a1eb480b1dd38 to your computer and use it in GitHub Desktop.
Funderbeam to google sheets
/*
Load funderbeam instruments latest price info into google sheets
1. Open google sheets
2. Open scripts editor from "extensions" menu -> Apps Script
3. in code editor replace the example function by with the function below
4. in code editor click save button and close the window
5. in google sheets write this formula into cell: =FUNDERBEAM("ampler")
after some loading you should see the latest ampler price value.
Where to get the instrument ID?
In funderbeam to it's detail page and you can see ID from the browser URL
Example: Bikeep - Loan notes, page url is https://www.funderbeam.com/market/bikeepl1/trades
And use the ID "bikeepl1"
You can turn on hourly auto refresh from menu File->Settings,
under "Calculation" tab change Recalculation to "On change and every hour"
*/
function FUNDERBEAM(id) {
var url = 'https://www.funderbeam.com/api/market'
var list = JSON.parse(UrlFetchApp.fetch(url).getContentText())
for(var entry of list) {
if (entry.slug == id) {
return entry.lastTradePrice;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment