Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API documentation for free floating nearby Endpoint #4362

Merged
merged 2 commits into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion documentation/slate/source/includes/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ Details for disruption objects: [disruptions](#disruptions)
- each stop_area contains at least a link to its disruptions<br>If a stop_area is used by multiple networks, it will appear each time.


Equipment_Reports
Equipment Reports
---------------------------------------------

``` shell
Expand Down Expand Up @@ -2220,3 +2220,64 @@ no | depth | int | Json response [depth](#depth)
no | filter | string | A [filter](#filter) to refine your request |
no | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. |
no | start_page | int | The page number (cf. the [paging section](#paging)) | 0



<h2 id="Freefloatings-nearby-api">Freefloatings Nearby</h2>


``` shell
#request
$ curl 'https://api.navitia.io/v1/coverage/<my_coverage>/freefloatings_nearby'
```

``` shell
# response, composed by 1 main list: "freefloatings_nearby"
HTTP/1.1 200 OK

{
"free_floatings": [
{
"public_id": "scooter_12345",
"provider_name": "Lime",
"id": "scooter_12345",
"type": "scooter",
"propulsion": "electric",
"battery": 85,
"distance": 120,
"deeplink": "https://lime.com/scooter_12345",
"coord": {
"lat": "48.8560",
"lon": "2.3500"
}
}
],
}
```

The `/freefloatings_nearby` service provides access to nearby shared mobility options (such as bikes, scooters, or cars) based on user-provided coordinates.

This endpoint allows users to search for shared mobility options near a specific location or object, returning detailed information about available free-floating vehicles, including type, provider, battery level, and distance.


<aside class="warning">
This feature requires a specific configuration from a freefloating data service provider.
Therefore this service is not available by default.
</aside>

### Accesses

| url | Result |
|--------------------------------------------------------|--------------------------------------------------------------------------------|
| `/coverage/{lon;lat}/coords/{lon;lat}/freefloatings_nearby` | List of objects near the resource, navitia guesses the region from coordinates |
| `/coord/{lon;lat}/freefloatings_nearby` | List of objects near the resource without any region id (same result as above) |
| `/coverage/{region_id}/coords/{lon;lat}/freefloatings_nearby` | List of objects near a coordinate |
| `/coverage/{region_id}/{resource_path}/freefloatings_nearby` | List of objects near the resource |

### Parameters

| Name | Type | Required | Default | Description |
|------------|--------|----------|---------|-------------|
| `type[]` | string | No | - | The type of shared mobility vehicles to return (e.g., `bike`, `scooter`, `car`). |
| `distance` | int | No | 500 | Search radius in meters. |
| `count` | int | No | 10 | Maximum number of results to return. |