Lyft

Lyft's API

Drive your app to success with Lyft's developer API. You'll find comprehensive guides and documentation to help you start working with Lyft as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Suggest Edits

Ride - Request

A POST to the /rides endpoint allows your application to request a ride on behalf of the user. The user's payment credentials on file will be charged for the ride.

Before requesting real rides for a user, please test your application using the Sandbox environment! You can read more about using the Sandbox here.

 
posthttps://api.lyft.com/v1/rides
curl -X POST -H "Authorization: Bearer <access_token> " \
     -H "Content-Type: application/json" \
     -d '{"ride_type" : "lyft", "origin" : {"lat" : 37.7763, "lng" : -122.3918 } }' \
     'https://api.lyft.com/v1/rides'
import "github.com/lyft/lyft-go-sdk/lyft"

opt := map[string]interface{}{
	"lat": 37.7763,
	"lng": -122.3918,
}

result, resp, err := client.UserApi.NewRide(lyft.Ride{
	RideType: lyft.RideTypeLyft,
	Origin:   opt,
})
A binary file was returned
{
  "ride_id": "123456789",
  "status": "pending",
  "origin": {
    "lat": 34.305658,
    "lng": -118.8893667,
    "address": "123 Main St, Anytown, CA"
  },
  "destination": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "address": "123 Main St, Anytown, CA"
  },
  "passenger": {
    "rating": null,
    "first_name": "Jane",
    "last_name": "Doe",
    "image_url": "https://public-api.lyft.com/static/images/user.png"
  }
}

Body Params

origin
object
required

Latitude, longitude, and display address of the pickup location.

origin.lat
float
required

Latitude of a location.

origin.lng
float
required

Longitude of a location.

origin.address
string

Display address at/near the lat/lng coordinates.

destination
object

Latitude, longitude, and display address of the drop off location.

destination.lat
float
required

Latitude of a location.

destination.lng
float
required

Longitude of a location.

destination.address
string

Display address at/near the lat/lng coordinates.

ride_type
string
required

ID of a Ride Type.

primetime_confirmation_token
string

Prime Time confirmation token.

cost_token
string

Cost token.

 

Rate Limit

5 calls per minute.

Cost Tokens

If Prime Time is active, the response will include a Cost Token under the key cost_token. It is your application's responsibility to confirm the user's acceptance of Prime Time pricing. Once the user has accepted the pricing, your application should repeat the request with the confirmation token to confirm the ride request. The Cost Token locks in pricing for one minute. Note that this is the same cost_token that is also in the Availability - Ride Estimates response when querying that endpoint with a user context.

`primetime_confirmation_token`s are deprecated

primetime_confirmation_tokens still work as expected for backwards-compatibility purposes, but cost_tokens will be replacing them for more uses in the future. If you can, please include them in your Ride Request request object instead of primetime_confirmation_tokens.

Lyft Line Limitations

Lyft Line is not currently fully supported by the API. The API does not make available the ability to specify the number of passengers in a ride, retrieve information about other passengers who may be part of the route, or any other Line-specific features. If you do make Lyft Line available to your app, it is your responsibility to indicate a maximum of one passenger, and to notify the user that other passengers may be in the ride. You can find more information on Lyft Line here.

Swagger/OpenAPI Specification

Ride - Request

Suggest Edits

Ride - Details

A GET to the /rides/<ride_id> endpoint allows your application to get details about the specified ride.

 
gethttps://api.lyft.com/v1/rides/ride_id
curl -X GET -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json" \
     'https://api.lyft.com/v1/rides/<ride_id>'
import "github.com/lyft/lyft-go-sdk/lyft"

result, resp, err := client.UserApi.GetRide("<ride_id>")
A binary file was returned
{
  "ride_id": "123456789",
  "status": "droppedOff",
  "ride_type": "lyft",
  "passenger": {
    "rating": null,
    "first_name": "Jane",
    "last_name": "Doe",
    "image_url": "https://public-api.lyft.com/static/images/user.png"
  },
  "driver": {
    "first_name": "Joe",
    "phone_number": "+15554445000",
    "rating": "4.9",
    "image_url": "http://example.com/lyft.png"
  },
  "vehicle": {
    "make": "Audi",
    "model": "A4",
    "license_plate": "AAAAAAA",
    "color": "black",
    "image_url": "http://example.com/lyft.png"
  },
  "origin": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "address": "123 Main St, Anytown, CA",
    "eta_seconds": null
  },
  "destination": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "address": "123 Main St, Anytown, CA",
    "eta_seconds": null
  },
  "pickup": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "address": "123 Main St, Anytown, CA",
    "time": "2015-09-24T23:26:25+00:00"
  },
  "dropoff": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "address": "123 Main St, Anytown, CA",
    "time": "2015-09-24T23:26:25+00:00"
  },
  "location": {
    "lat": 36.9442175,
    "lng": -123.8679133,
    "bearing": 134.8789520264
  },
  "primetime_percentage": "50%",
  "price": {
    "amount": 905,
    "currency": "USD",
    "description": "Total ride price"
  },
  "line_items": [
    {
      "amount": 500,
      "currency": "USD",
      "type": "Ride"
    },
    {
      "amount": 250,
      "currency": "USD",
      "type": "Prime Time"
    },
    {
      "amount": 155,
      "currency": "USD",
      "type": "Trust & Service Fee"
    }
  ],
  "route_url": "http://example.com",
  "requested_at": "2015-09-24T23:26:25+00:00",
  "ride_profile": "personal"
}

Path Params

ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

 

Rate Limit

1000 calls per minute.

ETAs, ETDs, etc.

The driver's ETA can be found in origin.eta_seconds after the ride state—the status field—is accepted and until the ride is in the arrived state. When the ride is in the pickedUp state and until the ride is in the droppedOff state, the value in destination.eta_seconds represents the estimated time to the destination. If these terms are unfamiliar, you can read more about Ride States here.

Ride Receipt

Information in the price and line_items fields will be returned only after the ride state changes to droppedOffand the passenger has rated and paid for the ride, plus some processing time.

Route URL

The route_url field contains a link to a web view showing the passenger, driver, and route information for a ride. This field will only be present for rides created via the API, or that have been shared through the "Share my Route" feature.

Swagger/OpenAPI Specification

Ride - Details

Suggest Edits

Ride - Destination

A PUT to the /rides/<ride_id>/destination endpoint allows your application to update the destination of the specified ride. Note that the ride state must still be active (not droppedOff or canceled), and that destinations on Lyft Line rides cannot be changed.

 
puthttps://api.lyft.com/v1/rides/ride_id/destination
curl -X PUT -H "Authorization: Bearer <access_token> " \
     -H "Content-Type: application/json" \
     -d '{"lat" : 34.305658, "lng" : -118.8893667}' \
     'https://api.lyft.com/v1/rides/<ride_id>/destination'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.Location{
	Lat: 34.305658,
	Lng: -118.8893667,
}

result, resp, err := client.UserApi.SetRideDestination("<ride_id>", param)
A binary file was returned
{
  "lat": 34.305658,
  "lng": -118.8893667,
}

Path Params

ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

Body Params

lat
float
required

Latitude of a location.

lng
float
required

Longitude of a location.

address
string

Display address at/near the lat/lng coordinates.

 

Rate Limit

5 per minute, shared with Ride - Request.

Swagger/OpenAPI Specification

Ride - Destination

Suggest Edits

Ride - Rating and Tipping

A PUT to the /rides/<ride_id>/rating endpoint allows your application to rate the specified ride. Add the passenger's 1 to 5 star rating of the ride, optional written feedback, and optional tip in dollars. The ride must already be dropped off, and ratings must be given within 24 hours of drop off. For purposes of display, 5 is considered the default rating. When this endpoint is successfully called, payment processing will begin.

 
puthttps://api.lyft.com/v1/rides/ride_id/rating
curl -X PUT -H "Authorization: Bearer <access_token> " \
     -H "Content-Type: application/json" \
     -d '{"rating" : 5, "tip" : {"amount": 100, "currency": "USD"}, "feedback" : "great ride!"}' \
     'https://api.lyft.com/v1/rides/<ride_id>/rating'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.RatingRequest{
	Rating: 5,
	Tip: lyft.Tip{
		Amount:   100,
		Currency: "USD",
	},
	Feedback: "Great ride!",
}

resp, err := client.UserApi.SetRideRating("<ride_id>", param)
A binary file was returned
Content-Length: 0

Path Params

:ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

Body Params

rating
int32
required

Numerical rating of the ride between 1 and 5, inclusive.

tip
object
tip.amount
integer

Tip for the driver, greater than 0 in minor currency units; e.g. 200 for $2.

tip.currency
string

Tip's 3-character currency code; e.g. 'USD'.

feedback
string

Written feedback beyond the numerical rating.

 

Rate Limit

5 per minute, shared with Ride - Request.

Swagger/OpenAPI Specification

Ride - Rating and Tipping

Suggest Edits

Ride - Receipt

A GET to the /rides/<ride_id>/receipt endpoint allows your application to retrieve the receipt for the specified ride. Receipts are only available after the passenger has rated the ride and the payment processing has been completed. If you have webhooks set up, your webhook will receive an update when the receipt is ready.

 
gethttps://api.lyft.com/v1/rides/ride_id/receipt
curl -X GET -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json" \
     'https://api.lyft.com/v1/rides/<ride_id>/receipt'
import "github.com/lyft/lyft-go-sdk/lyft"

result, _, err := client.UserApi.GetRideReceipt("<ride_id>")
A binary file was returned
{
  "ride_id": "123456789",
  "price": {
    "amount": 905,
    "currency": "USD",
    "description": "Total ride price"
  },
  "line_items": [
    {
      "amount": 500,
      "currency": "USD",
      "type": "Ride"
    },
    {
      "amount": 250,
      "currency": "USD",
      "type": "Prime Time"
    },
    {
      "amount": 155,
      "currency": "USD",
      "type": "Trust & Service Fee"
    }
  ],
  "charges": [
    {
      "amount": 500,
      "currency": "USD",
      "payment_method": "Card"
    },
    {
      "amount": 405,
      "currency": "USD",
      "payment_method": "Lyft Credit"
    }
  ],
  "requested_at": "2015-09-24T23:26:25+00:00"
}

Path Params

ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

 

Rate Limit

1000 calls per minute, shared with Ride - Details.

Swagger/OpenAPI Specification

Ride - Receipt

Suggest Edits

Ride - Cancel

A POST to the /rides/<ride_id>/cancel endpoint allows your application to cancel the specified ride.

 
posthttps://api.lyft.com/v1/rides/ride_id/cancel
curl -X POST -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json" \
     'https://api.lyft.com/v1/rides/<ride_id>/cancel'
import "github.com/lyft/lyft-go-sdk/lyft"

resp, err := client.UserApi.CancelRide("<ride_id>", nil)
A binary file was returned
No Content

Path Params

ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

Body Params

cancel_confirmation_token
string

Cancellation confirmation token.

 

Rate Limit

5 per minute, shared with Ride - Request.

Cancel Confirmation Tokens

In some cases, there may be a cancellation fee—which the user must pay—in order to cancel the ride. If there is a cancellation fee, the response will include a token, which is valid for token_duration seconds. Using this token, it is your application's responsibility to confirm the user's acceptance of the cancellation fee. Once the user has accepted the fee, your application should repeat the request with the <token> appended to the POST as the cancel_confirmation_token to confirm the ride cancellation. Cancellation fees appear depending on how much time has passed between the ride request and the cancellation attempt.

Example Ride Cancel Flow

Below you'll find an example ride cancellation flow, outlining the two possible response scenarios. First, you start with a POST using the <ride_id> you'd like to cancel for the user.

In the case where there's no cancellation fee, the API will respond with an HTTP 204 success code:

HTTP/1.1 204 No Content

If you receive this code, further action is required. The ride has been cancelled at no charge to the user.

However, if you get an HTTP 400 error code with a cancel_confirmation_required error in the response body, you'll need to handle the cancellation as described in the callout above. Here's an example of this kind of response:

HTTP/1.1 400 - Bad Request
Content-Type: application/json

{
  "error": "cancel_confirmation_required",
  "error_detail": [
    {
      "cancel_confirmation": "a valid cancel_confirmation_token is required to cancel a ride"
    }
  ],
  "amount": 500,
  "currency": "USD",
  "token": "656a91d",
  "token_duration": 60
}

If you receive this kind of response (with a cancel_confirmation_required error) the ride hasn't been cancelled yet. This is because the ride has reached a stage where— if cancelled—your user would incur a cancellation fee. The fee itself is listed in the amount and currency fields in this response; in your application, the user should be presented with this information in some form, and a chance to confirm or deny the cancellation.

If the user agrees, use the supplied <token> as your cancel_confirmation_token in your next request. Note that the <token> is only valid for token_duration seconds. If your <token> expires, you'll have to re-request one, and it might include a different cancellation fee returned by amount. Again, if that happens, you should communicate the new fee to your user before using the <token> to fully cancel their ride.

Below is an example request including the <token> returned above to confirm the cancellation, along with piped grep to isolate the HTTP status code returned. If it's accepted, the request will return an HTTP 204 success code, your user's ride will be cancelled, and their Lyft account will be charged the <amount> cancellation fee.

curl -s -i -X POST -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json" \
     -d '{"cancel_confirmation_token":"656a91d"}' \
     'https://api.lyft.com/v1/rides/<ride_id>/cancel' | grep "HTTP"

HTTP/1.1 204 No Content

Swagger/OpenAPI Specification

Ride - Cancel

Suggest Edits

Availability - Ride Types

A GET to the /ridetypes endpoint returns the ride types available at the specified location, indicated by latitude and longitude. If no ride types are available at the specified location, the response will be an error.

 
gethttps://api.lyft.com/v1/ridetypes
curl --include -X GET -H 'Authorization: Bearer <access_token>' \
     'https://api.lyft.com/v1/ridetypes?lat=37.7763&lng=-122.3918'
import "github.com/lyft/lyft-go-sdk/lyft"

result, resp, err := client.PublicApi.GetRideTypes(37.7763, -122.3918, nil)
A binary file was returned
{
  "ride_types": [
    {
      "display_name": "Lyft Line",
      "ride_type": "lyft_line",
      "image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_standard.png",
      "pricing_details": {
        "base_charge": 200,
        "cost_per_mile": 115,
        "cost_per_minute": 23,
        "cost_minimum": 475,
        "trust_and_service": 155,
        "currency": "USD",
        "cancel_penalty_amount": 500
      },
      "seats": 2
    },
    {
      "display_name": "Lyft",
      "ride_type": "lyft",
      "image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_standard.png",
      "pricing_details": {
        "base_charge": 200,
        "cost_per_mile": 115,
        "cost_per_minute": 23,
        "cost_minimum": 500,
        "trust_and_service": 155,
        "currency": "USD",
        "cancel_penalty_amount": 500
      },
      "seats": 4
    },
    {
      "display_name": "Lyft Plus",
      "ride_type": "lyft_plus",
      "image_url": "https://s3.amazonaws.com/api.lyft.com/assets/car_plus.png",
      "pricing_details": {
        "base_charge": 300,
        "cost_per_mile": 200,
        "cost_per_minute": 30,
        "cost_minimum": 700,
        "trust_and_service": 155,
        "currency": "USD",
        "cancel_penalty_amount": 500
      },
      "seats": 6
    }
  ]
}

Query Params

lat
float
required

Latitude of a location

lng
float
required

Longitude of a location

ride_type
string

ID of a ride type. Returned by this endpoint.

 

Rate Limit

10000 calls per minute.

Swagger/OpenAPI Specification

Availability - Ride Types

Suggest Edits

Availability - Driver ETA

A GET to the /eta endpoint returns the estimated time in seconds it will take for the nearest driver to reach the specified location. A success response will be broken down by ridetypes available at the specified location. An optional ride_type parameter can be specified to only return the ETA for that ridetype. Valid inputs for the ride_type parameter can be found by querying the /v1/ridetypes endpoint.

An empty response indicates that the specified ride_type isn't available at the specified location. You can try requesting again without the ride_type parameter.

 
gethttps://api.lyft.com/v1/eta
curl --include -X GET -H 'Authorization: Bearer <access_token>' \
     'https://api.lyft.com/v1/eta?lat=37.7763&lng=-122.3918'
import "github.com/lyft/lyft-go-sdk/lyft"

result, resp, err := client.PublicApi.GetETA(37.7763, -122.3918, nil)
A binary file was returned
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Content-Length: 158
Connection: keep-alive

{
 "eta_estimates": [
   {
     "display_name": "Lyft Line",
     "ride_type": "lyft_line",
     "eta_seconds": 120,
     "is_valid_estimate": true
   },
   {
     "display_name": "Lyft",
     "ride_type": "lyft",
     "eta_seconds": 120,
     "is_valid_estimate": true
   },
   {
     "display_name": "Lyft Plus",
     "ride_type": "lyft_plus",
     "eta_seconds": 660,
     "is_valid_estimate": true
   }
 ]
}

Query Params

lat
float
required

Latitude of the origin location.

lng
float
required

Longitude of the origin location.

destination_lat
float

Latitude of the destination location.

destination_lng
float

Longitude of the destination location.

ride_type
string

ID of a ride type. Returned by the Ride Types endpoint.

 

Rate Limit

10000 calls per minute.

Check for ETA validity

When the API returns false for is_valid_estimate, this means that we are unable to predict the ETA at this time. We recommend checking for this value and accommodating accordingly in your application model.

Name
Type

eta_estimates

array

Swagger/OpenAPI Specification

Availability - Driver ETA

Suggest Edits

Availability - Ride Estimates

A GET to the /cost endpoint returns the estimated cost, distance, and duration of a ride between a start location and end location. A success response will be broken down by ride types available at the specified location. An optional ride_type parameter can be specified to only return the cost_estimate for that ride_type. Valid inputs for the ride_type parameter can be found by querying the /v1/ridetypes endpoint.

If the destination parameters are not supplied, the cost endpoint will simply return the Prime Time pricing at the specified location.

 
gethttps://api.lyft.com/v1/cost
curl --include -X GET -H 'Authorization: bearer <access_token>' \
     'https://api.lyft.com/v1/cost?start_lat=37.7763&start_lng=-122.3918&end_lat=37.7972&end_lng=-122.4533'
import "github.com/lyft/lyft-go-sdk/lyft"

opt := map[string]interface{}{
	"endLat": 37.7972,
	"endLng": -122.4533,
}

result, resp, err := client.PublicApi.GetCost(37.7763, -122.3918, opt)
A binary file was returned
HTTP/1.1 200 OK
Content-Type: application/json

{
  "cost_estimates": [
    {
      "ride_type": "lyft_plus",
      "estimated_duration_seconds": 913,
      "estimated_distance_miles": 3.29,
      "estimated_cost_cents_max": 2355,
      "primetime_percentage": "25%",
      "currency": "USD",
      "estimated_cost_cents_min": 1561,
      "display_name": "Lyft Plus",
      "primetime_confirmation_token": null,
      "cost_token": null,
      "is_valid_estimate": true
    },
    {
      "ride_type": "lyft_line",
      "estimated_duration_seconds": 913,
      "estimated_distance_miles": 3.29,
      "estimated_cost_cents_max": 475,
      "primetime_percentage": "0%",
      "currency": "USD",
      "estimated_cost_cents_min": 475,
      "display_name": "Lyft Line",
      "primetime_confirmation_token": null,
      "cost_token": null,
      "is_valid_estimate": true
    },
    {
      "ride_type": "lyft",
      "estimated_duration_seconds": 913,
      "estimated_distance_miles": 3.29,
      "estimated_cost_cents_max": 1755,
      "primetime_percentage": "25%",
      "currency": "USD",
      "estimated_cost_cents_min": 1052,
      "display_name": "Lyft",
      "primetime_confirmation_token": null,
      "cost_token": null,
      "is_valid_estimate": true
    }
  ]
}

Query Params

start_lat
float
required

Latitude of the origin location.

start_lng
float
required

Longitude of the origin location.

end_lat
float

Latitude of the destination location.

end_lng
float

Longitude of the destination location.

ride_type
string

ID of a Ride Type. Returned by the Ride Types endpoint.

 

Rate Limit

10000 calls per minute.

A note on Prime Time

Lyft rides may be subject to Prime Time pricing in cases where many passengers are requesting rides from the same area. If applicable, it is your app's responsibility to display the Prime Time cost to the user. The cost endpoint enables you to determine what the current value of Prime Time is via the primetime_percentage field. Note that in order to get Prime Time pricing prior to the ride request, we require a user context; check the Authentication section for details on leveraging the OAuth 3-legged flow to login on behalf of a user.

Since Prime Time may change between when you display the cost and when the user actually makes the request, the cost_token allows you to lock in a Prime Time percentage for a short period of time. You will need to pass the token through in the subsequent ride request. Like Prime Time pricing, the cost_token requires a user context; otherwise it will be null. The cost_token expires after one minute.

`primetime_confirmation_token`s are deprecated

primetime_confirmation_tokens still work as expected for backwards-compatibility purposes, but cost_tokens will be replacing them for more uses in the future. If you can, please include them in your Ride Request request object instead of primetime_confirmation_tokens.

Check `is_valid_estimate` before using cost estimates

When the API returns false for is_valid_estimate we also return 0 for cost estimates. When this happens, we do not have a valid cost estimate for the trip; typically this occurs when the queried trip is long distance.

name
type

cost_estimates

array

Swagger/OpenAPI Specification

Availability - Ride Estimates

Suggest Edits

Availability - Nearby Drivers

A GET to the /drivers endpoint returns the location of drivers near a location. The result will contain a list of 5 locations for a sample of drivers for each ride type available at the specified latitude and longitude.

 
gethttps://api.lyft.com/v1/drivers
curl --include -X GET -H 'Authorization: Bearer <access_token>' 'https://api.lyft.com/v1/drivers?lat=37.7763&lng=-122.3918'
import "github.com/lyft/lyft-go-sdk/lyft"

result, resp, err := client.PublicApi.GetDrivers(37.7763, -122.3918)
A binary file was returned
{
  "nearby_drivers": [
    {
      "drivers": [
        {
          "locations": [
            {
              "lat": 37.780099178,
              "lng": -122.4560498233
            },
            {
              "lat": 37.7800702739,
              "lng": -122.4560313931
            },
            {
              "lat": 37.7800616438,
              "lng": -122.456024372
            },
            {
              "lat": 37.7800546575,
              "lng": -122.4560217391
            },
            {
              "lat": 37.7800523287,
              "lng": -122.4560208615
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7746225247,
              "lng": -122.455451083
            },
            {
              "lat": 37.7746365535,
              "lng": -122.4553615805
            },
            {
              "lat": 37.774647136,
              "lng": -122.4552836749
            },
            {
              "lat": 37.7746548544,
              "lng": -122.4552194602
            },
            {
              "lat": 37.7746574272,
              "lng": -122.455174722
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7735039334,
              "lng": -122.4648762032
            },
            {
              "lat": 37.7735338571,
              "lng": -122.4646185389
            },
            {
              "lat": 37.7735576375,
              "lng": -122.4644094286
            },
            {
              "lat": 37.7735790551,
              "lng": -122.4642197622
            },
            {
              "lat": 37.7735995277,
              "lng": -122.4640398734
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7806871969,
              "lng": -122.4700446885
            },
            {
              "lat": 37.7806924577,
              "lng": -122.469883254
            },
            {
              "lat": 37.7807001761,
              "lng": -122.4697350885
            },
            {
              "lat": 37.7807080705,
              "lng": -122.4696220264
            },
            {
              "lat": 37.7807140353,
              "lng": -122.4694910057
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.77686,
              "lng": -122.4718497879
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499098
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499562
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499736
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499794
            }
          ]
        }
      ],
      "ride_type": "lyft"
    },
    {
      "drivers": [
        {
          "locations": [
            {
              "lat": 37.780099178,
              "lng": -122.4560498233
            },
            {
              "lat": 37.7800702739,
              "lng": -122.4560313931
            },
            {
              "lat": 37.7800616438,
              "lng": -122.456024372
            },
            {
              "lat": 37.7800546575,
              "lng": -122.4560217391
            },
            {
              "lat": 37.7800523287,
              "lng": -122.4560208615
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            },
            {
              "lat": 37.7812899999,
              "lng": -122.4565999839
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7746225247,
              "lng": -122.455451083
            },
            {
              "lat": 37.7746365535,
              "lng": -122.4553615805
            },
            {
              "lat": 37.774647136,
              "lng": -122.4552836749
            },
            {
              "lat": 37.7746548544,
              "lng": -122.4552194602
            },
            {
              "lat": 37.7746574272,
              "lng": -122.455174722
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            },
            {
              "lat": 37.7791899999,
              "lng": -122.4621399844
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7735039334,
              "lng": -122.4648762032
            },
            {
              "lat": 37.7735338571,
              "lng": -122.4646185389
            },
            {
              "lat": 37.7735576375,
              "lng": -122.4644094286
            },
            {
              "lat": 37.7735790551,
              "lng": -122.4642197622
            },
            {
              "lat": 37.7735995277,
              "lng": -122.4640398734
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7806871969,
              "lng": -122.4700446885
            },
            {
              "lat": 37.7806924577,
              "lng": -122.469883254
            },
            {
              "lat": 37.7807001761,
              "lng": -122.4697350885
            },
            {
              "lat": 37.7807080705,
              "lng": -122.4696220264
            },
            {
              "lat": 37.7807140353,
              "lng": -122.4694910057
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            },
            {
              "lat": 37.7857499999,
              "lng": -122.4436299827
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.77686,
              "lng": -122.4718497879
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499098
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499562
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499736
            },
            {
              "lat": 37.77686,
              "lng": -122.4718499794
            }
          ]
        }
      ],
      "ride_type": "lyft_line"
    },
    {
      "drivers": [
        {
          "locations": [
            {
              "lat": 37.7924293441,
              "lng": -122.4138204769
            },
            {
              "lat": 37.7924221021,
              "lng": -122.4138748758
            },
            {
              "lat": 37.7924169623,
              "lng": -122.4139341706
            },
            {
              "lat": 37.7924087848,
              "lng": -122.4139876561
            },
            {
              "lat": 37.7923993924,
              "lng": -122.414028818
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.7913899341,
              "lng": -122.4119699796
            },
            {
              "lat": 37.7913899747,
              "lng": -122.4119699796
            },
            {
              "lat": 37.7913899902,
              "lng": -122.4119699796
            },
            {
              "lat": 37.791389996,
              "lng": -122.4119699796
            },
            {
              "lat": 37.7913899979,
              "lng": -122.4119699796
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.803992869,
              "lng": -122.4263435874
            },
            {
              "lat": 37.8040078617,
              "lng": -122.4262243012
            },
            {
              "lat": 37.804020716,
              "lng": -122.426109335
            },
            {
              "lat": 37.8040342864,
              "lng": -122.4260037226
            },
            {
              "lat": 37.8040421432,
              "lng": -122.4259218519
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.6330499998,
              "lng": -122.4001899782
            },
            {
              "lat": 37.6330499998,
              "lng": -122.4001899782
            },
            {
              "lat": 37.6330499998,
              "lng": -122.4001899782
            },
            {
              "lat": 37.6330499998,
              "lng": -122.4001899782
            },
            {
              "lat": 37.6330499998,
              "lng": -122.4001899782
            }
          ]
        },
        {
          "locations": [
            {
              "lat": 37.8137717059,
              "lng": -122.270445794
            },
            {
              "lat": 37.8137768284,
              "lng": -122.2704730737
            },
            {
              "lat": 37.8137787799,
              "lng": -122.270483466
            },
            {
              "lat": 37.8137795117,
              "lng": -122.2704873631
            },
            {
              "lat": 37.8137797556,
              "lng": -122.2704886621
            }
          ]
        }
      ],
      "ride_type": "lyft_plus"
    }
  ]
}

Query Params

lat
float
required

Latitude of a location.

lng
float
required

Longitude of a location.

 

Rate Limit

5 calls per minute.

name
type

nearby_drivers

array

Swagger/OpenAPI Specification

Availability - Nearby Drivers

Suggest Edits

Users - Ride History

A GET to the /rides endpoint returns a list of current and past rides for a given, authenticated passenger. If there's a ride in progress, location will have the ride's current location.

 
gethttps://api.lyft.com/v1/rides
curl -X GET -H "Authorization: Bearer <access_token>" \
     'https://api.lyft.com/v1/rides?start_time=2015-12-01T21:04:22Z'
import "github.com/lyft/lyft-go-sdk/lyft"

result, resp, err := client.UserApi.GetRides(time.Now().AddDate(0, 0, -3), nil)
A binary file was returned
{
  "ride_history": [
    {
      "ride_id": "123456789",
      "status": "droppedOff",
      "ride_type": "lyft",
      "passenger": {
        "first_name": "Jane",
        "phone_number": "+15554445000"
      },
      "driver": {
        "first_name": "Joe",
        "phone_number": "+15554445000",
        "rating": "4.9",
        "image_url": "http://example.com/lyft.png"
      },
      "vehicle": {
        "make": "Audi",
        "model": "A4",
        "license_plate": "AAAAAAA",
        "color": "black",
        "image_url": "http://example.com/lyft.png"
      },
      "origin": {
        "lat": 36.9442175,
        "lng": -123.8679133,
        "address": "123 Main St, Anytown, CA",
        "eta_seconds": null
      },
      "destination": {
        "lat": 36.9442175,
        "lng": -123.8679133,
        "address": "123 Main St, Anytown, CA",
        "eta_seconds": null
      },
      "pickup": {
        "lat": 36.9442175,
        "lng": -123.8679133,
        "address": "123 Main St, Anytown, CA",
        "time": "2015-09-24T23:27:25+00:00"
      },
      "dropoff": {
        "lat": 36.9442175,
        "lng": -123.8679133,
        "address": "123 Main St, Anytown, CA",
        "time": "2015-09-24T23:28:32+00:00"
      },
      "location": {
        "lat": 36.9442175,
        "lng": -123.8679133,
        "address": "123 Main St, Anytown, CA"
      },
      "primetime_percentage": "50%",
      "price": {
        "amount": 905,
        "currency": "USD",
        "description": "Total ride price"
      },
      "line_items": [
        {
          "amount": 500,
          "currency": "USD",
          "type": "Ride"
        },
        {
          "amount": 250,
          "currency": "USD",
          "type": "Prime Time"
        },
        {
          "amount": 155,
          "currency": "USD",
          "type": "Trust & Service Fee"
        }
      ],
      "eta_seconds": 200,
      "requested_at": "2017-01-24T23:26:25+00:00"
    }
  ]
}

Query Params

start_time
date
required

Restrict to rides starting after this point in time. The earliest supported date is 2015-01-01T00:00:00Z.

end_time
date

Restrict to rides starting before this point in time. The earliest supported date is 2015-01-01T00:00:00Z.

limit
int32

Maximum number of rides to return. The default limit is 10 if not specified. The maximum possible value is 50.

 

Rate Limit

1000 calls per minute.

Swagger/OpenAPI Specification

Users - Ride History

Suggest Edits

Users - Profile

A GET to the /profile only returns the authenticated user's id, first_name, and last_name. In the future it will return more information.

 
gethttps://api.lyft.com/v1/profile
curl -X GET -H "Authorization: Bearer <access_token>" \
     'https://api.lyft.com/v1/profile'
import "github.com/lyft/lyft-go-sdk/lyft"

result, _, err := client.UserApi.GetProfile()
A binary file was returned
{
    "id": "123456789",
    "first_name": "Rick",
    "last_name": "Sanchez"
}
 

Rate Limit

5 calls per minute.

Swagger/OpenAPI Specification

Users - Profile

Suggest Edits

Sandbox - Ride State

Allows propagating a sandbox-ride through various states, allowing the developer to test various scenarios in the course of a ride from the initial request to the final drop off. First, sandbox credentials must be used to create a ride using the Ride - Request endpoint. Keep note of the ride_id. All sandbox-rides will start with an initial status of pending. In order to get the ride details, you can hit the Ride - Details endpoint with the same sandbox credentials.

 
puthttps://api.lyft.com/v1/sandbox/rides/ride_id
curl --include -X PUT -H 'Authorization: Bearer <access_token>' 'https://api.lyft.com/v1/sandbox/rides/4554071665457258493' -H 'Content-Type: application/json' -d '{"status": "accepted"}'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.SandboxRideStatus{
	Status: lyft.RideStatusAccepted,
}

result, resp, err := client.SandboxApi.SetRideStatus("4554071665457258493", param)
A binary file was returned
{
    "ride_id": "4319057680757320826", 
    "status": "accepted"
}

Path Params

ride_id
string
required

ID of a ride. Returned by the Ride - Request endpoint.

Body Params

status
string
required

Desired state to transition the ride to.

 

Rate Limit

10000 calls per minute, shared with all other Sandbox-specific endpoints.

Valid inputs for status

Status Meaning
pending Ride has been requested, but not yet matched with a driver
accepted A driver has accepted the request and is on the way to the pickup location
arrived The driver has arrived at the requested pickup location and is awaiting the passenger
pickedUp Driver has picked up the passenger and is en-route to the destination
droppedOff The passenger is dropped off at the final location
canceled The ride has been canceled. In this ride state, the additional field canceled_by indicates whether the ride was canceled by the driver, passenger, or no_drivers_available if no driver could be found for the ride

Swagger/OpenAPI Specification

Sandbox - Ride State

Suggest Edits

Sandbox - Ride Types

Allows you to set the availability of different Lyft ride types in the region surrounding the specified latitude and longitude. Once the developer sets the ride_types for a given lat/lng, the Availability - Ride Types endpoint can be used to get the data.

 
puthttps://api.lyft.com/v1/sandbox/ridetypes
curl --include -X PUT 'https://api.lyft.com/v1/sandbox/ridetypes' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{"lat": 37.7, "lng": -122.2, "ride_types": ["lyft", "lyft_line"]}'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.SandboxRideType{
	Lat: 37.7,
	Lng: -122.2,
	RideTypes: []lyft.RideTypeEnum{
		lyft.RideTypeLyft,
		lyft.RideTypeLyftLine,
	},
}

result, resp, err := client.SandboxApi.SetRideTypes(param)
A binary file was returned
{
    "lat": 37.7, 
    "lng": -122.2, 
    "ride_types": [
        "lyft", 
        "lyft_line"
    ]
}

Body Params

lat
float
required

Latitude of a location.

lng
float
required

Longitude of a location.

ride_types
array of strings
required

Ride Type IDs.

 

Rate Limits

10000 calls per minute, shared with all other Sandbox-specific endpoints.

Swagger/OpenAPI Specification

Sandbox - Ride Types

Suggest Edits

Sandbox - Prime Time

Allows setting Prime Time in the region surrounding the specified latitude and longitude. The value, expressed as a percentage, will be applied when requesting a new ride or a ride cost estimate.

 
puthttps://api.lyft.com/v1/sandbox/primetime
curl --include -X PUT 'https://api.lyft.com/v1/sandbox/primetime' \ 
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{"lat": 37.7, "lng": -122.2, "primetime_percentage": "25%"}'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.SandboxPrimetime{
	Lat: 37.7,
	Lng: -122.2,
	PrimetimePercentage: "25%",
}

resp, err := client.SandboxApi.SetPrimeTime(param)
A binary file was returned
Content-Length: 0

Body Params

lat
float
required

Latitude of a location.

lng
float
required

Longitude of a location.

primetime_percentage
string
required

Prime Time expressed as a percentage, eg. 25%.

 

Rate Limits

10000 calls per minute, shared with all other Sandbox-specific endpoints.

Swagger/OpenAPI Specification

Sandbox - Ride Types

Suggest Edits

Sandbox - Driver Availability

Allows developers to set driver availability for a Lyft ride type in the region surrounding the specified latitude and longitude. This is useful to test lapsed scenarios where drivers are busy and cannot accept a ride request.

 
puthttps://api.lyft.com/v1/sandbox/ridetypes/ride_type
curl --include -X PUT 'https://api.lyft.com/v1/sandbox/ridetypes/lyft_line' \ 
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{"lat": 37.7833, "lng": -122.4167, "driver_availability": false}'
import "github.com/lyft/lyft-go-sdk/lyft"

param := lyft.SandboxDriverAvailability{
	Lat: 37.7833,
	Lng: -122.4167,
	DriverAvailability: false,
}

resp, err := client.SandboxApi.SetRideTypeAvailability(string(lyft.RideTypeLyftLine), param)
A binary file was returned
Content-Length: 0

Path Params

ride_type
string
required

Ride Type ID.

Body Params

lat
float
required

Latitude of a location.

lng
float
required

Longitude of a location.

driver_availability
boolean
required

Determines if drivers are available or busy.

 

Rate Limits

10000 calls per minute, shared with all other Sandbox-specific endpoints.

Swagger/OpenAPI Specification

Sandbox - Ride Types