diff --git a/examples/stop_ids_for_agency.py b/examples/stop_ids_for_agency.py new file mode 100644 index 0000000..dec4faa --- /dev/null +++ b/examples/stop_ids_for_agency.py @@ -0,0 +1,16 @@ + + +import onebusaway + + +def main_sync() -> None: + client = onebusaway.OnebusawaySDK(api_key="TEST") + agency_id = "40"; + stop_ids = client.stop_ids_for_agency.list(agency_id) + if stop_ids.data: + for stop_id in stop_ids.data.list: + print(stop_id) + + +if __name__ == "__main__": + main_sync() diff --git a/src/onebusaway/resources/stop_ids_for_agency.py b/src/onebusaway/resources/stop_ids_for_agency.py index 2b1dbee..a611a6e 100644 --- a/src/onebusaway/resources/stop_ids_for_agency.py +++ b/src/onebusaway/resources/stop_ids_for_agency.py @@ -54,7 +54,7 @@ def list( if not agency_id: raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}") return self._get( - f"/api/where/stop-ids-for-agency/agencyID.json", + f"/api/where/stop-ids-for-agency/{agency_id}.json", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -97,7 +97,7 @@ async def list( if not agency_id: raise ValueError(f"Expected a non-empty value for `agency_id` but received {agency_id!r}") return await self._get( - f"/api/where/stop-ids-for-agency/agencyID.json", + f"/api/where/stop-ids-for-agency/{agency_id}.json", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ),