Skip to main content

A Python package to get the latest commodities from the Commodities-API

Project description

Commodities-API

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)

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commodities_api-0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

commodities_api-0.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page