POST /requests/estimate
¶ Ride Request - Estimate
The Request Estimate endpoint allows a ride to be estimated given the desired product, start, and end locations. If the end location is not provided, only the pickup ETA and details of surge pricing information are provided. If the pickup ETA is null, there are no cars available even if an estimate may still be given to the user.
You can use this endpoint to determine if surge pricing is in effect. Do this before attempting to make a request so that you can preemptively have a user confirm surge by sending them to the surge_confirmation_href
provided in the response.
See the Ride Request tutorial for a step-by-step guide to requesting rides on behalf of an Uber user. Please review the sandbox documentation on how to develop and test against these endpoints without making real-world Ride Requests and being charged.
¶ Resource
POST /v1/requests/estimate
¶ Authorization
OAuth 2.0 bearer token with the request
scope.
¶ POST Parameters
Name | Type | Description |
---|---|---|
product_id (optional) |
string |
The unique ID of the product being requested. If none is provided, it will default to the cheapest product for the given location. |
start_latitude (optional) |
float |
The beginning or "pickup" latitude. Either this or start_place_id must be specified. |
start_longitude (optional) |
float |
The beginning or "pickup" longitude. Either this or start_place_id must be specified. |
start_place_id (optional) |
string |
The beginning or “pickup” place ID. This is the name of an Uber saved place. Only “home” or “work” is acceptable. Either this or start_latitude and start_longitude must be specified. |
end_latitude (optional) |
float |
The final or destination latitude. If not included, only the pickup ETA and details of surge pricing will be included. |
end_longitude (optional) |
float |
The final or destination longitude. If not included, only the pickup ETA and details of surge pricing will be included. |
end_place_id (optional) |
string |
The final or destination place ID. This is the name of an Uber saved place. Only “home” or “work” is acceptable. Either this or end_latitude and end_longitude may be specified. |
seat_count (optional) |
int |
The number of seats required for uberPOOL. Default and maximum value is 2. |
¶ Example Response with surge pricing
Status-Code: 200 OK
{
"price": {
"surge_confirmation_href": "https:\/\/api.uber.com\/v1\/surge-confirmations\/7d604f5e",
"high_estimate": 11,
"surge_confirmation_id": "7d604f5e",
"minimum": 5,
"low_estimate": 8,
"fare_breakdown": [
{
"low_amount": 1.25,
"high_amount": 1.25,
"display_amount": "1.25",
"display_name": "Base Fare"
},
{
"low_amount": 1.92,
"high_amount": 2.57,
"display_amount": "1.92-2.57",
"display_name": "Distance"
},
{
"low_amount": 2.50,
"high_amount": 3.50,
"display_amount": "2.50-3.50",
"display_name": "Surge x1.5"
},
{
"low_amount": 1.25,
"high_amount": 1.25,
"display_amount": "1.25",
"display_name": "Booking Fee"
},
{
"low_amount": 1.36,
"high_amount": 1.81,
"display_amount": "1.36-1.81",
"display_name": "Time"
}
],
"surge_multiplier": 1.5,
"display": "$8-11",
"currency_code": "USD"
},
"trip": {
"distance_unit": "mile",
"duration_estimate": 480,
"distance_estimate": 1.95
},
"pickup_estimate": 2
}
¶ Example Response for uberPOOL
Status-Code: 200 OK
{
"price": {
"surge_confirmation_href": null,
"high_estimate": 5,
"fare_id": "3b61e342582cfbc0ef68b9da09bf35d9a9f051fb56e902206decc2fa7acd0316",
"expires_at": 1475769883,
"surge_confirmation_id": null,
"minimum": null,
"low_estimate": 5,
"surge_multiplier": 1.0,
"display": "$5.75",
"currency_code": "USD",
"fare_breakdown": []
},
"trip": {
"distance_unit": "mile",
"duration_estimate": 1,
"distance_estimate": 1.0
},
"pickup_estimate": 2
}
Name | Type | Description |
---|---|---|
pickup_estimate |
integer |
The estimated time of vehicle arrival in minutes. null if there are no cars available. |
price |
object |
Details of the estimated fare. If end location is omitted, only the minimum is returned. |
price.surge_multiplier |
float |
Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Fare estimates below factor in the surge multiplier. |
price.surge_confirmation_id |
string |
The unique identifier of the surge session for a user. null if no surge is currently in effect. |
price.surge_confirmation_href |
string |
The URL a user must visit to accept surge pricing. |
price.minimum |
integer |
The minimum fare of a trip. Should only be displayed or used if no end location is provided. |
price.display |
string |
Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. |
price.low_estimate |
integer |
Lower bound of the estimated price. |
price.high_estimate |
integer |
Upper bound of the estimated price. |
price.currency_code |
string |
ISO 4217 currency code. |
trip |
object |
Details of the estimated distance. null if end location is omitted. |
trip.distance_estimate |
float |
Expected activity distance. |
trip.distance_unit |
string |
The unit of distance (mile or km ). |
trip.duration_estimate |
integer |
Expected activity duration (in seconds). |
fare_breakdown |
array |
Breakdown of charges contributing to the total fare. Trips with upfront fares will not have a breakdown. |
fare_breakdown[].low_amount |
float |
Lower bound of the charge. |
fare_breakdown[].high_amount |
float |
Upper bound of the charge. |
fare_breakdown[].display_amount |
float |
Formatted string of the breakdown charge. Charge could be a range or a single number (flat charge). |
fare_breakdown[].display_name |
string |
Name of the charge. |
fare_id |
string |
A unique identifier for the upfront fare. This field only appears for uberPOOL products. | expires_at |
int |
The `fare_id` expiration as a Unix timestamp. This field only appears for uberPOOL products. |
¶ HTTP Error Codes
Below is a list of the HTTP error codes this endpoint could return.
HTTP Status | Code | Description |
---|---|---|
403 | current_trip_exists | Trip estimates not allowed while the user is currently on a trip. |
404 | not_found | Invalid product_id. |
404 | no_product_found | Could not find a default product. |
422 | destination_required | This product requires setting a destination for ride requests. |
422 | distance_exceeded | Distance between start and end location exceeds 100 miles. |
422 | same_pickup_dropoff | Pickup and Dropoff can’t be the same. |