Lyft API
  1. User
Lyft API
  • Restricted
  • Public
    • Cost estimates
      GET
    • Available drivers nearby
      GET
    • Pickup ETAs
      GET
    • Types of rides
      GET
  • User
    • The user's general info
      GET
    • List rides
      GET
    • Request a Lyft
      POST
    • Get the ride detail of a given ride ID
      GET
    • Cancel a ongoing requested ride
      POST
    • Update the destination of the ride
      PUT
    • Add the passenger's rating, feedback, and tip
      PUT
    • Get the receipt of the rides.
      GET
  • Sandbox
    • Preset Prime Time percentage
      PUT
    • Propagate ride through ride status
      PUT
    • Preset types of rides for sandbox
      PUT
    • Driver availability for processing ride request
      PUT
  1. User

List rides

GET
/rides
User
Get a list of past & current rides for this passenger.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.lyft.com/rides?start_time'
响应示例响应示例
200 - 示例 1
{
  "ride_history": [
    {
      "beacon_color": "#FFFFFF",
      "destination": {
        "address": "987 Second St, Anytown, CA",
        "lat": 36.9453452,
        "lng": -123.8642521
      },
      "distance_miles": 16.2,
      "driver": {
        "first_name": "Joe",
        "image_url": "http://example.com/lyft.png",
        "phone_number": "+15554445111",
        "rating": "4.9"
      },
      "dropoff": {
        "address": "987 Second St, Anytown, CA",
        "lat": 36.9453452,
        "lng": -123.8642521,
        "time": "2015-09-24T23:28:25+00:00"
      },
      "duration_seconds": 1620,
      "line_items": [
        {
          "amount": 500,
          "currency": "USD",
          "type": "Ride"
        },
        {
          "amount": 250,
          "currency": "USD",
          "type": "Prime Time"
        },
        {
          "amount": 155,
          "currency": "USD",
          "type": "Service fee"
        }
      ],
      "location": {
        "address": "987 Second St, Anytown, CA",
        "lat": 36.9453452,
        "lng": -123.8642521
      },
      "origin": {
        "address": "123 Main St, Anytown, CA",
        "lat": 36.9442175,
        "lng": -123.8679133
      },
      "passenger": {
        "first_name": "Jane",
        "phone_number": "+15554445000",
        "user_id": "776630198662493392"
      },
      "pickup": {
        "address": "123 Main St, Anytown, CA",
        "lat": 36.9442175,
        "lng": -123.8679133,
        "time": "2015-09-24T23:27:25+00:00"
      },
      "price": {
        "amount": 905,
        "currency": "USD",
        "description": "Total ride price"
      },
      "primetime_percentage": "50%",
      "requested_at": "2015-09-24T23:26:25+00:00",
      "ride_id": 123456789,
      "ride_profile": "personal",
      "ride_type": "lyft",
      "status": "droppedOff",
      "vehicle": {
        "color": "black",
        "image_url": "http://example.com/lyft.png",
        "license_plate": "AAAAAAA",
        "make": "Audi",
        "model": "A4"
      }
    }
  ]
}

请求参数

Query 参数
start_time
string <date-time>
必需
Restrict to rides starting after this point in time. The earliest supported date is 2015-01-01T00:00:00+00:00
end_time
string <date-time>
可选
Restrict to rides starting before this point in time. The earliest supported date is 2015-01-01T00:00:00+00:00
limit
integer <int32>
可选
The maximum number of rides to return. The default limit is 10 if not specified. The maximum allowed value is 50, an integer greater that 50 will return at most 50 results.
<= 50> 0
默认值:
10

返回响应

🟢200成功
application/json
An object with an array of up to limit rides taken by the user between start_time and end_time.
Body
ride_history
array[object (RideDetail) {27}] 
可选
beacon_color
string 
可选
Hex color code of the driver AMP device.
can_cancel
array[string]
可选
枚举值:
driverpassengerdispatcher
canceled_by
string 
可选
The role of user who canceled the ride (if applicable)
cancellation_price
object 
可选
The cost of cancellation if there would be a penalty
示例值:
{"amount":500,"currency":"USD","description":"Total cost"}
destination
object 
可选
The requested location for passenger drop off
示例值:
{"address":"123 Main St, Anytown, CA","eta_seconds":200,"lat":36.9442175,"lng":-123.8679133}{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
distance_miles
number <float>
可选
The distance, in miles, that this ride traveled. This field is only present after drop-off
driver
object (DriverDetail) 
可选
示例值:
{"first_name":"Joe","image_url":"http://example.com/lyft.png","phone_number":"+15554445000","rating":"4.9","user_id":"123456789"}
dropoff
object 
可选
The actual location of passenger drop off
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133,"time":"2015-09-24T23:26:25+00:00"}{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
duration_seconds
integer <int32>
可选
Duration of the ride in seconds from pickup to drop-off. This field is only present after drop-off.
feedback
string 
可选
The written feedback the user left for this ride
generated_at
string <date-time>
可选
The request timestamp in date and time
line_items
array[object (LineItem) {3}] 
可选
The break down of cost
location
object 
可选
The current location info of the ride
示例值:
{"bearing":134.8789520264,"lat":37.776157,"lng":-122.393817}{"lat":36.9442175,"lng":-123.8679133}
origin
object 
可选
The requested location for passenger pickup
示例值:
{"address":"123 Main St, Anytown, CA","eta_seconds":200,"lat":36.9442175,"lng":-123.8679133}{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
passenger
object (PassengerDetail) 
可选
示例值:
{"first_name":"Jane","image_url":"https://public-api.lyft.com/static/images/user.png","last_name":"Doe","rating":4.9}{"first_name":"Jane","image_url":"https://public-api.lyft.com/static/images/user.png","rating":4.9}
pickup
object 
可选
The actual location of passenger pickup
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133,"time":"2015-09-24T23:26:25+00:00"}{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
price
object 
可选
The total price for the current ride
示例值:
{"amount":500,"currency":"USD","description":"Total cost"}
pricing_details_url
string 
可选
The web view showing the pricing structure for the geographic area where the ride was taken
primetime_percentage
string 
可选
The Prime Time percentage applied to the base price
rating
integer <int32>
可选
The rating the user left for this ride, from 1 to 5
requested_at
string <date-time>
可选
The ride requested timestamp in date and time
ride_id
string 
可选
The unique ID of this ride
ride_profile
enum<string> 
可选
Indicates whether the ride was requested from the business profile or personal profile of the user.
枚举值:
personalbusiness
ride_type
enum<string> 
可选
The ID of the ride type
枚举值:
lyftlyft_linelyft_pluslyft_premierlyft_luxlyft_luxsuvother
route_url
string 
可选
The web view showing the passenger, driver, and route for this ride. This field will only be present for rides created through this API, or that have been shared through the "Share my Route" feature
status
enum<string> 
可选
The status of the ride
枚举值:
pendingacceptedarrivedpickedUpdroppedOffcanceledscheduledunknown
vehicle
object (VehicleDetail) 
可选
示例值:
{"color":"black","image_url":"http://example.com/lyft.png","license_plate":"AAAAAAA","license_plate_state":"CA","make":"Audi","model":"A4","year":2016}
🟠400请求有误

【Lyft】API开发者 微信交流群

用微信扫右侧二维码,加入【Lyft】API开发者 交流群,互助沟通

扫码加入交流群
上一页
The user's general info
下一页
Request a Lyft
Built with