# CityBikes API

> Returns bike-share networks worldwide, live station bike and dock availability, and the networks and stations nearest a position.

Category: Travel, Maps & Weather. Region: global. 4 endpoints at `https://api.hoshime.com/v1/citybikes/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/citybikes
## GET /v1/citybikes/networks

The bike-share networks of the world, optionally only those of one country.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `country` | string | no | ISO 3166 country code, such as FR. Empty lists every country. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `city` (string), `companies` (Company[]), `companies[].name` (string), `country` (string), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string)

```bash
curl "https://api.hoshime.com/v1/citybikes/networks" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/citybikes/network

One bike-share network with its city and the live state of its stations.

Scope: `social:read` · Units: 1 · Cached: 1 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Network id, such as velib or citi-bike-nyc. (e.g. velib) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `city` (string), `companies` (Company[]), `companies[].name` (string), `country` (string), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string), `stations` (Station[]), `stations[].emptySlots` (integer (int64)), `stations[].freeBikes` (integer (int64)), `stations[].id` (string), `stations[].latitude` (number (double)), `stations[].longitude` (number (double)), `stations[].name` (string), `stations[].reportedAt` (string)

```bash
curl "https://api.hoshime.com/v1/citybikes/network?id=velib" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/citybikes/nearbyNetworks

The bike-share networks whose city is nearest a position, closest first, with the distance in kilometres.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lat` | string | yes | Latitude, from -90 to 90, such as 48.8566. (e.g. 48.8566) |
| `lon` | string | yes | Longitude, from -180 to 180, such as 2.3522. (e.g. 2.3522) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `city` (string), `companies` (Company[]), `companies[].name` (string), `country` (string), `distanceKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string)

```bash
curl "https://api.hoshime.com/v1/citybikes/nearbyNetworks?lat=48.8566&lon=2.3522" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/citybikes/nearbyStations

The stations of one network nearest a position, closest first, with their bikes and free docks now.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `network` | string | yes | Network id, such as velib. (e.g. velib) |
| `lat` | string | yes | Latitude, from -90 to 90, such as 48.8566. (e.g. 48.8566) |
| `lon` | string | yes | Longitude, from -180 to 180, such as 2.3522. (e.g. 2.3522) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `distanceKm` (number (double)), `emptySlots` (integer (int64)), `freeBikes` (integer (int64)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string), `reportedAt` (string)

```bash
curl "https://api.hoshime.com/v1/citybikes/nearbyStations?network=velib&lat=48.8566&lon=2.3522" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
