How to get events from accelerometer

Yes, it is plugged into the I2C and I can get measurements from it using GET requests. But polling it all the time doesn’t work for me, I’d rather receive an event.