{"id":18449448,"url":"https://github.com/public-transport/fpti-js","last_synced_at":"2025-04-16T19:41:31.166Z","repository":{"id":57241251,"uuid":"144043419","full_name":"public-transport/fpti-js","owner":"public-transport","description":"Standardized API for public transportation client libraries in JavaScript.","archived":false,"fork":false,"pushed_at":"2019-10-27T04:48:20.000Z","size":29,"stargazers_count":8,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T23:26:46.339Z","etag":null,"topics":["api-client","fptf","fpti","fpti-js","friendly-public-transport-format","friendly-public-transport-interface","public-transport","public-transportation"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/public-transport.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T16:58:25.000Z","updated_at":"2025-03-03T15:27:26.000Z","dependencies_parsed_at":"2022-09-07T23:13:15.296Z","dependency_job_id":null,"html_url":"https://github.com/public-transport/fpti-js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Ffpti-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Ffpti-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Ffpti-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/public-transport%2Ffpti-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/public-transport","download_url":"https://codeload.github.com/public-transport/fpti-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249128237,"owners_count":21217106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","fptf","fpti","fpti-js","friendly-public-transport-format","friendly-public-transport-interface","public-transport","public-transportation"],"created_at":"2024-11-06T07:20:10.759Z","updated_at":"2025-04-15T18:27:52.143Z","avatar_url":"https://github.com/public-transport.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# fpti-js\n\n**FPTI-JS (_Friendly Public Transport Interface_)** describes a standardized API for public transportation client libraries in JavaScript. See **[the spec](#api)** and the [list of JS modules](modules.md).\n\n**_Proposal, work in progress!_**\n\n[![npm version](https://img.shields.io/npm/v/fpti.svg)](https://www.npmjs.com/package/fpti)\n[![license](https://img.shields.io/github/license/public-transport/fpti-js.svg?style=flat)](license)\n[![chat on gitter](https://badges.gitter.im/juliuste.svg)](https://gitter.im/juliuste)\n\n## API\n\nThe purpose of this specification is to outline a standardized API for the *most common* features of public transportation libraries, such as *Journey planning*, *Departures/Arrivals* or *Station search*. While most libraries certainly don't cover all of the following features, the basic principle for modules complying to `fpti-js` is that **if a certain feature is available, it must be provided with the API described below**. Some modules may also include **additional functionalities** that are not covered within this specification, **as long as they don't use the reserved `fpti-js` method names**.\n\nFurthermore, even for additional features that are not covered within the following spec, `fpti-js` modules **return data in the [Friendly Public Transport Format](https://github.com/public-transport/friendly-public-transport-format/) `v1.x.x` wherever possible** and **use [`validate-fptf`](https://github.com/public-transport/validate-fptf) and [`fpti-tests`](https://github.com/juliuste/fpti-tests) in their tests**.\n\n### Method overview\n\nAll `method`s expose an object `method.features` which contains all supported options and simple descriptions of those options as keys and values, respectively. See the method specifications for examples.\n\nMethod | Feature description | Returns\n-------|---------------------|--------\n[`stations.all([opt])` / `stops.all([opt])` / `regions.all([opt])`](docs/stations-stops-regions.all.md) | **All** stations/stops/regions of the network. | [`Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) → [`station`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#station) / [`stop`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#stop) / [`region`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#region)\n[`stations.search(query, [opt])` / `stops.search(query, [opt])` / `regions.search(query, [opt])`](docs/stations-stops-regions.search.md) | Search stations/stops/regions by *query*. | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) → [`[station]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#station) / [`[stop]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#stop) / [`[region]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#region)\n[`stations.nearby(location, [opt])` / `stops.nearby(location, [opt])` / `regions.nearby(location, [opt])`](docs/stations-stops-regions.nearby.md) | Search stations/stops/regions by *location*. | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) → [`[station]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#station) / [`[stop]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#stop) / [`[region]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#region)\n[`journeys(origin, destination, [opt])`](docs/journeys.md) | Journeys between stations (or optionally other locations) | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) → [`[journey]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#journey)\n[`stopovers(station, [opt])`](docs/stopovers.md) | Departures and arrivals at a given station (or optionally other location) | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) → [`[stopover]`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#stopover)\n\n\u003c!--[`locations([opt])`](docs/locations) | **All** locations (stations, stops, POI, addresses) of the network. | [`Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) -\u003e [`location`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#location), [`station`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#station), [`stop`](https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md#stop)\n[`locations.search(query, [opt])`](docs/locations.search) | Search locations (stations, stops, POI, addresses) by *query*. | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) -\u003e `[location, station, stop]`\n[`locations.nearby(location, [opt])`](docs/locations.search) | Search locations (stations, stops, POI, addresses) by *location*. | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) -\u003e `[location, station, stop]`--\u003e\n\n\n## Contributing\n\nWe are looking forward to discuss \u0026 extend this format further! If you have a question or want to propose changes, visit [the issues page](https://github.com/public-transport/fpti-js/issues). Keep our [contributing guidelines in mind](contributing.md). Note that, by participating in this project, you commit to the [code of conduct](code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublic-transport%2Ffpti-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpublic-transport%2Ffpti-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublic-transport%2Ffpti-js/lists"}