A free API providing machine-learning-driven product recommendations for Food and Beverages SMEs. Clients upload their sales CSV and the service combines it with public event data from Ticketmaster to suggest what to sell during upcoming events.
- Free to use with no authentication or billing
- Upload client-specific sales data via CSV
- Automatically train an XGBoost model using event data from Ticketmaster API
- Receive product recommendations for future events
- Install dependencies:
pip install -r requirements.txtorpython -m pip install -r requirements.txt - Set up environment: Create a
.envfile withEVENT_API_KEY=your_ticketmaster_api_key - Run the server:
uvicorn main:app --reload
POST /upload-csv– Upload a CSV file to preview its data (returns row count and first 5 rows)POST /train-model– Upload a CSV file, provideproduct_var_nameanddate_var_nameas form data, to train the XGBoost modelPOST /predict-recommendation– Upload a CSV file, provideproduct_var_nameanddate_var_nameas form data, to get product recommendations for upcoming eventsPOST /delete-models-dir– Delete the localmodels/folder (removes trained model and translators). Use this if you want to clear the cached model and force retraining.
No API key or authentication is required for the endpoints.
Sales data CSV should have columns including:
Item(or specified product column): The product identifierTransaction Date(or specified date column): The date of the transaction- Other features like
Quantity,Price Per Unit,Total Spent,Payment Method,Location
The API fetches event data from Ticketmaster and enriches the data for training and prediction.
- The model is trained per request and saved in the
models/directory. - Uses Ticketmaster Discovery API for event data; ensure your API key is valid.
- For production, consider persistent storage and error handling improvements.