•   almost 5 years ago

Trip price info?

I don't see anywhere in the API where I can find the cost of the full trip once its completed? Is this information not released for a specific reason, or am I just not looking hard enough?

  • 6 comments

  • Manager   •   almost 5 years ago

    Thanks for asking Nitin. Our API does not currently have trip cost as one of the selections that you can choose from. What we currently have that you can display is the following: https://developer.uber.com/v1/endpoints/#user-activity-v1-1

    That said, we are always looking to improve our API, but we don't have a public roadmap.

  •   •   almost 5 years ago

    However, I saw that there are values for cost_per_distance and cost_per_time. Would doing (cost_per_distance * distance + cost_per_time * time + base) * surge_multiplier get me to the total cost?

  • Manager   •   almost 5 years ago

    Nitin you're right that there is a cost+per distance and cost_per_time, which is all used to determine price estimates (an endpoint that we have). However there is a reason why we call it estimates because we don't know the exact route that the driver will take. Drivers could go an alternative route or riders can suggest that they make an alternative turn instead. That ultimately alters all the factors. Long answer short, using the method you provided above would be inaccurate. Hope this helps.

  •   •   almost 5 years ago

    I guess to clarify, if I make a call to user activity, then I can get the final distance for previous trips yes? That distance should not change as they are completed trips, from there is it not possible to back out the price given the other information I mentioned? Sorry for any confusion.

  • Manager   •   almost 5 years ago

    Nitin- You are correct that the final distance would be accurate and that itself would not change. However even using your logic, you cannot calculate the fees that come in sometimes (ex: tolls, airport, etc.) Therefore although your methodology would be a close estimate, I cannot say that it will be a definite match to what the final price would come out to be.

  •   •   almost 5 years ago

    @Nitin you wouldn't be able to calculate the estimated cost of a trip just based off the UserActivity endpoint's returned data, as you need start_lat/lon and end_lat/lon, which is not returned in a user's ride history - however, if you did the Request too, you can probably match up the Request's UUID to the activity UUID too and then you'd know the lon/lats.

Comments are closed.