Trying to stay updated on the prices of different products can be really difficult since the world moves in a fast way. Because of that, here we tell you how to get real-time commodity prices with an API.
A commodity is a fundamental good that is interchangeable with other products of the same sort in commerce. Commodities are frequently utilized as inputs in the manufacture of other commodities or services. The quality of a particular product may vary slightly from producer to producer, but it is basically uniform.
Some commodities are rice, cotton, corn, oil, etcetera. They all count with their real-time rates. When a system sends information to a user in near-instantaneous or with a small delay from when the event happened, this is referred to as real-time. Online brokerages frequently provide a real-time data stream that displays stock quotations and their associated real-time changes with a very little lag time, allowing customers to make investment decisions based on the most up-to-date information.
So, how can you get this information? For this, using an API is the best decision. An API is a collection of definitions and protocols used to create and integrate application software, allowing communication between two software applications via a set of rules. If you send a request to an API, you will get the answer instantly.
Where To Get An API?
The appropriate API can provide you with real-time pricing for any metal or commodity you choose. This will assist you in staying up to current on the costs you require for your organization and investments.
We highly recommend using Commodities-API, a free and reliable web API. To use it, go to www. commodities-API.com and sign in to get an API key. Then, you select the commodity’s and currency’s symbol of your preference and make the API call.
API Request:
https://commodities-api.com/api/latest ? access_key = API_KEY & base = USD & symbols = GBP,JPY,EUR
Request Parameters:
Parameter | Description |
---|---|
access_key | [required] Your API Key. |
base | [optional] Enter the three-letter currency code or metal code of your preferred base currency. |
symbols | [optional] Enter a list of comma-separated currency codes or metal codes to limit output codes. |
And then, you will get a response:
{ "success": true, "timestamp": 1519296206, "base": "USD", "date": "2018-09-10", "rates": { "GBP": 0.72007, "JPY": 107.346001, "EUR": 0.813399, } }
Benefits of Commodities-API
This software delivers exact commodity and exchange rate data for almost any commodity as well as 170 global currencies, including Bitcoin and other major cryptocurrencies. Rice, wheat, coffee, corn, sugar, Brent crude oil, WTI crude oil, soybeans, and other commodities are all covered.
Commodities-API gathers data from banks and stock exchanges and uses it to provide you with the most up-to-date and secure information. Furthermore, it employs bank-grade 256-bit SSL encryption to protect your connection’s security at all times. Only midpoint data for commodities and currency rates is provided via the API. The average median rate of Bid and Ask at a particular time is used to determine midpoint rates.
Also published on Medium.