Created
June 23, 2019 14:54
-
-
Save a-klimashevsky/0b506efe6e6922177f26b14f22c09388 to your computer and use it in GitHub Desktop.
Albion Price google sheets script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function albionPrice(itemId, location, type) { | |
var url = "https://www.albion-online-data.com/api/v2/stats/prices/"+itemId+"?locations="+location | |
var response = UrlFetchApp.fetch(url); | |
var json = JSON.parse(response.getContentText()); | |
if(type === 'sell'){ | |
return json[0].sell_price_min; | |
} else { | |
return json[0].buy_price_max; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment