For real-time tracking you have two options.
Setup QuantumView notifications for shipper to send to a mailbox that you monitor programmatically. Parse the emails to update your order status. I believe this is how Shopify and other e-commerce providers send out "order delivered" emails.
UPS now has Webhooks as a paid option on their developer portal https://developer.ups.com