Python client for the Naradh OHLC data API
Project description
Naradh
Python client for the Naradh OHLC Data API — 1-minute bar data for Indian markets (NIFTY50, SENSEX, CRUDEOIL, NATURALGAS), served from naradh.finvigna.com.
Installation
pip install naradh
Quick Start
from naradh import Naradh
client = Naradh(api_key="nrd_...")
# List available instruments and date ranges
df = client.instruments()
# Today's 1-minute bars
df = client.today("NIFTY50")
# Latest N bars
df = client.latest("CRUDEOIL", n=500)
# 1-minute bars for a date range
df = client.ohlc("SENSEX", from_date="2026-05-01", to_date="2026-05-11")
# Resampled to any timeframe
df = client.historical("NIFTY50", from_date="2026-05-01", to_date="2026-05-11", timeframe="5")
df = client.historical("CRUDEOIL", from_date="2026-05-01", to_date="2026-05-11", timeframe="1h")
df = client.historical("NATURALGAS", from_date="2026-05-01", to_date="2026-05-11", timeframe="1d")
All methods return a pandas DataFrame with datetime as the index.
Instruments
| Instrument | Exchange | Session (IST) |
|---|---|---|
| NIFTY50 | NSE | 09:15 – 15:30 |
| SENSEX | BSE | 09:15 – 15:30 |
| CRUDEOIL | MCX | 09:00 – 23:30 |
| NATURALGAS | MCX | 09:00 – 23:30 |
Timeframes
| Input | Resolution |
|---|---|
1, 3, 5, 10, 15, 30 |
Minutes |
1h, 2h, 4h |
Hours |
1d |
Daily |
1w |
Weekly |
API Reference
Naradh(api_key, host, timeout)
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str | — | Your API key (required) |
host |
str | https://naradh.finvigna.com |
API server URL |
timeout |
int | 30 |
Request timeout in seconds |
Methods
instruments() → DataFrame
Returns all instruments with available date ranges.
Columns: instrument, from, to, total_days
today(instrument) → DataFrame
All 1-minute bars collected so far today.
latest(instrument, n=100) → DataFrame
Latest N bars (max 5000) across all available dates.
ohlc(instrument, from_date, to_date) → DataFrame
Raw 1-minute bars for a date range. Dates in YYYY-MM-DD format.
historical(instrument, from_date, to_date, timeframe="5") → DataFrame
OHLC data resampled to the requested timeframe.
All DataFrames have:
Index: datetime
Columns: open, high, low, close, volume
Exceptions
from naradh import (
NaradhException, # base class
InstrumentNotFound, # invalid instrument name
DataNotFound, # no data for the requested date/instrument
InvalidTimeframe, # unsupported timeframe string
InvalidDateRange, # from_date > to_date or bad format
APIError, # unexpected server error
)
Getting an API Key
Contact finvigna.com to request an API key.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file naradh-1.0.0.tar.gz.
File metadata
- Download URL: naradh-1.0.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a7a9807f22b8f3b0a6e999bf330897c18f048e1081680e3abf6fac42d1e4190
|
|
| MD5 |
acca630a634695e80d8069f64612546a
|
|
| BLAKE2b-256 |
0451b7f9f35add7a1cc5b9ddce04a0af5ba469772e647cc4787ea3de961cab8b
|
File details
Details for the file naradh-1.0.0-py3-none-any.whl.
File metadata
- Download URL: naradh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a3ab3a9e3626c12130d304a584b52dd300b63a1e6a332efc7493ccb8761f560
|
|
| MD5 |
53f3fa33c55934a3ed3292b832ec7900
|
|
| BLAKE2b-256 |
72b6646b5c3f35e7e6b02c1a05652e7f31c9fb6aacc197b936acc5bd4ede2365
|