@hasadna/open-bus-api-client
Version:
A client library for interacting with the Open-Bus API.
52 lines (38 loc) β’ 1.84 kB
Markdown
# π Open Bus API Client
A TypeScript client library for interacting with the Open-Bus API.
## π’ Get Involved
- π¬ For general help and system updates, join the Hasadna Slack: [#open-bus channel](https://join.slack.com/t/hasadna/shared_invite/zt-167h764cg-J18ZcY1odoitq978IyMMig)
- π Found a bug or have a feature request? [Open an issue](https://github.com/hasadna/open-bus-map-search/issues/new)
- π€ Want to contribute? See our [contributing guidelines](https://github.com/hasadna/open-bus-pipelines/blob/main/CONTRIBUTING.md)
## π Related Projects
- [πΊοΈ Open Bus Map Search (Client App)](https://github.com/hasadna/open-bus-map-search) - [Live Website](https://open-bus-map-search.hasadna.org.il/dashboard)
- [π¦ Open Bus API Client (API Package Generator)](https://github.com/hasadna/open-bus-api-client)
- [π Open Bus Stride API (REST)](https://github.com/hasadna/open-bus-stride-api) β [API Docs](https://open-bus-stride-api.hasadna.org.il/docs)
- [π Open Bus Backend (REST)](https://github.com/hasadna/open-bus-backend) β [API Docs](https://open-bus-backend.k8s.hasadna.org.il/docs)
## π¦ Installation
```bash
npm install @hasadna/open-bus-api-client
````
## π§ Usage
```ts
import {
AggregationsApi,
ComplaintsApi,
GovernmentTransportationApi,
GtfsApi,
HealthApi,
IssuesApi,
SiriApi,
} from "@hasadna/open-bus-api-client";
// URL: https://open-bus-stride-api.hasadna.org.il
const Aggregations = AggregationsApi("URL");
const Gtfs = GtfsApi("URL");
const Siri = SiriApi("URL");
// URL: https://open-bus-backend.k8s.hasadna.org.il
const Health = HealthApi("URL");
const Issues = IssuesApi("URL");
const Complaints = ComplaintsApi("URL");
const GovernmentTransportation = GovernmentTransportationApi("URL");
const stops = await Gtfs.getBusStops();
console.log(stops);
```