Type: | Package |
Title: | Bhavcopy and Live Market Data from National Stock Exchange (NSE) & Bombay Stock Exchange (BSE) India |
Version: | 1.5.6 |
Date: | 2025-08-24 |
Description: | Download Current & Historical Bhavcopy. Get Live Market data from NSE India of Equities and Derivatives (F&O) segment. Data source https://www.nseindia.com/. |
URL: | https://github.com/nandp1/nser/ |
BugReports: | https://github.com/nandp1/nser/issues |
Language: | en-US |
License: | GPL-3 |
Depends: | R (≥ 3.0) |
Encoding: | UTF-8 |
LazyData: | TRUE |
Imports: | utils, readr, magrittr, rvest, stringr, httr, googleVis, dplyr, lubridate, purrr, curl, reticulate, xml2 |
Suggests: | rmarkdown, testthat (≥ 3.0.0), knitr, reshape2 |
RoxygenNote: | 7.3.2 |
VignetteBuilder: | knitr |
Author: | Nandan Patil [cre, aut] |
Maintainer: | Nandan Patil <tryanother609@gmail.com> |
Repository: | CRAN |
NeedsCompilation: | no |
Packaged: | 2025-08-24 14:12:14 UTC; PATIL |
Date/Publication: | 2025-08-25 08:30:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling 'rhs(lhs)'.
Bhavcopy from NSE and BSE
Description
Bhavcopy from NSE and BSE
Usage
bhav(x, se = "NSE")
Arguments
x |
numeric date format |
se |
Stock Exchange either 'NSE' or 'BSE'. Default is 'NSE'. |
Details
Gets Bhavcopy from NSE and BSE for the given date.
Value
Bhavcopy for the given date.
Note
The date should be strictly numerical and mentioned in quotation mark (refer examples). 'bhav' can be used to download NSE bhavcopy from 1 Jan 2020 on wards.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>, <https://www.bseindia.com/markets/marketinfo/BhavCopy.aspx>
See Also
Examples
#Download Bhavcopy from NSE
report = bhav("01072024") # Download bhavcopy for 01 July 2024
#Download bhavcopy from BSE
report = bhav("01072024", 'BSE')
Bhavcopy from NSE upto 05 July 2024
Description
Bhavcopy from NSE upto 05 July 2024
Usage
bhav1(x)
Arguments
x |
numeric date format |
Details
Gets Bhavcopy from NSE from 1 Jan 2016 to 05 July 2024.
Value
Bhavcopy for the given date.
Note
The date should be strictly numerical and mentioned in quotation mark (refer examples). 'bhav1' can be used to download bhavcopy from 1 Jan 2016 to 05 July 2024.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>
See Also
Examples
#Download Bhavcopy from NSE
report = bhav1("01072021") # Download bhavcopy for 01 July 2021
Bhavcopy PR from NSE
Description
Bhavcopy PR from NSE
Usage
bhavpr(x)
Arguments
x |
numeric date format |
Details
Gets Bhavcopy PR from NSE for the given date.
Value
List of Bhavcopy PR for the given date.
Note
The date should be strictly numerical and mentioned in quotation mark, refer example.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>
See Also
Examples
## Not run:
# Equity Bhavcopy PR
library(nser)
report = bhavpr("01072021")
## End(Not run)
Get Bhavcopy for the present day from NSE and BSE
Description
Get Bhavcopy for the present day from NSE and BSE
Usage
bhavtoday(se = "NSE")
Arguments
se |
Stock Exchange either 'NSE' or 'BSE'. Default is 'NSE'. |
Details
Gets todays bhavcopy from NSE. The function tries to get the bhavcopy from two sources Old and New website of NSE.
Value
Todays's Bhavcopy.
Note
The date should be strictly numerical and mentioned in quotation mark.The present days Bhavcopy would usually available in the evening
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>, <https://www.bseindia.com/markets/marketinfo/BhavCopy.aspx>
See Also
Examples
## Not run:
#Todays NSE Equity Bhavcopy, the data would be available usually after 6.30 PM.
library(nser)
report = bhavtoday()
#Todays BSE Equity Bhavcopy
report = bhavtoday('BSE')
## End(Not run)
Daily data of a stock
Description
Daily data of a stock with six columns.
Usage
data(dailydata)
Format
Daily data of a stock with six column
- SYMBOL
SYMBOL of the stock
- OPEN
Opening price for the day
- HIGH
High price for the day
- LOW
Low price for the day
- CLOSE
Closing price for the day
- DATE
Date for the given day
Source
https://www.nseindia.com/
See Also
Examples
library(nser)
data(dailydata)
daytoweek(dailydata)
Convert Daily data of a stock to Monthly data
Description
Convert Daily data of a stock to Monthly data
Usage
daytomonth(x)
Arguments
x |
dataframe containing stock data with columns SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE. |
Details
Converts the Daily data of a stock to Monthly data.
Value
OHLC data in monthly format.
Note
The dataframe should contain six columns named SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.
Author(s)
Nandan L. Patil tryanother609@gmail.com
See Also
Examples
data(dailydata)
daytomonth(dailydata)
Convert Daily data of a stock to Weekly data
Description
Convert Daily data of a stock to Weekly data
Usage
daytoweek(x)
Arguments
x |
dataframe containing stock data with columns SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE. |
Details
Converts the Daily data of a stock to Weekly data.
Value
Dataframe with Weekly data.
Note
The dataframe should contain six columns named SYMBOL, OPEN, HIGH, LOW, CLOSE & DATE.
Author(s)
Nandan L. Patil tryanother609@gmail.com
See Also
Examples
library(nser)
data(dailydata)
daytoweek(dailydata)
Latest FII/DII data.
Description
Latest FII/DII data.
Usage
fdii()
Details
Get latest FII/DII data from Moneycontrol website.
Value
Dataframe containing FII/DII data.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.moneycontrol.com/stocks/marketstats/fii_dii_activity/index.php>
See Also
Examples
## Not run:
# The function may fail when accessed outside from INDIA.
library(nser)
fdii()
## End(Not run)
Futures and Options Bhavcopy from NSE
Description
Futures and Options Bhavcopy from NSE
Usage
fobhav(x)
Arguments
x |
numeric date format |
Details
Gets Futures and Options Bhavcopy from NSE for the given date.
Value
F&O Bhavcopy for the given date.
Note
The date should be strictly numerical and mentioned in quotation mark (refer examples). 'fobhav' can be used to download NSE bhavcopy from 1 Jan 2020 on wards.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>
See Also
Examples
## Not run:
report = fobhav("01072021") # Download F&O bhavcopy for 01 July 2021
## End(Not run)
Futures and Options Bhavcopy from NSE
Description
Futures and Options Bhavcopy from NSE
Usage
fobhav1(x)
Arguments
x |
numeric date format |
Details
Gets Futures and Options Bhavcopy from NSE for the given date.
Value
F&O Bhavcopy for the given date.
Note
The date should be strictly numerical and mentioned in quotation mark. 'fobhav' can be used to download bhavcopy from 1 Jan 2016 onwards.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/all-reports>
See Also
Examples
report = fobhav1("01072021") # Download F&O bhavcopy for 01 July 2021
Get F&O Bhavcopy for the present day
Description
Get F&O Bhavcopy for the present day
Usage
fobhavtoday()
Details
Gets todays Futures and Options bhavcopy from NSE.
Value
Todays's F&O Bhavcopy.
Note
The date should be strictly numerical and mentioned in quotation mark.The present days Bhavcopy would usually available in the evening.
Author(s)
Nandan L. Patil tryanother609@gmail.com
See Also
Examples
#Todays F&O Bhavcopy
library(nser)
try(stop(report = fobhavtoday()))
NSE Nifty Indices
Description
NSE Nifty Indices
Usage
nseindex()
Details
Live report of Nifty Indices
Value
A dataframe containing last price and per cent change of nifty indices.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www1.nseindia.com/live_market/dynaContent/live_watch/live_index_watch.htm>
See Also
bhavpr
bhav
fobhavtoday
nseopen
nselive
Examples
## Not run:
#Live status of Nifty Indices
library(nser)
nseindex()
## End(Not run)
Current and Upcoming IPO's on NSE.
Description
Current and Upcoming IPO's on NSE.
Usage
nseipo()
Details
List of upcoming and current IPO's on NSE gathered from Moneycontrol.
Value
A dataframe of IPO's on NSE.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.moneycontrol.com/ipo/ipo-snapshot/issues-open.html>
See Also
Examples
## Not run:
# NSE IPO's
library(nser)
nseipo()
## End(Not run)
NSE Live Market data
Description
NSE Live Market data
Usage
nselive(x = "n50")
Arguments
x |
"n50" and "fo" for nifty 50 and F&O. DEFAULT value is "n50". |
Details
Get live NSE market data of Nifty 50 and Futures & Options
Value
A dataframe with NSE Live market data.
Note
NSE pre-open market 09.00 hrs to 9.08 hrs (IST). Regular Trading Session 09.15 hrs to 15.30 hrs (IST)
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/market-data/live-market-indices>
See Also
bhavpr
bhav
fobhavtoday
nseindex
nseopen
Examples
## Not run:
# NSE Live market data for Nifty 50 stocks
library(nser)
nselive()
# Live market for F&O stocks
nselive("fo")
## End(Not run)
NSE Pre Open Market data
Description
NSE Pre Open Market data
Usage
nseopen(x = "n50")
Arguments
x |
"fo" for F&O stocks, "all" for all the stocks. Default is "n50" for NIFTY 50 stocks. |
Details
Get NSE Pre open market data.
Value
A dataframe with NSE Pre open market data.
Note
NSE market opening time is 9.00 AM (IST). The NSE pre market closes at 9.08 AM (IST).
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www1.nseindia.com/live_market/dynaContent/live_watch/pre_open_market/pre_open_market.htm>
See Also
Examples
## Not run:
# NSE Pre market open data of Nifty 50 stocks
library(nser)
nseopen("n50")
# Pre open market data of F&O stocks
nseopen("fo")
## End(Not run)
Treemap for Nifty50 and F&O Securities
Description
Treemap for Nifty50 and F&O Securities
Usage
nsetree(x = "n50")
Arguments
x |
"n50" for NIFTY 50 Securities and "fo" for Futures and Options Securities. |
Details
Plot treemap representing per cent change in 'NIFTY50' and 'F&O' stocks.
Value
treemap A Treemap of recent percent change in value of securities.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/market-data/live-market-indices>
See Also
Examples
## Not run:
# Treemap of NIFTY50 securities
library(nser)
nsetree()
# Treemap of FO securities
library(nser)
nsetree('fo')
## End(Not run)
Option Chain of NSE BANKNIFTY (current expiry date).
Description
Option Chain of NSE BANKNIFTY (current expiry date).
Usage
optbanknifty()
Details
Option chain of BANKNIFTY for the current expiry.
Value
A dataframe containing option chain of NSE BANKNIFT current expiry date.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/option-chain>
See Also
optnifty
bhavtoday
nselive
nsetree
nseipo
Examples
## Not run: # Example: BANKNIFTY option chain
optbanknifty()
## End(Not run)
Option Chain of NSE Nifty 50 (current expiry date).
Description
Option Chain of NSE Nifty 50 (current expiry date).
Usage
optnifty()
Details
Option chain of NIFTY 50 for the current expiry.
Value
A dataframe containing option chain of NSE Nifty 50 for current expiry date.
Author(s)
Nandan L. Patil tryanother609@gmail.com
Source
<https://www.nseindia.com/option-chain>
See Also
optbanknifty
bhavtoday
nselive
nsetree
nseipo
Examples
## Not run: # Example: NIFTY 50 option chain
optnifty()
## End(Not run)