callmevojtko / Recommended-Bets-By-Email-MLB

An advanced machine learning model utilizes a Random Forest Regressor to generate betting recommendations for Major League Baseball (MLB) games.
MIT License
17 stars 5 forks source link

can't get Project working. #4

Open user506671 opened 1 year ago

user506671 commented 1 year ago

Hi, i tryed to use your Projekt but can't get it work. find out your file to start is script.py. the file api.py is not used anyway if im right.

but the fetch_data_from_api() function is asking for an API_LINK i don't now. what does load_dotenv() do? and where the hell do i put my API Key. ^^"

Sorry can you help out with this informations? Thanks.

SoccerCashUK commented 11 months ago

Hi i also got problem I have added the API key and i get this error Fetching data from API... An error occurred: Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?

callmevojtko commented 11 months ago

Hi everyone,

I updated the README and further clarified the instructions. Was my bad, let me know if you have any issues still getting it to work.

How to Use

  1. Create an account with The Odds API to get an API key. Store your API key in a .env file as API_KEY = . The API key is then used as an argument to the fetch_data_from_api() function in the script.

  2. Once you have your API key, you can paste this API link in your browser: https://api.the-odds-api.com/v4/sports/baseball_mlb/odds/?regions=us&markets=spreads&bookmakers=fanduel,draftkings,barstool&oddsFormat=american&apiKey=**[INSERT YOUR API CODE HERE]** Note: Please see the Odds API docs for more info here

  3. Obtain credentials for Gmail API. These credentials should be stored in a credentials.json file in the root directory of the project. Read more on setting up the Gmail API with Python here

  4. In your .env file, add a variable BET_EMAIL and use the email that is authorized with Gmail API.

  5. Replace msg["To"] = "YOUR_EMAIL_HERE" on line 247 with the email you want to receive the recommendations to.

  6. Once the above prerequisites are completed, you can run the main() function to fetch the betting lines, generate recommendations, and send an email with the recommendations to a specified recipient.