Skip to main content

mcx-data

MCX India

Download MCX India commodity spot market data as pandas DataFrames.
28 commodities — GOLD, SILVER, CRUDEOIL, NATURALGAS and more.
Works on AWS Lambda via Chrome TLS impersonation (bypasses Akamai WAF).

PyPI version Python 3.9+ License: MIT

Download MCX India commodity spot market data as pandas DataFrames. Works from AWS Lambda and any cloud environment.

Full Documentation → NikhilSuthar.github.io/indian-market-data/mcx-spot

Part of the indian-market-data monorepo — also see nse-archives.

pip install mcx-data

Quick Start

from mcxdata import mcx

# Today's spot prices — all 28 commodities
df = mcx.get_spot_recent()

# Single commodity
df = mcx.get_spot_recent(commodity="GOLD")

# Historical (requires specific commodity)
df = mcx.get_spot_archive("2026-05-01", "2026-05-22", commodity="GOLD")
df = mcx.get_spot_archive("2026-05-01", "2026-05-22", commodity="SILVER")

# Download to S3
mcx.download("spot", "market", "spot_recent",
             s3_bucket="my-bucket", s3_prefix="raw/mcx/")

# Available commodities (28)
mcx.list_commodities()

Datasets

Dataset Description Date Param
spot_recent Today's spot prices — all 28 commodities None
spot_archive Historical spot prices by commodity + date range from_date, to_date

Available Commodities (28)

ALUMINI, ALUMINIUM, CARDAMOM, COPPER, COTTON, COTTONOIL, CPO, CRUDEOIL, CRUDEOILM, ELECDMBL, GOLD, GOLDGUINEA, GOLDM, GOLDPETAL, GOLDTEN, KAPAS, LEAD, LEADMINI, MENTHAOIL, NATGASMINI, NATURALGAS, NICKEL, SILVER, SILVERM, SILVERMIC, STEELREBAR, ZINC, ZINCMINI

Notes

  • MCX archive requires a specific commodity — "ALL" returns empty (MCX API limitation)
  • Uses curl-cffi Chrome TLS impersonation to bypass MCX Akamai WAF
  • Lambda IPs are generally unblocked — works reliably on AWS

Polars output (optional)

By default every function returns a pandas DataFrame. To get polars DataFrames instead, install the extra and set one environment variable before importing — no code changes needed:

pip install mcx-data[polars]
import os
os.environ["IMD_DATAFRAME"] = "polars"   # set before importing mcxdata

from mcxdata import mcx
df = mcx.get_spot_recent()
type(df)   # polars.DataFrame

All internal logic stays in pandas; conversion happens only at the final return step. Leave IMD_DATAFRAME unset (or =pandas) for the default pandas output.

License

MIT — data from MCX India.

Metadata

Release files for mcx-data 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcx-data 1.2.0
File Size Uploaded Provenance Actions
mcx_data-1.2.0.tar.gz 14.8 kB With provenance Details for mcx_data-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcx-data 1.2.0
File Interpreter ABI Platform Actions
mcx_data-1.2.0-py3-none-any.whl Python 3 none any Details for mcx_data-1.2.0-py3-none-any.whl

Total release size: 32.1 kB

Release files / mcx_data-1.2.0.tar.gz

Download URL mcx_data-1.2.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3d1453de5883009cf10b72fed46f0a890396300ce397638782ba6686936f9289
BLAKE2b-256 checksum
How to use checksums
2752ec830b3466b4dc26e079261e021e06999e1eeed7910ad075861c0a3fd547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Release files / mcx_data-1.2.0-py3-none-any.whl

Download URL mcx_data-1.2.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6c1dc6cde51bf80c737330097c2650fdb769c7093fcb9ff3118d6a9df54526d
BLAKE2b-256 checksum
How to use checksums
f2a97543ad22008e27c1fef5356000fb2130939d56a81b3b26d7dbe4252b40f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Security for mcx-data 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcx_data-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page