sharedmobility.github.io

Lime

Base url: https://web-production.lime.bike/api/rider

Methods

Login

Login is in two step:

Request sms code

:warning: Account must exist

Method: GET

Path: /v1/login

Parameters:

Parameters Descriptions Mandatory
phone phone number intl format X

Example

will send an sms to 06 12 34 56 78 phone with an OTP code.

curl --request GET \
  --url 'https://web-production.lime.bike/api/rider/v1/login?phone=%2B33612345678'

Send back OTP code

Method: POST

Path: /v1/login

Header:

Header Value Mandatory
content-type application/json X

Parameters:

Parameters Descriptions Mandatory
phone phone number intl format X
login_code OTP code (length of 6) X

Example

curl --request POST \
  --cookie-jar - \
  --url 'https://web-production.lime.bike/api/rider/v1/login' \
  --header 'Content-Type: application/json' \
  --data '{"login_code": "123456", "phone": "+33612345678"}'
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3Rva2VuIjoiRk9PQkFSRUlSWkhBMiIsImxvZ2luX2NvdW50IjoyfQ.K5nmvUu92hYXQyeYG6O0rqo0ef2mkp7PMdtp9NrgwOE",
    "user": {
        "id": "FOOBAREIRZHA2",
        "type": "users",
        "attributes": {
            "token": "FOOBAREIRZHA2",
            "phone_number": "33612345678",
            "email_address": null,
            "has_verified_email_address": false,
            "name": "Lime Rider",
            "given_name": "Lime",
            "surname": "Rider",
            "default_payment_method": null,
            "referral_code": "REZHETH",
            "num_trips": 0,
            "edu": false,
            "subscription_item_states": [],
            "juicer_profile_status": null,
            "juicer_profile_initial_activated_at": null,
            "balance_cents": 0,
            "pending_balance_cents": 0,
            "currency": "USD"
        }
    }
}

Cookie

# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_web-production.lime.bike	FALSE	/	TRUE	0	_limebike-web_session	U0pwQlVjcVRwMXZUTWovcHh3U251MERYTGE2dWpMdFdmNW9sL0d4SHBRVGtZd2VXN20yMjhJczhlR21nUkVHczlEREUweGNpYmtEWVFvQXBoQVNuRWdZWkVBajJPaHhDeStuUmttYVdYYWVsRDJEMUZvNE5YNU4xc1FlcjlDMi8xOVNMcDM3M3JhQWd0TDF2OWphMGR3PT0tLTBDYUtNeUJLcXRmNVd4YnorSEhlTWc9PQ%3D%3D--c8889db210d22bb4a96307b74d39c4b64d48777f

Get bicycles by lat/lng

:warning: Auth (bearer AND cookie) are mandatory for this endpoint

Method: GET

Path: /v1/views/map

Header:

Header Value Mandatory
authorization Bearer TOKEN X

Cookie:

Cookie Mandatory
_limebike-web_session X

Parameters:

Parameters Descriptions Mandatory Remarks
ne_lat Latitude X Bounding box for map; apparently ignored in favor of zoom parameter
ne_lng Longitude X Bounding box for map; apparently ignored in favor of zoom parameter
sw_lat Latitude X Bounding box for map; apparently ignored in favor of zoom parameter
sw_lng Longitude X Bounding box for map; apparently ignored in favor of zoom parameter
user_latitude Latitude X  
user_longitude Longitude X  
zoom Integer X When < 15, bikes are clustered

Example

curl --request GET \
  --url 'https://web-production.lime.bike/api/rider/v1/views/map?ne_lat=52.6&ne_lng=13.5&sw_lat=52.4&sw_lng=13.3&user_latitude=52.5311&user_longitude=13.3849&zoom=16' \
  --header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
  --cookie '_limebike-web_session=N0xLYmE5ZytSSkRZa0FwQUdvYk1TalBaVWwzcnRDWUloT1Y1Z2ZNOVZSc0NCd3ZRZTFOVkxaS2lOcHFpemx6Y1pxT3ZudU1Zenk2ODlYRHBFZ1dxRWtaZGQybzRTQm96V09TWVdycENLcUltMHYzRWlUaEZlMDBqOCt4ODJqSWZwR09PSEtuNDdINnF3VGpkR3g2SjRBPT0tLTlJVHhSVFRDOE1CNm14S203VGxRd2c9PQ%253D%253D--9f55d56be64fefc5d5af3daf9e2fe9f7d7408cc0'
{
	"data": {
		"id": "views::mapview",
		"type": "map_view",
		"attributes": {
			"user": {
				"id": "FOOBAR66B5TNR",
				"type": "users",
				"attributes": {
					"token": "FOOBAR66B5TNR",
					"phone_number": "33612345678",
					"email_address": null,
					"has_verified_email_address": false,
					"name": "Lime Rider",
					"given_name": "Lime",
					"surname": "Rider",
					"default_payment_method": null,
					"referral_code": "RYFAFTY",
					"num_trips": 0,
					"edu": false,
					"subscription_item_states": [],
                    "donation_profile": {
                        "id": "BKIWJLESOYKIX",
                        "type": "donation_profiles",
                        "attributes": {
                            "donation_type": "none",
                            "donation_organizations": [],
                            "total_donation_amount": {
                                "currency_code": "USD",
                                "amount": 0.0,
                                "amount_str": "0.0",
                                "currency_symbol": "$",
                                "display_string": "$0"
                            },
                            "total_donation_amount_cents": null,
                            "currency": null
                        }
                    },
					"juicer_profile_status": null,
					"juicer_profile_initial_activated_at": null,
                    "juicer_referral_type": "TRIGGER_JUICER_REFERRAL_DEFAULT",
                    "accepted_user_agreement_version": 2,
                    "new_juicer_earnings_amount": {
                        "currency_code": "EUR",
                        "amount": 100.0,
                        "amount_str": "100.0",
                        "currency_symbol": "\u20ac",
                        "display_string": "\u20ac100"
                    },
                    "juicer_referral_amount": {
                        "currency_code": "EUR",
                        "amount": 90.0,
                        "amount_str": "90.0",
                        "currency_symbol": "\u20ac",
                        "display_string": "\u20ac90"
                    },
                    "balance": {
                        "currency_code": "USD",
                        "amount": 0.0,
                        "amount_str": "0.0",
                        "currency_symbol": "$",
                        "display_string": "$0"
                    },
                    "pending_balance": {
                        "currency_code": "USD",
                        "amount": 0.0,
                        "amount_str": "0.0",
                        "currency_symbol": "$",
                        "display_string": "$0"
                    },
                    "new_juicer_earnings_promo_amount": "100",
                    "new_juicer_earnings_promo_amount_cents": 10000,
                    "new_juicer_earnings_promo_amount_cent": 10000,
                    "new_juicer_earnings_promo_currency": "EUR",
                    "juicer_referral_amount_cents": 9000,
                    "juicer_referral_currency": "EUR",
					"balance_cents": 0,
					"pending_balance_cents": 0,
					"currency": "USD"
				}
			},
            "regions": null,
            "zones": [
                {
                    "id": "2KA6UWD75E46I",
                    "type": "zones",
                    "attributes": {
                        "name": "Flughafen Tempelhof",
                        "polyline": "cjg_IqtupA__@Yk\\qRyGas@DkZlRuvAls@cLdGnQdPra@~Eha@mBnc@u]tkA",
                        "category": "no_parking_zone"
                    }
                },

                ...

            ],
            "bike_clusters": null,
            "bikes": [
                {
                    "id": "S36SM4A4WIDBP",
                    "type": "bikes",
                    "attributes": {
                        "status": "locked",
                        "plate_number": null,
                        "latitude": 52.49821,
                        "longitude": 13.398783,
                        "last_activity_at": "2019-01-08T09:47:00.000Z",
                        "bike_icon": null,
                        "type_name": "electric",
                        "battery_level": "high",
                        "meter_range": 54400,
                        "rate_plan": "\u20ac1 to unlock +\n\u20ac0.15 / 1 min",
                        "rate_plan_short": "<b><font color='#7AD319' size='16' face='Montserrat'>\u20ac1</font></b><font color='#444A57' size='12' face='Montserrat'> unlock + </font><b><font color='#7AD319' size='16' face='Montserrat'>\u20ac0.15 </font></b> <font color='#444A57' size='12' face='Montserrat'> / 1 min</font>",
                        "bike_icon_id": 5,
                        "last_three": "046",
                        "license_plate_number": null
                    }
                },

                ...

            ],
			"icons": [
				{
					"id": "1",
					"type": "icons",
					"attributes": {
						"url": "https://d22d5yy1i19g9i.cloudfront.net/icons/default_pin.png?fingerprint=92bcf96642bd8a61eb4f4cca70794496",
						"description_icon_url": null,
						"description_link_url": null,
						"description": ""
					}
				}
			],
            "current_level": "block",
            "levels": {
                "region": 7.0,
                "subregion": 11.0,
                "city": 14.0
            },
            "most_recent_trip": null,
            "banner": null,
            "donation_organization": null
		}
	},
	"meta": {
        "latest_user_agreement_version": "2",
        "min_ios_version": "2.11.0",
        "min_android_code": 93,
        "flags": "IOS_VERSION_V1.0,ANDROID_VERSION_V1.0",
        "groups": {
            "complete_your_profile_v1": true,
            "show_auto_reload": true,
            "map_levels_v1": true,
            "apple_pay": true,
            "show_lock_indicator": false,
            "force_location_permission_v1": true,
            "unlock_button_group": "white_bar",
            "ring_button_group": "louder_with_tooltip",
            "default_to_unlock_group": "control",
            "take_photo": "find_my_ride",
            "show_battery_level_on_map": true,
            "unlock_preview": false,
            "short_stop": true,
            "bluetooth_unlock": true,
            "lime_t_bluetooth_short_stop": false,
            "juicer_earnings_notification": true,
            "parked_or_not": false,
            "branch_link_referral": true,
            "persist_rate_ride": false,
            "no_header_map": true,
            "donation_group": "control",
            "juicer_satellite_mode": true,
            "juicer_level_2": true,
            "id_scanner": "google_vision",
            "new_method_completing_trip": true,
            "juicer_bluetooth_unlock": false,
            "cvv_optional": false,
            "payment_creation_ui": true,
            "payment_billing_address": false,
            "payment_cardholder_name": false,
            "payment_zip_code": false,
            "payments": {
                "cvv_optional": false,
                "payment_creation_ui": true,
                "payment_billing_address": false,
                "payment_cardholder_name": false,
                "payment_zip_code": false,
                "payment_card_io_scan": false
            },
            "lime_t_whitelisted": false,
            "map_design_v3": false
        },
        "trip_id": null,
        "trip_status": null,
        "notifications": [],
        "messages": []
	}
}

Implementations