Skip to main content

The Ultimate Unofficial NEPSE API for real-time Nepal Stock Exchange data.

Project description

🚀 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.

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

api_nepse-2.2.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

api_nepse-2.2.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file api_nepse-2.2.0.tar.gz.

File metadata

  • Download URL: api_nepse-2.2.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for api_nepse-2.2.0.tar.gz
Algorithm Hash digest
SHA256 f8e31d11c1fdbbd9bea0c86469b87c79edf047807c91f7e5324224dafde14922
MD5 b1789308d62287100271924582e30784
BLAKE2b-256 d0346d52c43806f30c0d479414131a2cc75a67c51019338e4108760e8f98fb1d

See more details on using hashes here.

File details

Details for the file api_nepse-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: api_nepse-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for api_nepse-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd16dcab1c8328ebe790964ece70b04b6d915681d5a84513f0bb3f2ddb310531
MD5 827dfbc21ec31c03454a110e3a598ef1
BLAKE2b-256 65d03900177a0ae77897bc6a68520870e74774a1b7fc55d110026b3b2c8863e9

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