Skip to content

Check This API To Get Copper Rates In JSON

Are you seeking an API with copper rates using JSON? This post is for you!

Following two years of flat growth, mostly due to lower ore grades and production delays, the impact of COVID-19 on mining operations resulted in a 2.6 percent decrease in worldwide copper output to 20.1Mt in 2020. The majority of the damage occurred in the second and third quarters, when output from the top ten producers declined by 3.5 percent and 2.4 percent, respectively, year on year. Chile’s (the world’s top copper producer) output is expected to fall by only 0.7 percent in 2020.

Check This API To Get Copper Rates In JSON

With this perspective, you should know that access to copper pricing may be critical to your business. This data may be obtained using an API, which is a user interface that exposes data once it has been collected from a specified location. This gives a lot of information in a short amount of time.

The JSON format is used by the vast majority of APIs. JSON (JavaScript Object Notation) is a text-based structured data representation based on key-value pairs and ordered lists that are schema-free. Despite being developed in JavaScript, it is supported directly or through libraries by the great majority of programming languages.

JSON is a programming language technology that web servers, browsers, and mobile apps use. Its simple structure and adaptability make it simple to read and comprehend, as well as to update in most situations using your chosen programming language. The lack of a set schema allows for greater format flexibility.

How Does An API Work

After reading all of this, you’re undoubtedly wondering how to get your hands on the JSON API. There are a few pieces of software that do this, and they may be extremely useful. However, not all of them operate in the same manner, so do your research before committing to one and losing your money.

Metals-API is an outstanding API that can provide you with pricing for a wide range of metals in many currencies with a two-decimal point precision in the data. It provides both real-time and historical rates.

Check This API To Get Copper Rates In JSON

To use it, you must do the following:

  1. You may obtain your API key by visiting www.metals-API.com.
  2. Keep an eye out for the copper (XCU) and your preferred currency sign.
  3. Before submitting the API call, use these symbols to add metal and money to the list. You may also choose a programming language and a price range.
  4. Then, simply click the “run” button, and you’re done! The API will be displayed on your screen.

The API will appear as follows:

// set endpoint and your access key
endpoint = 'latest'
access_key = 'API_KEY';

// get the most recent exchange rates via the "latest" endpoint:
$.ajax({
url: 'https://metals-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);

}
});

Which Are The Benefits Of Metals-API

Metals-API started as a basic, lightweight Open-Source API that enabled banks to access current and historical precious metals values. With a refresh rate of 60 seconds, this API provides real-time precious metals data to two decimal places.

Among the features accessible are precious metals exchange rates, single currency switching, Time-Series data, volatility statistics, and the day’s lowest and highest prices. The Metals-API can compute precise precious metal exchange rates in more than 170 currencies worldwide, including Bitcoin and other major cryptocurrencies.

Published inAppsApps, technologyTechnology
%d bloggers like this: