Dynamic website that responds to API PUSH

I’m working on a project in wich I have a a website that will be on a screen and a seperate script running on a mobile device will send API PUSH commands throught python with specific ids that will then play midi files on the website.

I’ve tried researching about this specific topic and I can’t seem to find an answer for this specific problem, I’m well versed in python but html is not my strong suit.