MEI LME Average Calculator
Fetch LME Cu
Fetch not working? Tap to paste data manually

1. Open westmetall.com Copper Datatable in a new tab.
2. Select & copy the whole price table (the rows with dates and prices).
3. Paste it below, then tap Parse & Fill. Only rows matching the selected month/year above will be used.

📉 Today's Market Rates shreemetalprices.com
Armature (Bhatti)
—
₹ / kg
Hindustan Zinc Ingot
—
₹ / kg
(fetched − ₹18)

Green = auto-fetched  |  Leave blank for holidays

⚡ Set up Google Apps Script Relay for live LME data (optional, one-time)

The GAS relay fetches westmetall.com server-side (no CORS issues). Without it, the calculator uses embedded 2026 data. This is optional — the calculator works fully without it.

  1. Open script.google.com → New Project
  2. Paste this code:
function doGet(e){
  var mon=parseInt(e.parameter.mon||"1");
  var yr=parseInt(e.parameter.yr||new Date().getFullYear());
  var url="https://www.westmetall.com/en/markdaten.php?action=table&field=LME_Cu_cash";
  if(yr!==new Date().getFullYear()) url+="&year="+yr;
  try{
    var resp=UrlFetchApp.fetch(url,{muteHttpExceptions:true,followRedirects:true});
    var html=resp.getContentText("UTF-8");
    var rows=[];
    var re=/(\d{2})\.(\d{2})\.(\d{4})\s*<\/td>\s*]*>\s*([\d,\.]+)/g;
    var m;
    while((m=re.exec(html))!==null){
      var d=parseInt(m[1]),mm=parseInt(m[2]),yy=parseInt(m[3]);
      var p=parseFloat(m[4].replace(/,/g,""));
      if(mm===mon&&yy===yr) rows.push({day:d,price:p});
    }
    return ContentService.createTextOutput(JSON.stringify({rows:rows,source:"westmetall"}))
      .setMimeType(ContentService.MimeType.JSON);
  }catch(err){
    return ContentService.createTextOutput(JSON.stringify({rows:[],error:err.toString()}))
      .setMimeType(ContentService.MimeType.JSON);
  }
}
  1. Click Deploy → New deployment
  2. Type: Web app → Execute as: Me → Access: Anyone
  3. Click Deploy → copy the URL
  4. Click ⚡ button above → paste URL → Save
⌂