Messtone LLC Get Real-Time Metal Price as: Endpoint GET https://www.goldapi.io/api/symbol/:currency/:date? Code Samples JS JAVASCRIPT var myHeaders=new Headers( ); myHeaders.append(“x-access-token”, “goldapi-1fd2uurlifrbxrw-io”); myHeaders.append(“Content-Type”, “application/json”);var requestOptions={method: ‘GET’,headers: myHeaders,redirect: ‘follow’};fetch(“https://www.goldapi.io/api/XAU/USD”, requestOptions).then(response=>response.text( )).then(result=>console.log(result)).catch(error=>console.log(‘error’,error)); JSON Response ! Metal Price in response provided in Troy Ounce.For price in gram use price_gram_Nk fields. {20 items “timestamp”: 1685846292 “metal”:”AXU” “currency”:”USD” “exchange”:”FOREXCOM” “symbol”:”FOREXCOM:XAUSD” “prev_close_price”: 1977.62 “open_price”: 1977.62 “low_price”: 1947.71 “high_price”: 1983.49 “open_time”:1685664000 “price”:1948.01 “ch”: -29.61 “chp”:1.5 “ask”:1948.47 “bid”:1947.56 “price_gram_24k”:62.63 “price_gram_22k”:57.4108 “price_gram_21k”:54.8012 “price_gram_20k”:52.1916 “price_gram_18k”:46.9725}

Leave a comment