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

Request a Lyft

POST
/rides
User
Request a Lyft come pick you up at the given location.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.lyft.com/rides' \
--header 'Content-Type: application/json' \
--data-raw '{
    "cost_token": "string",
    "destination": {
        "address": "string",
        "lat": 36.9442175,
        "lng": -123.8679133
    },
    "origin": {
        "address": "string",
        "lat": 36.9442175,
        "lng": -123.8679133
    },
    "primetime_confirmation_token": "string",
    "ride_type": "lyft"
}'
响应示例响应示例
201 - 示例 1
{
    "destination": {
        "address": "123 Main St, Anytown, CA",
        "lat": 36.9442175,
        "lng": -123.8679133
    },
    "origin": {
        "address": "123 Main St, Anytown, CA",
        "lat": 36.9442175,
        "lng": -123.8679133
    },
    "passenger": {
        "first_name": "Jane",
        "image_url": "https://public-api.lyft.com/static/images/user.png",
        "rating": 4.9,
        "user_id": "776630198662493392"
    },
    "ride_id": 123456789,
    "status": "pending"
}

请求参数

Body 参数application/json
Represents a requested, ongoing, or finished Lyft ride
cost_token
string 
可选
A token that confirms the user has accepted current Prime Time and/or fixed price charges
destination
object 
可选
The requested location for passenger drop off
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
lat
number <double>
必需
The latitude component of a location
lng
number <double>
必需
The longitude component of a location
address
string 
可选
A human readable address at/near the given location
origin
object 
必需
The requested location for passenger pickup
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
lat
number <double>
必需
The latitude component of a location
lng
number <double>
必需
The longitude component of a location
address
string 
可选
A human readable address at/near the given location
primetime_confirmation_token
string 
可选
A token that confirms the user has accepted current primetime charges (Deprecated)
ride_type
enum<string> 
必需
The ID of the ride type
枚举值:
lyftlyft_linelyft_pluslyft_premierlyft_luxlyft_luxsuv
示例

返回响应

🟢201成功
application/json
An object with high level ride information. Use GET /v1/rides/{id} for more details.
Body
Minimal set of ride details
destination
object 
可选
The requested location for passenger drop off
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
lat
number <double>
必需
The latitude component of a location
lng
number <double>
必需
The longitude component of a location
address
string 
可选
A human readable address at/near the given location
origin
object 
可选
The requested location for passenger pickup
示例值:
{"address":"123 Main St, Anytown, CA","lat":36.9442175,"lng":-123.8679133}{"lat":36.9442175,"lng":-123.8679133}
lat
number <double>
必需
The latitude component of a location
lng
number <double>
必需
The longitude component of a location
address
string 
可选
A human readable address at/near the given location
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}
first_name
string 
必需
The passenger's first name
image_url
string 
必需
The passenger's profile image
rating
string 
必需
The passenger's rating
last_name
string 
可选
The passenger's last name
user_id
string 
可选
The passenger's lyft user id
ride_id
string 
可选
The ID of the requested ride
status
enum<string> 
可选
The status of the ride
枚举值:
pendingacceptedarrivedpickedUpdroppedOffcanceledscheduledunknown
🟠400请求有误
🟠403禁止访问
🟠409409

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

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

扫码加入交流群
上一页
List rides
下一页
Get the ride detail of a given ride ID
Built with