Command-Line Interface
aynse
comes with a powerful command-line interface. Simply type aynse --help
to explore all available options.
aynse --help
Download Bhavcopies
aynse bhavcopy --help
Download today's bhavcopy: (Works only after market hours)
aynse bhavcopy -d /path/to/dir
Download bhavcopy for a specific date:
aynse bhavcopy -d /path/to/dir -f 2024-01-01
Download all bhavcopies between a date range:
aynse bhavcopy -d /path/to/dir -f 2024-01-01 -t 2024-01-31
Download full bhavcopies with delivery trade quantity:
aynse bhavcopy -d /path/to/dir -f 2024-01-01 -t 2024-01-31 --full
Download index bhavcopies:
aynse bhavcopy -d /path/to/dir -f 2024-01-01 -t 2024-01-31 --idx
Download derivatives bhavcopies:
aynse bhavcopy -d /path/to/dir -f 2024-01-01 -t 2024-01-31 --fo
Download Historical Stock Data
aynse stock --help
Download historical stock data:
aynse stock -s RELIANCE -f 2024-01-01 -t 2024-01-31 -o RELIANCE-Jan.csv
Download Historical Index Data
aynse index --help
Download historical index data:
aynse index -s "NIFTY 50" -f 2024-01-01 -t 2024-01-31 -o NIFTY-Jan.csv
Download Futures & Options Data
aynse derivatives --help
Download stock futures data:
aynse derivatives -s RELIANCE -f 2024-01-01 -t 2024-01-31 -e 2024-01-25 -i FUTSTK -o file_name.csv
Download index futures data:
aynse derivatives -s NIFTY -f 2024-01-01 -t 2024-01-31 -e 2024-01-25 -i FUTIDX -o file_name.csv
Download stock call options data:
aynse derivatives -s RELIANCE -f 2024-01-01 -t 2024-01-31 -e 2024-01-25 -i OPTSTK -p 2800 --ce -o file_name.csv
Download index put options data:
aynse derivatives -s NIFTY -f 2024-01-01 -t 2024-01-25 -e 2024-01-25 -i OPTIDX -p 21000 --pe -o file_name.csv