# 自行車 (https://nolantw.github.io/tdx/guides/bike/)

`bike_station()` 以站點 UID 取得一個租借站與即時數量，查無站點時為 `None`：

```python
status = client.bike_station("Taipei", "TPE500101001")
if status and status.availability:
    print(status.station.name, status.availability.available_to_rent)
```

批次查詢縣市的租借站、即時數量與自行車道：

```python
for station in client.bike.stations("Taipei"):
    print(station.uid, station.name, station.capacity, station.position)

for live in client.bike.availability("Taipei"):
    print(live.uid, live.available_to_rent, live.available_to_return)

for lane in client.bike.cycling_routes("Taipei"):
    print(lane)
```

`rental_counts` 將可借車輛分為一般自行車與電動輔助車。所有參數與欄位見[自行車 API](/reference/bike)。