Search code examples
uber-api

Uber Api History Data Ordering


The get history api documentation does not specify whether the data returned is ordered from the latest trip time . The example data here looks like it is ordered from latest:

https://developer.uber.com/docs/riders/references/api/v1.2/history-get

But my application has a hard dependency on being able to fetch a sample of the latest trips.

Can anyone confirm whether or not this is guaranteed?


Solution

  • History endpoint supposes to return data in descending order - so the latest trips will be displayed first. But you can sort the data on your side how you prefer - you don't need to relay in response you are getting back from the endpoint. It is trivial to sort the list/collection of data - there are many samples how to do it on SO in any programing language you are using.