Messtone LLC Manages(jQuery):Endpoint Real-time Rates

Messtone Devices Enables jQuery.ajax Comditions-API APIs latest endpoint. //set endpoint and Messtone access key endpoint= ‘latest’ access_key= ‘API_KEY’;// get the most recent exchange rates via the ‘latest’ endpoint: $.ajax({url: ‘https://www.comodities-api.com/api/’ + endpoint + ‘?access_key=’ + access_key,dataType: ‘jsonp’ success:function(json)//exchange rata data is stored in json.rates alert(json.rates.GBP);//base currency is stored in json.base alert(json.base);//timestamp can be accessed in json.timestamp alert(json.timestamp);}}); Convert currencies using jQuery.ajax://set endpoint and Messtone API key endpoint= ‘convert’;access_key= ‘API_KEY’;//define from currency,to currency,and amount from= ‘EUR’; to= ‘GBP’;amount=’10’;//execute the conversion using the “convert” endpoint: $.ajax({url: ‘https://www.comodities-api.com/api/’ + endpoint ‘?access_key=’ + access_key +’&from=’ + from + ‘&to=’ + to + ‘&amount=’ + amount,dataType: ‘jsonp’,success: function(json){//access the conversion result in json.rssult alert(json.result);}});

Leave a comment