# Sharesansar — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access real-time Nepali stock prices, browse company information, and read the latest market news all in one place. Stay informed about the Nepal stock market with current pricing data and detailed news articles.

**Category:** Finance & Markets | **Website:** [sharesansar.com/](https://sharesansar.com/) | **Docs:** [parse.bot/marketplace/90eb064c-d158-4279-94c3-9a1b89b00f48/sharesansar-com-api](https://parse.bot/marketplace/90eb064c-d158-4279-94c3-9a1b89b00f48/sharesansar-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_companies

Get a comprehensive list of all companies listed on the Nepal Stock Exchange (NEPSE) with their symbols, names, and internal IDs. Useful for looking up valid stock symbols before calling get_stock_prices.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/get_companies \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_index_history

Fetch historical NEPSE index data for a given index type and optional date range. Returns daily records with open, high, low, close, and turnover values. The index_id corresponds to specific market indices (e.g., 12 for NEPSE Index, 1 for Banking SubIndex). When no date range is specified, returns approximately the last month of data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `from_date` | string | No | Start date in YYYY-MM-DD format for the history range. |
| `index_id` | string | No | Numeric ID of the index. See IndexType enum for known values. |
| `to_date` | string | No | End date in YYYY-MM-DD format for the history range. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/get_index_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from_date":"<string>","index_id":"<string>","to_date":"<string>"}'
```

### get_news_detail

Get full content and details of a specific news article given its URL. The URL is obtained from get_news_list results. Returns headline, full article text content, and publication date.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | The full URL of the news article (from get_news_list results). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/get_news_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_news_list

Get a list of news articles from a specific category on ShareSansar. Returns titles and URLs. Supports cursor-based pagination via the next_cursor field. Published dates are not available in the listing; use get_news_detail to retrieve the publication date for individual articles.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | No | News category slug. Known values: 'latest-news', 'exclusive', 'ipo-fpo-news', 'proposed-dividend'. |
| `cursor` | string | No | Opaque pagination cursor returned as next_cursor in a previous response. Pass to fetch the next page of results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/get_news_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","cursor":"<string>"}'
```

### get_stock_prices

Get stock prices for all companies listed on NEPSE for a specific date or the latest available trading day. Returns Symbol, LTP, Volume, Open, High, Low, Close, and Turnover for each stock. When the requested date has no trading data (e.g., holidays or weekends), the site returns the latest available data instead. The actual_date field in the response indicates which date's data was returned.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. If not provided or if no trading data exists for the date, returns the latest available data. |
| `sector` | string | No | Sector filter for stock prices. Default is 'all_sec' for all sectors. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sharesansar-com-api-90eb064c/get_stock_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","sector":"<string>"}'
```
