Do you want to know how to get rice spot prices? Then an API is a perfect solution for you. Here, we explain to you how to use it.
But first, let’s talk about rice and why is it an amazing investment nowadays. It is the agricultural product with the third-highest global output, trailing only sugarcane and maize. In 2019, China produced about 200 million tonnes of rice, followed by India, which produced 177 million tons. These high numbers are because rice is eaten by over half of the world’s population. This is mostly in Asia, Latin America, and Africa.
Given the commodity’s worldwide relevance, you must be aware of its pricing in several currencies if you wish to expand your firm or contemplate investing in the sector. This may be accomplished by utilizing an API, which is an interface that collects data from a place and then delivers it to the person who made the API call. This is used in many websites and it’s really helpful when you want to get updated and fast information.
Thanks to an API, you can stay updated on many different rates that will help you understand the industry better. For example, real-time, historical, and spot rates, among many others. Since you’re probably just interested in getting spot prices, then we’ll explain to you how to get them.
How To Get Spot Prices
To get an API that gives you this information, you have to find a software that provides you with it. Online, you’ll find many of these, but you’ll notice that every single one of them works differently. Because of that, you should be careful about which software you chose, so you don’t end up losing time and money in the process.
For this example and to show you better how APIs work, we will use Commodities-API since we think this is the most complete one available online. This is a free public API that provides commodities rates, such as coffee, rice, sugar, among others, in many different currencies. It has a 2 decimal point precision and more than 170 currencies to choose from, which makes it the most useful tool at the moment.
To get the API with spot prices, you need to:
1. Enter www.commodities-API.com and sign in to get your own API key.
2. Search for the symbols of rice (RICE) and the currency of your preference.
3. Use these symbols to find the commodity and currency in the list. Once you choose them, make the API call.
4. Search for the spot rates. The website will return you an API in various programming languages that you can adapt and use however you like.
The answer will look something like this:
{ "success": true, "timestamp": 1519296206, "base": "RICE", "date": "2018-09-10", "rates": { "AUD": 1.566015, "CAD": 1.560132, "CHF": 1.154727, "CNY": 7.827874, "GBP": 0.882047, "JPY": 132.360679, "USD": 1.23396, [...] } }
Is This Information Trust-worthy?
It is! Commodities-API looks for this data from banks and the stock market, so you can be relaxed and know that you’re getting the right information. Besides, to protect your connection, this software employs bank-grade 256-bit SSL encryption.
Currency and commodity price conversions are handled by the same API endpoints and may be used to convert any amount from one currency to another, or from one commodity to any commodity, or from any currency to any currency.
.
.
Also published on Medium.