These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
EvE Central API with a Fuzzy Steve modified code to get station infos
/** Loads prices for a given set of typeIDs for a specific station using Eve-Central's data.* @param priceIDs A range where the item typeIDs are found.* @param systemID The system to query.* @param {number} cachebuster Increment this variable to refresh the data.* @return The price data in multiple columns in the following order: TypeID,Buy Volume,Buy average,Buy max,Buy min,Buy Std deviation,Buy median,Buy Percentile,Sell Volume,Sell Average,Sell Max,Sell Min,Sell std Deviation,Sell Median,sell Percentile. This is suitable for use with VLOOKUP.* @customfunction*/function loadStationPrices(priceIDs,stationID,cachebuster){ if (typeof stationID == 'undefined'){ stationID=60003760; /* Amarr : 60008494 ; Jita : 60003760 */ } if (typeof priceIDs == 'undefined'){ throw 'need typeids'; } if (typeof cachebuster == 'undefined'){ cachebuster=1; } var prices = new Array(); var dirtyTypeIds = new Array(); var cleanTypeIds = new Array(); var url="http://api.eve-central.com/api/marketstat?cachebuster="+cachebuster+"&usestation="+stationID+"&typeid="; priceIDs.forEach (function (row) { row.forEach ( function (cell) { if (typeof(cell) === 'number' ) { dirtyTypeIds.push(cell); } }); }); cleanTypeIds = dirtyTypeIds.filter(function(v,i,a) { return a.indexOf(v)===i; }); var parameters = {method : "get", payload : ""}; var o,j,temparray,chunk = 100; for (o=0,j=cleanTypeIds.length; o < j; o+=chunk) { temparray = cleanTypeIds.slice(o,o+chunk); var xmlFeed = UrlFetchApp.fetch(url+temparray.join("&typeid="), parameters).getContentText(); var xml = XmlService.parse(xmlFeed); if(xml) { var rows=xml.getRootElement().getChild("marketstat").getChildren("type"); for(var i = 0; i < rows.length; i++) { var price=[parseInt(rows[i].getAttribute("id").getValue()), parseInt(rows[i].getChild("buy").getChild("volume").getValue()), parseFloat(rows[i].getChild("buy").getChild("avg").getValue()), parseFloat(rows[i].getChild("buy").getChild("max").getValue()), parseFloat(rows[i].getChild("buy").getChild("min").getValue()), parseFloat(rows[i].getChild("buy").getChild("stddev").getValue()), parseFloat(rows[i].getChild("buy").getChild("median").getValue()), parseFloat(rows[i].getChild("buy").getChild("percentile").getValue()), parseInt(rows[i].getChild("sell").getChild("volume").getValue()), parseFloat(rows[i].getChild("sell").getChild("avg").getValue()), parseFloat(rows[i].getChild("sell").getChild("max").getValue()), parseFloat(rows[i].getChild("sell").getChild("min").getValue()), parseFloat(rows[i].getChild("sell").getChild("stddev").getValue()), parseFloat(rows[i].getChild("sell").getChild("median").getValue()), parseFloat(rows[i].getChild("sell").getChild("percentile").getValue())]; prices.push(price); } } } return prices;}