Commodities-API
Commodities-API - The ultimate API for accessing comprehensive and accurate real-time and historical rates on various commodities effortlessly. Commodities-API supports 350+ symbols with updates every 60 seconds. Try the Start 7-Day Free Trial. Cancel anytime at your convenience.
Key Features:
- Built for Developers: Tailored for developers, ensuring ease of use and seamless integration.
- Robust JSON API: A powerful JSON API designed for accurate and efficient data retrieval.
- Top-Tier Security: Trust Commodities-API with advanced security measures to protect your data.
- Reliable Data Sources: Benefit from reliable and accurate data from trusted sources.
- Flexible Integration: Easily integrate Commodities-API into any language for diverse applications.
- Historical Data Access: Dive into historical data for comprehensive analysis and informed decision-making.
- Exceptional Accuracy: Rely on Commodities-API for spot-on accuracy in real-time and historical data.
- User-Friendly Documentation: Navigate through our comprehensive documentation for a smooth integration process.
- Specialized Support: Count on our dedicated support team for assistance tailored to your specific needs.
Supported Commodities
Explore a wide range of supported commodities, including precious metals, energy resources, agricultural products, and more. From coffee to electricity, we cover it all. View Supported Commodities
Documentation
For detailed information on API endpoints, usage, and integration guidelines, check our API Documentation.
Start using Commodities-API today for unparalleled access to commodities data. Visit Commodities-API.com and integrate in just minutes!
Installation
You can install Commodities-API Python SDK with pip.
pip commodities-api
Usage
The Commodities-API Python SDK is a wrapper around the requests library. Commodities-API supports a GET request for now.
Sign-up to Commodities-API to get your API key and some credits to get started.
Making the GET request
>>> from commodities_api import CommoditiesApiClient
>>> client = CommoditiesApiClient(access_key='REPLACE-WITH-YOUR-ACCESS-KEY')
>>> response = client.get_latest("base", ["symbols"])
Request Example
>>> from commodities_api import CommoditiesApiClient
>>> client = CommoditiesApiClient(access_key='REPLACE-WITH-YOUR-ACCESS-KEY')
>>> response = client.get_latest("USD", ["RICE", "WHEAT", "SUGAR"])
Response Example
{
"data": {
"success": true,
"timestamp": 1715796300,
"date": "2024-05-15",
"base": "USD",
"rates": {
"RICE": 0.052356020942408,
"SUGAR": 5.3676865271068,
"USD": 1,
"WHEAT": 0.0036618232950551,
"USDRICE": 19.100000000000136,
"USDSUGAR": 0.1863000000000006,
"USDWHEAT": 273.08799999999803
},
"unit": {
"RICE": "per cwt",
"WHEAT": "per metric ton",
"SUGAR": "per lb"
}
}
}
AVAILABLE METHODS
>>> get_latest(base: str, symbols: List[str])
>>> get_historical(date:str, base:str, symbols: List[str])
>>> get_time_series(start_date: str, end_date: str, symbol: str)
Release files for commodities-api 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commodities_api-0.3.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commodities_api-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / commodities_api-0.3.tar.gz
| Download URL | commodities_api-0.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb9b47919fc05a79d648fd899c2a1c41fc72fc2edda998f1dd4b8cca1a3da2de
|
|
BLAKE2b-256 checksum How to use checksums |
0ed3a9f36bea897c9ccf439442e88c2fcddc4296fb0e8a0b73158e0b12713b65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / commodities_api-0.3-py3-none-any.whl
| Download URL | commodities_api-0.3-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4ce9c37b47008ff9d237a9dbce42b3732c876934c25f1221235e6d60252fb06
|
|
BLAKE2b-256 checksum How to use checksums |
e9256d19deb34b1b727d271ae2178410d4c90ccd37dd4b08f7f822b45e0b50a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|