Skip to main content

🚀 NEPSE API Pro - The Ultimate Unofficial Nepal Stock Exchange API

FastAPI Python PyPI MIT License Instagram

NEPSE API Pro is a high-performance, ultra-comprehensive unofficial API for the Nepal Stock Exchange (NEPSE). Designed for developers, traders, and financial analysts, it provides seamless access to real-time market data, historical records, and deep market insights.


🔥 Key Features

  • ⚡ Real-time Data: Live stock prices, LTP, and market status.
  • 📊 Full Market Coverage: Today's Price, Indices, Sub-Indices, and Floorsheet.
  • 🏢 Company Insights: Complete lists of companies, securities, and detailed market depth.
  • 🔝 Performance Tracking: Top Gainers, Losers, Turnover, Volume, and Transactions.
  • 🛠️ Developer First: Standardized JSON responses, Swagger UI documentation, and easy integration.
  • 🛡️ Advanced Scraping: Handles complex NEPSE authentication and WASM-based token parsing automatically.
  • 🔄 Multiple Headers: Rotates User-Agents to prevent blocking.

🚀 Quick Start

1. Installation

Install api-nepse directly from PyPI:

pip install api-nepse

2. Run the API Server

After installation, you can run the API server using the api-nepse command:

api-nepse

The API will be live at http://localhost:8080.


💻 Code Examples

Python Example

import requests

# Get Today's Price
response = requests.get("http://localhost:8080/api/v1/market/today-price")
data = response.json()

if data["status"] == "success":
    for record in data["data"]:
        print(f"{record['symbol']}: {record['lastTradedPrice']}")

JavaScript (Fetch) Example

fetch('http://localhost:8080/api/v1/market/live')
  .then(response => response.json())
  .then(data => console.log(data.data))
  .catch(error => console.error('Error:', error));

🌐 How to Host

1. Local Hosting

Simply run api-nepse on your local machine. Ensure port 8080 is open.

2. Cloud Hosting (Heroku / Render / Railway)

  1. Fork this repository.
  2. Connect your GitHub to the hosting platform.
  3. Set the start command to:
    uvicorn api_nepse.main:app --host 0.0.0.0 --port $PORT
    

3. Docker Hosting

Use the following Dockerfile:

FROM python:3.9
RUN pip install api-nepse
EXPOSE 8080
CMD ["api-nepse"]

📖 API Endpoints

👉 http://localhost:8080/docs

Category Endpoint Description
Market GET /api/v1/market/status Check if market is OPEN/CLOSED
Market GET /api/v1/market/today-price Full Today's Price sheet
Market GET /api/v1/market/live Real-time live stock prices
Indices GET /api/v1/indices All NEPSE Indices
Performers GET /api/v1/top/gainers Top 10 Gaining stocks
Advanced GET /api/v1/market/floorsheet Latest Floorsheet data

👨‍💻 Developer

Gunpark


📜 License

This project is licensed under the MIT License.

⚠️ Disclaimer

This is an unofficial API. Use for informational purposes only. Not affiliated with NEPSE.

Metadata

Release files for api-nepse 2.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 api-nepse 2.2.0
File Size Uploaded
api_nepse-2.2.0.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for api-nepse 2.2.0
File Interpreter ABI Platform
api_nepse-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.1 kB

Release files / api_nepse-2.2.0.tar.gz

Download URL api_nepse-2.2.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f8e31d11c1fdbbd9bea0c86469b87c79edf047807c91f7e5324224dafde14922
BLAKE2b-256 checksum
How to use checksums
d0346d52c43806f30c0d479414131a2cc75a67c51019338e4108760e8f98fb1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / api_nepse-2.2.0-py3-none-any.whl

Download URL api_nepse-2.2.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd16dcab1c8328ebe790964ece70b04b6d915681d5a84513f0bb3f2ddb310531
BLAKE2b-256 checksum
How to use checksums
65d03900177a0ae77897bc6a68520870e74774a1b7fc55d110026b3b2c8863e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

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