API 參考
自行車
Bike
stations
def stations(
city: City | str,
*,
station_uid: str | None = None,
query: Query[BikeStation] | QueryParams | None = None,
limit: int | None = None,
offset: int = 0,
cache_ttl: float | None = None,
) -> Records[BikeStation] 取得租借站點,可指定站點 UID。
availability
def availability(
city: City | str,
*,
station_uid: str | None = None,
query: Query[BikeAvailability] | QueryParams | None = None,
limit: int | None = None,
offset: int = 0,
cache_ttl: float | None = None,
) -> Records[BikeAvailability] 取得即時可借與可還數量。
cycling_routes
def cycling_routes(
city: City | str,
*,
query: Query[CyclingRoute] | QueryParams | None = None,
limit: int | None = None,
offset: int = 0,
cache_ttl: float | None = None,
) -> Records[CyclingRoute] 取得縣市的自行車道與線型。
BikeStation
class BikeStation(BaseModel):
uid: str
id: str
authority_id: str | None
name: Name
position: MaybePosition
address: Name | None
capacity: int
service_type: int
source_updated_at: MaybeTimestamp
updated_at: Timestamp
stop_description: str | None BikeRentalCounts
class BikeRentalCounts(BaseModel):
general: int | None
electric: int | None BikeAvailability
class BikeAvailability(BaseModel):
uid: str
id: str
service_status: int
service_type: int
available_to_rent: int
available_to_return: int
rental_counts: BikeRentalCounts | None
source_updated_at: MaybeTimestamp
updated_at: Timestamp CyclingRoute
class CyclingRoute(BaseModel):
name: str
city_code: str
city: str | None
town: str | None
start: str | None
end: str | None
length_meters: float | None
finished_time: str | None
geometry: str
encoded_polyline: str | None
updated_at: Timestamp
authority_name: str | None
direction: str | None
cycling_type: str | None