First, clone the repository to your local machine:
git clone https://github.com/amity29/zerodha_api.git
Install the requirements:
pip install -r requirements.txt
Create .env file in the settings.py directory
Set up following environment variable:
SECRET_KEY =
DEBUG =
URL =
REDIS_HOST =
REDIS_PORT =
REDIS_PASSWORD =
CHROMEDRIVER_PATH =
Finally, run the development server:
python manage.py runserver
The API endpoints will be available at 127.0.0.1:8000 by default.
http://{server}:{port}/scrape
This endpoint will start the Scrapping in the background using thread and store the data in redis db. You can also run the scraping for a specific date by providing a optional query parameter date with the url
http://{server}:{port}/scrape?date={YYYY-MM-DD}
http://{server}:{port}/list
This endpoint will serve the data stored in redis db in the JSON format. You can also search for a specific name by providing a optional query parameter search with the url
http://{server}:{port}/list?search={name}
http://{server}:{port}/delete
This endpoint will delete all the scraped data from redis db.