Metadata-Version: 2.4
Name: api-nepse
Version: 2.1.0
Summary: The Ultimate Unofficial NEPSE API for real-time Nepal Stock Exchange data.
Home-page: https://github.com/BalochLeader/NEPSE-API
Author: Gunpark
Author-email: gunpark@example.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: httpx[http2]
Requires-Dist: pywasm
Requires-Dist: tqdm
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

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

[![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge&logo=fastapi)](https://fastapi.tiangolo.com)
[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org)
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
[![Instagram](https://img.shields.io/badge/Instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white)](https://instagram.com/gunpark_xd)

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

---

## 🚀 Quick Start

### 1. Clone the Repository
```bash
git clone https://github.com/BalochLeader/NEPSE-API.git
cd NEPSE-API
```

### 2. Install Dependencies
```bash
pip install -r requirements.txt
```

### 3. Run the Server
```bash
python main.py
```
The API will be live at `http://localhost:8080`.

---

## 📖 API Documentation

Once the server is running, visit the interactive documentation at:
👉 **[http://localhost:8080/docs](http://localhost:8080/docs)**

### 📍 Popular Endpoints

| 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 |
| **Performers** | `GET /api/v1/top/turnover` | Stocks with highest turnover |
| **Company** | `GET /api/v1/companies` | Complete list of listed companies |
| **Advanced** | `GET /api/v1/market/depth/{symbol}` | Real-time Order Book / Market Depth |

---

## 🛠️ Technical Architecture

This API is built using **FastAPI** for its asynchronous capabilities and speed. It utilizes a custom scraping engine that:
1.  **Authenticates** with NEPSE's servers.
2.  **Parses** dynamic salts using a **WebAssembly (WASM)** module (`css.wasm`).
3.  **Generates** valid tokens to access protected data endpoints.
4.  **Formats** raw data into clean, developer-friendly JSON.

---

## 👨‍💻 Developer

**Gunpark**
- 📸 Instagram: [@gunpark_xd](https://instagram.com/gunpark_xd)
- 💻 GitHub: [BalochLeader](https://github.com/BalochLeader)

---

## 📜 License

This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

## ⚠️ Disclaimer

This is an **unofficial** API. It is not affiliated with, maintained by, or endorsed by the Nepal Stock Exchange (NEPSE). Use this data for informational and educational purposes only. For critical financial decisions, always refer to official NEPSE sources.

---

## 🏷️ SEO & Tags

`NEPSE API` `Nepal Stock Exchange` `Nepal Share Market` `Live Stock Prices Nepal` `NEPSE Scraper` `Nepal Finance API` `Python NEPSE` `FastAPI` `Real-time Market Data` `Nepal Investors` `ShareSansar Alternative` `NEPSE Today Price API` `NEPSE Floorsheet API`
