I Built a Sports Betting Bot with OddsJam and ChatGPT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello world it's siraj and I bet one thousand dollars on the Seattle Kraken that's an ice hockey team a part of the NHL because my sports betting bot I call odds GPT Powers by oddsjam told me to and before we get into it I wanted to quickly tell you about oddsjam oddsjam is the best sports betting software available I love data you love data and oddsjam loves data with over 190 Sports books and real-time data feeds oddsjam is able to identify inefficiencies in the market that you the user can exploit ausjam makes you a profitable Sports better by using the same techniques that investors and Traders use to beat the stock market the ozjam Arbitrage tool allows you to make risk-free money by identifying opportunities where you can bet on both sides of the market and make a profit no matter what they also have their positive expected value tool which identifies bets where one sports book has made a mistake when setting their price compared to the rest of the market ozgm makes it easy to pay for your next dinner or vacation with your betting profits and they offer both a seven day free try file in a 90-day money-back guarantee because they know their product works if you want to give them a try use code Suraj 20 to get 20 off your subscription using the link below what are the most profitable plus EV that stands for positive expected value Sports bets to make today for the NHL and it will basically what it's doing is it's using a headless browser script don't worry if you don't understand this we're going to go through all this it's using a headless browser script in JavaScript to pull data from oddsjam about which are the sports bets that they are making using all their internal tools and then it's going to pull the top five EV vets as you can see as an ordered list and explain it very simply just like that now once we have that we can say okay great how do people feel about the Seattle Kraken versus the Dallas Stars matchup today and what it's going to do and this is one of my favorite parts of this is it is going to pull this data from Twitter now you may or may not know that Elon made Twitter 100 a month to pull tweets from for hobbyists and we just do not want to pay a hundred dollars a month so we are going to use a scraping tool to pull that data from Twitter and no apologies Elon and that's what you were saying here it's going to pull that data from Twitter and it's going to tell us that today the this is the percentage likelihood that people feel that the Kraken are going to win and the last prompt I'm going to give it for this demo before we get started building is How likely is it that we'll pick a player from the Seattle Kraken Ryan Donato is going to get an injury this season and what it's doing here is it's pulling a custom historical data set of all of Ryan Donato's uh features for each game like his number of injuries number of wins number of you know scores all that stuff and it's going to in real time with what's called in context learning make a prediction using that data in this tutorial we're going to start with a very simple bot version one that's a Twitter sentiment bot it's just gonna pull data from Twitter that's it in the second version we're gonna add to it the ability to crawl the web for positive expected value Bets with oddsjam so plus EV web crawler and in the third and last version we're going to add the ability to pull all this real-time historical Sports data from the web and then make custom predictions using that data like I'd ask is this player injured or How likely is this going to happen and it's going to use historical data to do that and this is going to happen for any sport not just NHL that's just what I picked for this but it's going to be working for any sport the first dependency is no.js that's going to let us build web applications the second one is mongodb that's to store data the third one is open AI for a natural language interface to talk to our sports betting bot then we have SNS scrape that's going to let us scrape data from Twitter in Python for free then we have oddsjam this is a sports betting platform that has all sorts of tools for making Sports bets and we can pull data from that use using Puppeteer Puppeteer is a JavaScript that's able to browse the web without having a graphical user interface so it can just go to websites click on things click on buttons fill in form data automatically which is exactly what we want in the last dependency that we're going to have is stats head and stats head is a database of all this historical Sports data of course we're going to use chat GPT and Bing to make these predictions those are the the last two so first we're going to prompt Chad GPT and we're going to say to chat GPT you are a professional programmer with Decades of experience writing code in every known programming language what is this called This is called role prompting and role prompting can give us better results than just straight up asking it the question write me a short python script that pulls the latest 100 tweets from Twitter how should this be done show me step by step remember that phrase always helps with the outputs of these GPT models it's going to give us all that python script data it's going to say pip install SNS scrape and so what we can do is we can open up a collab and I've got this collab that's pre-filled for us right here I'm sharing it in the video description and what this collab is going to do is it's going to do exactly what told us to do it's going to uh make a query I guess I chose Elon Musk for this query pretty hilarious and it's going to import the modules it's going to pull the tweets convert it to a pandas data frame that's an Excel spreadsheet that we can you know export a CSV file look at all these real-time tweets about the Seattle Kraken uh let's go crack in a lot of these are positive right and we can use sentiment analysis with the Vader sentiment library to analyze these so I just wanted to show you first of all a free way to pull data from Twitter for free and it's only a few lines of python code okay so once we have that the next thing we're going to want to do is we're going to want to find our own Chad GPT clone repository that we can insert this Twitter sentiment analysis code into so we can converse with it in natural language and it could do this python code for us we don't just have to manually do it in a colab every time so to do this we're going to use Bing and why Bing inside of Chad GPT well because Bing is connected to the internet so we'll ask Bing show me a chat bot UI repository because we want a graphical user interface from GitHub for interacting with chat GPT we're going to pick this one called chat GPT clone by Danny Avila so this one's great because it's got chat GPT and Bing uh both so it's got access to both of them and we can run this locally on our machine we can put it on our own server we can store it in our own database it's just for us right this is just going to be a thing for us and we're going to customize it to be not just a general purpose GPT but specifically a sports betting bot so let's go into this there's a client folder there's a public API folder so both of them work together it's got a little bit of jsx a little bit of HTML here and there and CSS okay so let's set this thing up so to set this up we're going to go into the readme we're going to go into the getting started section we're going to I'm on a Mac I'm going to go to Mac install and it's going to tell us what requirements we're going to need we need to get our openai API key then we're going to find it right here on platform.openai.com we're going to need our Bing token and our Bing access token in order to do that we need to go to chat.bing.com to pull up Bing then we'll go to tools developer developer tools and then we're going to go to under storage under application and then storage we'll see cookies and then bing.com and under that we'll see this underscore you name and that's going to give us our Bing token and we're going to need that to add to our DOT EnV file and then we need to go to mongodb.com and this is going to connect us to our own database so we'll sign into mongodb if you haven't signed in create your own account and we'll sign in with Google or you know whatever your preferred login method is once we sign in it's going to ask us to create a database and we can do that by going to create and we'll click on you know whatever your closest database is we will click on create cluster and then we're going to take this connection string and we're going to copy it to our DOT EnV file so it connects that's really all we have to do and once we've done that we can just run it by running npm run and it'll open up for us just like that we can click on Bing we can run chat GPT queries whatever we want we can just run just like that from our local host and upload it to our own server it's running on our own database everything's stored and we it's not going to forget any of the bets that we ask him now that we have our own custom version of a chat GPT clone running locally we can start integrating information from the web we can start integrating our Twitter sentiment analysis code into it we can start integrating a live positive expected value bets from the web from this website oddsjam okay so ozjam is great there's a great way to get all these positive expected value bets if there's a single team that we want to know about let's say click on NHL and then we'll just pick one of these articles that they've got you can see that they have made bets about that team so they've got data on here and what we want to do is we want to pull this data into our GPT and it's just going to tell us what those bets are based on what oddsjam says so how do we do that Puppeteer is one of the best JavaScript libraries to do that you can just say you know log into this website and then type into a search box set the screen size click on the first result all that stuff so we have we can just build our own headless browser script and I did that right here in Puppeteer and I can show you exactly how it works so let's start off by opening up a browser and then going to a new page and that page is going to be oddsjam.com NBA slash articles now we can replace NBA with any sport we can say NHL we can say you know MLB we can say football we can say any sport right and once we do that it's going to give us a list of articles and all those articles are going to be URLs for every single article right it's going to run regex on all those articles and then it's going to return the top article the latest article and then it's going to give us that URL and we'll ask our Bing version tldr this and what Bing is going to do is it's going to crawl this article and it's going to tell us exactly what the optimal Sports bet is going to be and so now we can move to custom model training how can we use historical Sports data to make bets that's a really interesting idea and I found this website called stats head and it's got real-time updated data and you've got all these features for this data you can just export this data as a CSV file and boom it's right there here's this uh MLB stat head scraping notebook that I found by Jeezy wabowski on GitHub where using selenium another headless browser script it's going to browse the web it's going to log into stat head with its username and passport and then it's going to get that data for the MLB but we can switch this from baseball to NHL or any other sport for batting data and once we get that real-time data from stat head we can export it as a CSV and then feed that to our model as a by prepending The Prompt but we say given this data find the make a prediction and it's not going to build a neural network in real time it's just going to use in context learning to build that prediction so that's it for this tutorial if you have any questions ask me in the comments section I will be responsive the code for everything is going to be in the video description and let's come back in 24 hours and see if I won the BET looks like I won the BET thanks all it's GPT and thanks odds Jam subscribe if you like the video hit the like button and for now I've got to make some really interesting Auto gpts so thanks for watching
Info
Channel: Siraj Raval
Views: 102,867
Rating: undefined out of 5
Keywords:
Id: BaSgUREIPkc
Channel Id: undefined
Length: 12min 41sec (761 seconds)
Published: Tue May 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.