Otto Radio changes the way you listen to talk radio by curating playlists of audio stories personalized to your interests. You can get your own front page of news read to you and discover podcasts you’ll love — all with the push of a button. And now it’s easier than ever for Uber riders to keep up-to-date while they’re on the go with our Uber Trip Experience API integration.

To activate the Trip Experience, simply connect the two apps and the next time you request a ride with Uber, a playlist of news stories and podcasts perfectly timed to your trip will be waiting for you in your Otto Radio. No more wasted commutes and frustrating traffic jams. No more searching for something to read on your phone randomly. Otto Radio turns the time you spend on the go into a chance to learn, be entertained and stay informed about the things you care about most.

Otto Radio is a compelling example of how an app can leverage the Uber Trip Experiences API to differentiate their offering by giving users personalized podcasts and news timed to their ride.

Otto Radio crafts a truly personalized listening experience by analyzing a vast amount of data–whether expressed explicitly through your interest selections, implicitly based on how you interact with content or by matching you with content that other listeners with similar tastes have enjoyed. It also considers your travel patterns throughout the day so it can prepare the right amount of stories to cover your travel times. Since Otto Radio’s launch, user engagement has been incredibly strong, with each user tuning in to Otto Radio for ~40 minutes daily on average.

Bringing the Otto Radio Experience to Uber

The integration started with a natural product story — leveraging Otto Radio’s content curation capability to enrich the tens of billions of minutes spent in Uber rides. Otto Radio’s value proposition of delivering personalized audio news and podcasts with the push of a button is further enhanced thanks to the rich context offered by the Uber Trip Experiences API such as destination, pickup location, travel time, and UberPool status, if applicable. By closing the loop from making a ride request to streaming radio, Uber’s Trip Experience API boosts Otto Radio’s ability to deliver productive, educational and entertaining audio to more people on the go.

Implementation Details

Otto leverages multiple facets of the Trip Experiences API, but the core integration is facilitated by webhooks. Any time there is a new Uber trip, or a trip status changes, the Otto server gets an HTTPS POST to our webhook. Once this request comes in, we use the ‘/requests/current’ endpoint to get the full data about the current status, and alert the client of the change.

[NOTE: At the end of this article there is example code for basic handling of Uber webhook calls with an express.js server.]

That said, webhooks can only get us so far. Our webhook fires if there is a change in the Uber trip status (e.g. from no trip to processing request, or from driver arriving to on trip), but to be truly smart, Otto has to keep up for the entire Uber ride. Unexpected traffic, a detour to pick up an UberPool passenger, or a change in destination all impact the Otto experience and would be missed by listening to the webhook alone. To capture changes in the middle of a single state, the Otto server sets up a cron job to poll the ‘/requests/current’ endpoint once per minute while a user is on an active trip. This allows us to catch any changes to the ETA and tailor our user’s experience accordingly.

Once our server has detected a noteworthy event, a silent push notification is sent to the client containing the relevant data. The Otto client has two roles for the Trip Experience — calculating the correct ETA for the trip and displaying the correct information to the user. The client is tasked with calculating the ETA so that it can be in sync with the device’s clock, as well as to reduce some burden on the server. To calculate the ETA, we leverage a combination of the ‘/requests/current’, ‘/estimates/time’, and ‘/estimates/price’ endpoints, depending on the current trip status. For example, during the processing stage, we use the ‘/requests/time’ endpoint to get an ETA for when the driver will arrive, but the ‘requests/price’ endpoint to get an ETA for the entire trip. On the other hand, while the trip is in progress, we can get the ETA directly from the ‘/requests/current’ endpoint.

The goal for this integration was to turn every minute of your Uber ride into an opportunity to be entertained and stay informed, and the richness of the Trip Experience API makes that possible. Whether you’re a commute warrior or a visitor in a foreign city, Otto Radio makes it possible to have a personalized radio experience no matter where your journey takes you.