{"id":16317074,"url":"https://github.com/simatwa/smartbetsapi","last_synced_at":"2025-07-15T13:13:47.455Z","repository":{"id":65374575,"uuid":"590059131","full_name":"Simatwa/smartbetsAPI","owner":"Simatwa","description":"Soccer prediction package fitted with REST API","archived":false,"fork":false,"pushed_at":"2024-04-13T16:46:59.000Z","size":1065,"stargazers_count":7,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-14T11:16:48.550Z","etag":null,"topics":["api","betting","fastapi","football-analysis","football-api","football-app","football-data","gambling","predictions","soccer"],"latest_commit_sha":null,"homepage":"https://smartbetsapi.onrender.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simatwa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-17T15:12:32.000Z","updated_at":"2024-05-06T10:26:49.976Z","dependencies_parsed_at":"2024-05-06T10:26:49.431Z","dependency_job_id":"f140fa6d-1ab8-4f57-9c7c-a7401749faaa","html_url":"https://github.com/Simatwa/smartbetsAPI","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":"0.11904761904761907","last_synced_commit":"5148fd051bb51b42a5290426b24d11adac682cf5"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2FsmartbetsAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2FsmartbetsAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2FsmartbetsAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simatwa%2FsmartbetsAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simatwa","download_url":"https://codeload.github.com/Simatwa/smartbetsAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245022553,"owners_count":20548556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","betting","fastapi","football-analysis","football-api","football-app","football-data","gambling","predictions","soccer"],"created_at":"2024-10-10T22:06:31.522Z","updated_at":"2025-07-15T13:13:47.443Z","avatar_url":"https://github.com/Simatwa.png","language":"Python","funding_links":["https://www.paypal.com/donate/?hosted_button_id=KLNYKSGUXY8R2"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003esmartbetsAPI\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/Simatwa/smartbetsAPI\"\u003e\u003cimg alt=\"Github\" src=\"https://img.shields.io/static/v1?logo=github\u0026color=blueviolet\u0026label=Test\u0026message=Passing\"/\u003e\u003c/a\u003e \u003ca href=\"LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/static/v1?logo=GPL\u0026color=Blue\u0026message=GPL-v3\u0026label=License\"/\u003e\u003c/a\u003e \u003ca href=\"https://pypi.org/project/smartbetsAPI\"\u003e\u003cimg alt=\"PyPi\" src=\"https://img.shields.io/pypi/v/smartbetsAPI?color=green\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Black\" src=\"https://img.shields.io/static/v1?logo=Black\u0026label=Code-style\u0026message=Black\"/\u003e\u003c/a\u003e \u003ca href=\"#\"\u003e\u003cimg alt=\"Accuracy\" src=\"https://img.shields.io/static/v1?logo=accuracy\u0026label=Accuracy\u0026message=55%\u0026color=yellow\"/\u003e\u003c/a\u003e \u003ca href=\"#\"\u003e\u003cimg alt=\"Passing\" src=\"https://img.shields.io/static/v1?logo=Docs\u0026label=Docs\u0026message=Passing\u0026color=green\"/\u003e\u003c/a\u003e \u003ca href=\"#\"\u003e\u003cimg alt=\"coverage\" src=\"https://img.shields.io/static/v1?logo=Coverage\u0026label=Coverage\u0026message=100%\u0026color=yellowgreen\"/\u003e\u003c/a\u003e  \u003ca href=\"#\" alt=\"progress\"\u003e\u003cimg alt=\"Progress\" src=\"https://img.shields.io/static/v1?logo=Progress\u0026label=Progress\u0026message=95%\u0026color=green\"/\u003e\u003c/a\u003e  \u003ca href=\"https://pepy.tech/project/smartbetsapi\"\u003e\u003cimg src=\"https://static.pepy.tech/personalized-badge/smartbetsapi?period=total\u0026units=international_system\u0026left_color=grey\u0026left_text=Downloads\" alt=\"Downloads\"\u003e\u003c/a\u003e\u003c/p\u003e\u003cbr\u003e\n \n \u003e \"Punter's choice\"\n\n Worldwide soccer-matches predictor with Fast-API and a package for integrating the scripts in your own [Python](https://python.org) code.\n\n\u003e [!IMPORTANT]\n \u003e This package, despite being refactored several times, does not fully adhere to the [PEP-8](https://peps.python.org/pep-0008/) or any other standard style guide for Python. It was my first contribution to PyPI and the Python ecosystem at large. As a beginner, **getting the work done was my priority**, which I undoubtedly achieved. Otherwise, thank you to the over 20,000 programmers for trusting my poorly written code that exceeds your expectations.\n\n \u003e [!WARNING]\n \u003e Expect 3-lettered variable names without obvious meanings, some logs with little sense, dubious logic, poor naming conventions, less meaningful comments, and much more than one might expect from a novice coder.\n.\n\n ## Features\n\n - REST-API\n - Script integration (package)\n - Non-ML\n\n ## Installation and usage\n\n ### Installation\n\n*Python 3.9+* is required for this script to be fruitful to you. \n- Installing through pip is always the most preferred way:\n\n ```sh\n pip  install smartbetsAPI\n \n ```\n\n - For those who like enjoying the **latest** releases from [Github](https://github.com) like [me](https://github.com/Simatwa), rather than  waiting for the next one:\n\n ```sh\n pip install git+https://github.com/Simatwa/smartbetsAPI.git\n\n ```\n\nTo install it alongside `REST-API`  dependencies simply run:\n\n```sh\npip install \"smartbetsapi[api]\"\n```\n\n### Usage\n\n1. Terminal\n\n Running `$ smartbetsAPI \u003ctoken/password\u003e`  will fire up the FastAPI server with the following default configurations.\n\n\u003ctable align=\"center\"\u003e \n\u003cthead\u003e\n\u003ctr\u003e\u003cth\u003eCommand        \u003c/th\u003e\u003cth\u003eDefault  \u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003ePort           \u003c/td\u003e\u003ctd\u003e8000     \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eUsername       \u003c/td\u003e\u003ctd\u003eAPI\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eFilename       \u003c/td\u003e\u003ctd\u003eNone     \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003elevel (Logging)\u003c/td\u003e\u003ctd\u003e20       \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003ehost           \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003edebug          \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eno-net         \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003elog            \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003ecolorize       \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003egui (Termux)   \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n- For instance :\n\n```sh\n $ smartbetsAPI mypass9876\n\n```\n\n\u003e [!TIP]\n\u003e `Docs` will be available at : http://localhost:8000/v1/docs\n\u003e `Redoc` will be available at : http://localhost:8000/v1/redoc\n\nHere is an example of a [simple program](examples/bet_at_rest_api_level.py) that makes prediction using the REST API.\n\n![api running](assets/api_running.gif)\n\n\u003e [!Note]\n\u003e Reinstall with `sudo` privileges if `smartbetsAPI` command can't be found.\n\n\u003e Example predicting using REST API\n\n```py\nfrom smartbets_API import predictor\npredict = predictor('http://localhost:8080','password')\nbets=predict.get_predictions('Arsenal','Manchester')\nprint(bets)\n#Output\n#(True, {'choice': 55.56, 'g': 14.0, 'gg': 80.0, 'ov15': 80.0, 'ov25': 65.0, 'ov35': 55.0, 'pick': 'ov15', 'result': '1'})\n```\n\n\n* For more information you can run `smartbetsAPI -h` \n\n\n2. Importing Package\n\nModule `predictor`  provides two ways of interacting with it at the programming level, based on the `data-type` in which the teams have been packed and parsed to it:\n\n* Using `predictorL` object which accepts *teams* (**List** data-type).\n\u003e For [example](examples/predict_using_list.py):\n\n```py\n#!/usr/bin/env python3\nfrom smartbets_API.predictor import predictor\n\nteams = [\n    \"Napoli\",  # Home team (index [0])\n    \"AC Milan\",  # Away team (index [1])\n]\n# Instantiating predictor\npredict = predictor()\n\n# Using predictorL object to handle teams (List data-type)\npredictions = predict.predictorL(teams)\n\n# Display info\nprint(predictions)\n\n#Output\n#{'g': 8.0, 'gg': 65.0, 'ov15': 70.0, 'ov25': 40.0, 'ov35': 30.0, 'choice': 60.0, 'result': '2', 'pick': 'ov15'}\n\n```\n\n* Using `predictorD` object which takes *teams* (**Dictionary** data-type):\n\u003e For [example](examples/predict_using_dict.py):\n\n```py\n#!/usr/bin/env python3\nfrom smartbets_API.predictor import predictor\n\nteams = {\n    1: \"Manchester City\",  # 1 for home-team\n    2: \"Liverpool\",  # 2 for away-team\n}\n\n# Instantiating predictor\npredict = predictor()\n\n# Using predictorD object to handle teams (Dictionary data-type)\npredictions = predict.predictorD(teams)\n\n# Display info\nprint(predictions)\n\n#Output\n#{'g': 8.0, 'gg': 65.0, 'ov15': 60.0, 'ov25': 45.0, 'ov35': 30.0, 'choice': 56.16, 'result': '1', 'pick': 'gg'}\n\n```\n\n- The output initials are explained in the table below.\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003cth\u003eParameter  \u003c/th\u003e\u003cth\u003eFunction                                                 \u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eg          \u003c/td\u003e\u003ctd\u003eGoal-average of the two teams                              \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003egg         \u003c/td\u003e\u003ctd\u003eProbability of both teams to score                         \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eov15       \u003c/td\u003e\u003ctd\u003eProbability of having more than 2 goals                    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eov25       \u003c/td\u003e\u003ctd\u003eProbability of having more than 3 goals                    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eov35       \u003c/td\u003e\u003ctd\u003eProbability of having more than 4 goals                    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003echoice     \u003c/td\u003e\u003ctd\u003eProbability of the specified \u0026#x27;result\u0026#x27; to occur            \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eresult     \u003c/td\u003e\u003ctd\u003eThe most suitable outcome from [1,1x,x,2x,2]                  \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003epick       \u003c/td\u003e\u003ctd\u003eThe most suitable outcome from [1,1x,x,2x,2,gg,ov15,ov25,ov35]\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003e **Note** \n  - Probabilities are in percentange (%)\n\n#### Further info \n\nThe `predictor` _class_ accepts multiple parameters that includes :\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003cth\u003eParameter       \u003c/th\u003e\u003cth\u003eFunction                                              \u003c/th\u003e\u003cth\u003eDefault  \u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003einclude_position\u003c/td\u003e\u003ctd\u003eInclude team\u0026#x27;s league ranking in making predictions     \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003elog             \u003c/td\u003e\u003ctd\u003eLog at api default log\u0026#x27;s path                           \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003elevel           \u003c/td\u003e\u003ctd\u003eLogging level                                           \u003c/td\u003e\u003ctd\u003e0        \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003efilename        \u003c/td\u003e\u003ctd\u003eLog to the filename specified                           \u003c/td\u003e\u003ctd\u003eNone     \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003ecolor           \u003c/td\u003e\u003ctd\u003eColorize the logs                                       \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003egui             \u003c/td\u003e\u003ctd\u003eRun with some Graphical interface notifications (Termux)\u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eapi             \u003c/td\u003e\u003ctd\u003eRun with api-server\u0026#x27;s configurations                    \u003c/td\u003e\u003ctd\u003eFalse    \u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nThe two predictor's object (`predictorD`, `predictorL`) accepts two parameters i.e.\n* **teams** - Required\n* **net** - Source of team's data - Default `True` (Online)\n\n## Source of data\n\nTeam performances are sourced from [Soccerway](https://int.soccerway.com) after retrieving the *uri* from [Google](https://www.google.com).\n\n\u003e **Warning** Copyright related issues are liable to the user of this script!\n\n## Disclaimer\n\nThis project aims to help *punters* and *bookmarkers* to make informed and well researched soccer-predictions. Nevertheless, it is important to specify that 100% accuracy does not exist and smartbetsAPI can't guarantee the accuracy of the predictions. It is therefore your responsibility to trust the information generated by smartbetsAPI after evaluating its reliability. As the [creator](https://github.com/Simatwa), I **CANNOT** be held responsible for any loss of capital that may occur during the use of this program.\n\n## Contributing and Support\n\n### Contributing\n\nContributions are always welcome! \u003cbr\u003e\nPlease take a look at the [Contribution guidelines](CONTRIBUTING.md). \u003cbr\u003e\nFeel free to open an [Issue](https://github.com/Simatwa/smartbetsAPI/issues) or to [Fork](https://github.com/Simatwa/smartbetsAPI/fork) this repo.\n\n### ToDo\n\n- [ ] Upgrade to Machine learning\n- [ ] Improve algorithim's accuracy\n- [ ] General code improvements\n- [ ] Fix bugs\n\n### Support \n\nConsider donating to this project if you find it useful:\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=KLNYKSGUXY8R2\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?logo=paypal\u0026message=Donate\u0026color=blueviolet\u0026label=Paypal\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### API Health Status\n\n| No. | API | Status |\n|--------|-----|--------|\n| 1. | [On-render](https://smartbetsapi.onrender.com)  | [cron-job](https://lfx48519.status.cron-job.org) |\n\n## Credits\n\n- [x] [Soccerway](https://int.soccerway.com)\n- [x] [Google](https://www.google.com)\n- [x] [Python.org](https://python.org)\n\n## Special Thanks\n\n* [x] [victhepythonista](https://github.com/victhepythonista)\n* [x] YOU.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatwa%2Fsmartbetsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimatwa%2Fsmartbetsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimatwa%2Fsmartbetsapi/lists"}