# India Stock Market MoneyControl api (`fingolfin/india-stock-market-api`) Actor

for better api structure visit here : { https://rapidapi.com/matepapava123/api/india-stock-market-moneycontrol-live-api }
(data source is moneycontrol)

- **URL**: https://apify.com/fingolfin/india-stock-market-api.md
- **Developed by:** [Mate Papava](https://apify.com/fingolfin) (community)
- **Categories:** News, Automation, AI
- **Stats:** 8 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$0.70 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## India Stock Market Data Scraper — NSE, BSE, MCX

Scrape real-time and historical Indian stock market data. Covers **5000+ listed stocks** on NSE & BSE, all major indices, MCX commodity futures, Futures & Options chains, and financial news.

### What data can you extract?

| Action | Description | Key Input |
|--------|-------------|-----------|
| `stock_quote` | Live stock price with 30+ metrics (PE, PB, 52wk range, volume, market cap) | `symbol` = stock ID (e.g. HDF01, RI, TCS) |
| `stock_search` | Find any stock by name, ticker, or ISIN | `query` = search term |
| `stock_chart` | Historical OHLCV candlestick data | `symbol` = NSE ticker, `resolution`, `days` |
| `index_details` | Full index data (Nifty 50, Sensex, Bank Nifty) | `indexId` = 9, 4, 23, etc. |
| `index_constituents` | All stocks in an index with live prices | `indexId` |
| `index_chart` | Index time-series data (intraday to 5yr) | `indexId`, `chartRange` |
| `market_gainers` | Today's top gaining stocks | `indexId`, `limit` |
| `market_losers` | Today's top losing stocks | `indexId`, `limit` |
| `market_active` | Most traded stocks by volume | `indexId`, `limit` |
| `commodity_quote` | MCX futures — Gold, Silver, Crude Oil, etc. | `symbol`, `expiry` |
| `futures` | Active futures contracts with OI | `symbol` = NIFTY, BANKNIFTY |
| `options_chain` | Full options chain (calls/puts) | `symbol`, `expiry`, `optionType` |
| `news` | Latest financial news headlines | `page`, `limit` |

### Index IDs

| ID | Index |
|----|-------|
| 9 | Nifty 50 |
| 4 | BSE Sensex |
| 23 | Nifty Bank |
| 27 | Nifty Midcap 100 |
| 52 | Nifty Auto |
| 47 | Nifty Financial Services |
| 113 | Nifty Smallcap 50 |
| 28 | Nifty 100 |
| 17 | BSE IT |
| 34 | Nifty Realty |

### Popular Stock IDs

| ID | Company | NSE Ticker |
|----|---------|------------|
| HDF01 | HDFC Bank | HDFCBANK |
| RI | Reliance Industries | RELIANCE |
| TCS | TCS | TCS |
| IT | Infosys | INFY |
| SBI | State Bank of India | SBIN |
| ICI02 | ICICI Bank | ICICIBANK |
| BA08 | Bharti Airtel | BHARTIARTL |
| LT | Larsen & Toubro | LT |
| BAF | Bajaj Finance | BAJFINANCE |
| KMB | Kotak Mahindra Bank | KOTAKBANK |

### Example Input

#### Get HDFC Bank stock quote
```json
{
    "action": "stock_quote",
    "symbol": "HDF01",
    "exchange": "nse"
}
````

#### Get Nifty 50 top gainers

```json
{
    "action": "market_gainers",
    "indexId": "9",
    "limit": 10
}
```

#### Get 30-day daily chart for Reliance

```json
{
    "action": "stock_chart",
    "symbol": "RELIANCE",
    "resolution": "1d",
    "days": 30
}
```

#### Get Gold futures price

```json
{
    "action": "commodity_quote",
    "symbol": "GOLD",
    "expiry": "2026-06-05"
}
```

#### Get Nifty options chain

```json
{
    "action": "options_chain",
    "symbol": "NIFTY",
    "expiry": "2026-05-19",
    "optionType": "CE"
}
```

### Output

Results are pushed to the default dataset. Each run produces one result object with the requested data plus metadata:

```json
{
    "data": { ... },
    "status": "success",
    "_action": "stock_quote",
    "_input": {
        "symbol": "HDF01",
        "exchange": "nse"
    }
}
```

### Chart Resolutions

- `1` — 1-minute candles (intraday)
- `5` — 5-minute candles
- `15` — 15-minute candles
- `30` — 30-minute candles
- `60` — 1-hour candles
- `1d` — Daily candles
- `1w` — Weekly candles
- `1M` — Monthly candles

### Commodity Symbols

GOLD, SILVER, NATURALGAS, CRUDEOIL, COPPER, ZINC, ALUMINIUM, NICKEL, LEAD

### Use Cases

- Stock market dashboards
- Portfolio tracking apps
- Technical analysis tools
- Options strategy builders
- Market screening (gainers/losers/volume)
- Financial news aggregators
- Algorithmic trading research
- Academic research on Indian equities

### Notes

- Market hours: Mon-Fri 9:15 AM - 3:30 PM IST
- Pre-market: 9:00 AM - 9:15 AM IST
- Commodity expiry dates change monthly — check MCX calendar
- Some endpoints may require Indian IP access for full functionality

# Actor input Schema

## `action` (type: `string`):

What data to fetch

## `symbol` (type: `string`):

Stock ID (e.g. HDF01, RI, TCS) for quotes, NSE ticker (e.g. HDFCBANK, RELIANCE) for charts, commodity name (GOLD, SILVER) for commodities, or F\&O symbol (NIFTY, BANKNIFTY)

## `query` (type: `string`):

Search term for stock\_search action (company name, ticker, or ISIN)

## `exchange` (type: `string`):

Stock exchange for quotes

## `indexId` (type: `string`):

Index identifier: 9=Nifty50, 4=Sensex, 23=BankNifty, 27=Midcap100, 52=NiftyAuto, 47=FinService, 113=Smallcap50

## `resolution` (type: `string`):

Candle timeframe for charts

## `days` (type: `integer`):

Number of days for historical chart data (1-365)

## `chartRange` (type: `string`):

Time range for index chart data

## `expiry` (type: `string`):

Contract expiry date for commodities and options (YYYY-MM-DD)

## `optionType` (type: `string`):

CE for Call options, PE for Put options

## `limit` (type: `integer`):

Maximum number of results for gainers/losers/active/news

## `page` (type: `integer`):

Page number for news pagination

## Actor input object example

```json
{
  "action": "stock_quote",
  "symbol": "HDF01",
  "query": "HDFC",
  "exchange": "nse",
  "indexId": "9",
  "resolution": "1d",
  "days": 30,
  "chartRange": "1d",
  "optionType": "CE",
  "limit": 10,
  "page": 1
}
```

# Actor output Schema

## `results` (type: `string`):

Stock market data results stored in the default dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("fingolfin/india-stock-market-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("fingolfin/india-stock-market-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call fingolfin/india-stock-market-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fingolfin/india-stock-market-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "India Stock Market MoneyControl api",
        "description": "for better api structure visit here : { https://rapidapi.com/matepapava123/api/india-stock-market-moneycontrol-live-api }\n(data source is moneycontrol)",
        "version": "1.0",
        "x-build-id": "CLEiSBpoBSXY3EHRx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fingolfin~india-stock-market-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fingolfin-india-stock-market-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/fingolfin~india-stock-market-api/runs": {
            "post": {
                "operationId": "runs-sync-fingolfin-india-stock-market-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/fingolfin~india-stock-market-api/run-sync": {
            "post": {
                "operationId": "run-sync-fingolfin-india-stock-market-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "action"
                ],
                "properties": {
                    "action": {
                        "title": "Action",
                        "enum": [
                            "stock_quote",
                            "stock_search",
                            "stock_chart",
                            "index_details",
                            "index_constituents",
                            "index_chart",
                            "market_gainers",
                            "market_losers",
                            "market_active",
                            "commodity_quote",
                            "futures",
                            "options_chain",
                            "news"
                        ],
                        "type": "string",
                        "description": "What data to fetch",
                        "default": "stock_quote"
                    },
                    "symbol": {
                        "title": "Symbol / Stock ID",
                        "type": "string",
                        "description": "Stock ID (e.g. HDF01, RI, TCS) for quotes, NSE ticker (e.g. HDFCBANK, RELIANCE) for charts, commodity name (GOLD, SILVER) for commodities, or F&O symbol (NIFTY, BANKNIFTY)",
                        "default": "HDF01"
                    },
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Search term for stock_search action (company name, ticker, or ISIN)",
                        "default": "HDFC"
                    },
                    "exchange": {
                        "title": "Exchange",
                        "enum": [
                            "nse",
                            "bse"
                        ],
                        "type": "string",
                        "description": "Stock exchange for quotes",
                        "default": "nse"
                    },
                    "indexId": {
                        "title": "Index ID",
                        "type": "string",
                        "description": "Index identifier: 9=Nifty50, 4=Sensex, 23=BankNifty, 27=Midcap100, 52=NiftyAuto, 47=FinService, 113=Smallcap50",
                        "default": "9"
                    },
                    "resolution": {
                        "title": "Chart Resolution",
                        "enum": [
                            "1",
                            "5",
                            "15",
                            "30",
                            "60",
                            "1d",
                            "1w",
                            "1M"
                        ],
                        "type": "string",
                        "description": "Candle timeframe for charts",
                        "default": "1d"
                    },
                    "days": {
                        "title": "Days of History",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Number of days for historical chart data (1-365)",
                        "default": 30
                    },
                    "chartRange": {
                        "title": "Index Chart Range",
                        "enum": [
                            "1d",
                            "5d",
                            "1m",
                            "3m",
                            "6m",
                            "1yr",
                            "2yr",
                            "5yr",
                            "max"
                        ],
                        "type": "string",
                        "description": "Time range for index chart data",
                        "default": "1d"
                    },
                    "expiry": {
                        "title": "Expiry Date",
                        "type": "string",
                        "description": "Contract expiry date for commodities and options (YYYY-MM-DD)"
                    },
                    "optionType": {
                        "title": "Option Type",
                        "enum": [
                            "CE",
                            "PE"
                        ],
                        "type": "string",
                        "description": "CE for Call options, PE for Put options",
                        "default": "CE"
                    },
                    "limit": {
                        "title": "Results Limit",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of results for gainers/losers/active/news",
                        "default": 10
                    },
                    "page": {
                        "title": "Page Number",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Page number for news pagination",
                        "default": 1
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
