Skip to main content

Unofficial async Python client for Nepal Stock Exchange (NEPSE)

Project description

nepseman-api

Unofficial async Python client for Nepal Stock Exchange (NEPSE) market data. Not affiliated with NEPSE or nepalstock.com.np. Use at your own risk.

Reverse-engineers the authentication layer of nepalstock.com.np — including WASM-based token obfuscation and salt-based payload signing — with no dependency on any third-party NEPSE library.

Installation

pip install nepseman-api

Quick Start

import asyncio
from nepseman_api import NepseClient

async def main():
    async with NepseClient() as nepse:
        # Market status
        status = await nepse.market_status()
        print(status)

        # Today's prices
        prices = await nepse.today_price()
        print(prices[:5])

        # Price history for a stock
        history = await nepse.price_history("NABIL")
        print(history[:5])

asyncio.run(main())

Available Methods

Market

await nepse.market_status()       # Open/closed status
await nepse.is_market_open()      # Returns True/False
await nepse.market_summary()      # Today's summary (turnover, transactions)
await nepse.supply_demand()       # Market-wide supply & demand

Prices

await nepse.today_price()                        # All stock prices
await nepse.today_price(business_date="2026-06-10")  # Specific date
await nepse.live_market()                        # Live ticker (trading hours only)
await nepse.price_volume()                       # Price/volume stats

Top Lists

await nepse.top_gainers()      # Top gaining stocks
await nepse.top_losers()       # Top losing stocks
await nepse.top_turnover()     # Top by turnover
await nepse.top_trade()        # Top by trade count
await nepse.top_transaction()  # Top by transactions

Indices

await nepse.nepse_index()          # NEPSE index value
await nepse.nepse_subindices()     # All sector subindices
await nepse.index_graph("banking") # Historical graph data

Securities

await nepse.company_list()              # All listed companies
await nepse.security_list()             # All securities with IDs
await nepse.sector_scrips()             # Grouped by sector
await nepse.company_details("NABIL")    # Company details
await nepse.daily_graph("NABIL")        # Intraday graph
await nepse.price_history("NABIL")      # OHLCV history (1 year default)
await nepse.price_history(
    "NABIL",
    start_date="2025-01-01",
    end_date="2025-12-31",
    size=500,
)
await nepse.market_depth("NABIL")       # Bid/ask depth (trading hours only)

Bulk History

# Fetch history for multiple stocks in parallel
results = await nepse.bulk_price_history(
    ["NABIL", "NICA", "ADBL"],
    start_date="2025-01-01",
    concurrency=5,
)
# {"NABIL": [...], "NICA": [...], "ADBL": [...]}

Floorsheet

await nepse.floor_sheet()                    # All trade records (paginated)
await nepse.floor_sheet(page=1, size=500)
await nepse.floor_sheet_of("NABIL")         # Filtered by symbol (first 500 rows only)

Note: floor_sheet_of() scans only the first size floorsheet records. NEPSE does not expose a per-symbol endpoint. For complete results, iterate floor_sheet(page=N) and filter manually.

Index Names

Valid values for index_graph():

nepse, sensitive, float, sensitive_float, banking, dev_bank, finance, hotel_tourism, hydro, investment, life_insurance, manufacturing, microfinance, mutual_fund, non_life_insurance, others, trading

Notes

  • Trading hourslive_market() and market_depth() only return data Sun–Thu 11:00–15:00 NST
  • Floorsheetfloor_sheet_of() filters client-side from the general floorsheet (NEPSE does not expose a per-symbol endpoint)
  • SSL — NEPSE serves an incomplete certificate chain; the client bypasses SSL verification automatically

Live API

Don't want to run Python? Use the hosted REST API:

Base URL: https://nepseman-api-production.up.railway.app

curl https://nepseman-api-production.up.railway.app/api/v1/market/status
curl https://nepseman-api-production.up.railway.app/api/v1/prices/today
curl https://nepseman-api-production.up.railway.app/api/v1/securities/NABIL

Interactive docs: https://nepseman-api-production.up.railway.app/docs

Disclaimer

This project is unofficial and not affiliated with NEPSE or nepalstock.com.np. It reverse-engineers the public-facing web interface for educational and personal use. Data accuracy is not guaranteed. Do not use in production trading systems.

License

MIT

Project details


Download files

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

Source Distribution

nepseman_api-1.0.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nepseman_api-1.0.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file nepseman_api-1.0.1.tar.gz.

File metadata

  • Download URL: nepseman_api-1.0.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for nepseman_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b6f15b5378940ef4bec6c862c3c52dc2406b5cb254c0fee50f22337ce42d27c4
MD5 479f6f52c23f05d092cdb13b4be51255
BLAKE2b-256 1a0f1f3ce1cdf1c72ad4a505bf3565d145748f3cef3afd2818542d8402c9fbf9

See more details on using hashes here.

File details

Details for the file nepseman_api-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nepseman_api-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for nepseman_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b75a9860cff204267678ce4435dab14df75559c4fe6344195521d390ed189c
MD5 f4c5e2ffde0da78892aef472026b600a
BLAKE2b-256 ae362c388d30e714277e6ae7996307f5e5afeed356aad1e6ae71dfe1a68f3b87

See more details on using hashes here.

Supported by

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