This is an easily accessible RESTFUl api written with Flask. The main goals was to provide a service where users can get bout information and stricking statistics on UFC events. Coupled with the API is a fight prediction module written with Scikit Learn. It's a fairly straight foward model, it uses linear regression to calculate whether or not a fighter would win.
I used a webscrapper to scrape information of the ufcstats page. I only grabbed around half of the most recent events, so there are going to be some events that are missing. This info is as accurate as that page. Aside from that it is accurate.
I used a multitude of libraries and frameworks to complete this. The most noteable are Flask for the webservice framework, Beautiful Soup for the creating the webscrapper, and scikit-learn. The front end uses the Bulma CSS framework.
These endpoints will return a JSON encoded string. If you're using Javascript, you can issue an XMLHttpRequest, then
var json_obj = JSON.parse(payload);
You can issue a GET request to the events endpoint:
curl -s --request GET --header Content-Type: application/json --write-out \n%{http_code}\n http://13.52.239.45/api/events/all
Specifying all will grab all the events with their corresponding name, location, date, and event id.
The event endpoint has the form
/api/event/id
The json returned has two keys, bouts and event data.
You can get the latest event predictions from the predictions endpoint
/api/predictions
- prediction route with 2 fighters (started)
- fighters endpoint