Skip to content

Get Aluminum And Palladium Rates Using Python With This API

APIs are the best tool to stay on top of changes in the world of precious metals. While there are some that are specialized in gold and silver, the best are those that give rates of metals with infrastructure utility. These are both the Palladium and the Aluminum.

When talking about aluminum, one refers to the metal most used in the construction of factories, as well as the parts of the largest and most important machinery in the world. This leads to it being, not only the most useful on the market but the most used.

The problem lies in how to know when your price is at the best time to buy. For this, it is necessary to know which is the country that has the largest reserves and find an API that has rates in that currency.

Get Aluminum And Palladium Rates Using Python With This API

If you know the price in the nation that manufactures it, as well as its changes by the hour or minute, you already have a very safe investment.

One of the most widely used tools in the API world is Metals-API. In addition to being one of the most used in useful metals such as Aluminum, it has an unparalleled speed. It also allows you to give results in Python.

Python is an interpreted high-level general-purpose programming language. That is why it is best to be used within a database with changing information such as precious metals.

Is widely used in the development of websites and software, as well as in task automation, data analysis, and data visualization. Because of its relative ease of learning,

Python has been used by many non-programmers, such as accountants and scientists, for a variety of common tasks.

Get Aluminum And Palladium Rates Using Python With This API

Here’s an example. 

    import requests

    base_currency = 'USD'
    symbol = 'ALU' 
    endpoint = 'latest'
    access_key = 'API_KEY'

    resp = requests.get(
        'https://metals-api.com/api/'+endpoint+'?access_key='+access_key+'&base='+base_currency+'&symbols='+symbol)
    if resp.status_code != 200:
        # This means something went wrong.
        raise ApiError('GET /'+endpoint+'/ {}'.format(resp.status_code))
    print(resp.json())
    

Anyway, this extract belongs to one of the most used metal APIs. This is Metals-API. In addition to being one of the fastest, it gives this type of possibilities between Python and JSON, as well as Java and PHP.

Metals-API.com offers a live precious metals market data API with a 2 decimal point resolution and a 60-second refresh rate.

Key Features

  • API for real-timehistorical, and tick-by-tick periodicity
  • Real-time precious metals prices for Gold, Silver, Copper, Rhodium, Nickel, Palladium, Zinc, Ruthenium, and Platinum
  • Real-time metals price API for base metals and platinum group metals
  • Intraday and historical charts AP
  • Historical spot and future prices for Gold, Silver, Copper, Rhodium, Nickel, Palladium, Zinc, Ruthenium, and Platinum

Also published on Medium.

Published inAppsSaaSStartupsTechnology
%d bloggers like this: