Skip to content

Created a working chatbot around the whatsapp platform which interacts with user by taking the name of a stocks as input and brings current price at output. It was build using Twilio, Python, Flask, and Market Stack

Notifications You must be signed in to change notification settings

karan19100/Whatsapp-Stock-Market-Chat-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whatsapp-stock-market-chatbot

Table of Content

  1. Overview
  2. Learning-Objective
  3. Technologies-used
  4. Technical-aspect
  5. Design and Artitecture
  6. installation
  7. Steps to write python flask app
  8. Output

Overview :-

we created a bot around the whatsapp platform which interact with users and used twilio which is used to utilize the the service because it offers an API in whatsapp and whenever we create bot we always need to send the response back for the given message and for that we used python language and flask framework.

Learning Objective :-

The following points were the objective of the project . If you are looking for all the following points in this repo then i have not covered all in this repo. I'm working on blog about this mini project and I'll update the link of blog about all the points in details later . (The main intention was to create an end-to-end chatbot application. )

  • Setting up whatsapp chastbot.
  • Integrate with twillio API.
  • Setting up Webhooks securely using flask.
  • Wrtitng python handlers.
  • Fetching stock data with Marketstack.

Technologies Used :-

[ ]

Technical Aspect :-

  • created a bot around the whatsapp platform which interact with users
  • used twilio which is used to utilize the the service because it offers an API in whatsapp.
  • Twilio can only send data over https for the security stacke.
  • so to overcome this we used Ngrok, it help us to create an HTTP turnel, it basically turnels the https traffic to our local host.
  • whenever we create bot we always need to send the response back for the given message and for that we used python language and flask framework.
  • flask app created now will help use to talk to markert stack API.

Why whatsapp Bot ?

  • 2 Billion users base.
  • Most popular messaging app.
  • end to end encrytion of security.
  • easy to integrate for developers.
  • backed by facebook for buisness users.

what are webhooks ?

  • HTTPS and API endpoints, which recieves data in json format or any format which is supported by HTTPS.
  • Recieve HTTP request over TLS/SSL.
  • call the revelant handlers.
  • performed Buisness Logic.
  • Returns the response.

why python flask for webhooks ?

  • few lines require to write webapp.
  • Easy to understand.
  • Quick to setup and get going.
  • very light weight
  • can be easily extended with more packages as app evolves.

why market stacks ?

  • easy to get started.
  • includes 72 stock exchanges.
  • Light weight json API.
  • Extensive documentation.
  • Easy support for python.

Design and Architecture :-

1. Whatsapp - Twilio

  • User sends message to twilio provided sandbox url & twilio recieves the message.

2. Twilio - python flask App

  • calls thew registered webhooks and sends data & flaskapp recives the Requerst.

3. python flask app - Marketstack

  • parse data and gets stock data from Marketstack & marketstack API returns the stack price data.

Installation :-

  • Clone this repository and unzip it.
  • After downloading, cd into the flask directory.
  • Begin a new virtual environment with Python 3 and activate it.
  • Install the required packages using pip install -r requirements.txt
  • Execute the command: python app.py.

Steps to write python flask app :-

  • Installed python
  • created the virtual environment
  • created a requirement.txt files for dependencies.
  • Installed flask
  • Installed requests (useful when we integrate market stack)
  • installed twilio (for interacting with twilio)

Output

Made with  ❤️ by Karan Shah

About

Created a working chatbot around the whatsapp platform which interacts with user by taking the name of a stocks as input and brings current price at output. It was build using Twilio, Python, Flask, and Market Stack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages