{"id":17367445,"url":"https://github.com/juliuste/interrail","last_synced_at":"2025-04-08T03:34:52.271Z","repository":{"id":56735782,"uuid":"81468948","full_name":"juliuste/interrail","owner":"juliuste","description":"Find european train stations and routes. Client for the European Interrail / EuRail API.","archived":true,"fork":false,"pushed_at":"2020-10-12T16:20:30.000Z","size":74,"stargazers_count":32,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T19:36:57.417Z","etag":null,"topics":["library","public-transport","railway"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliuste.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-09T16:13:52.000Z","updated_at":"2025-04-06T19:27:40.000Z","dependencies_parsed_at":"2022-08-16T00:50:44.910Z","dependency_job_id":null,"html_url":"https://github.com/juliuste/interrail","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Finterrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Finterrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Finterrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Finterrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliuste","download_url":"https://codeload.github.com/juliuste/interrail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247772938,"owners_count":20993627,"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":["library","public-transport","railway"],"created_at":"2024-10-15T22:41:29.845Z","updated_at":"2025-04-08T03:34:51.961Z","avatar_url":"https://github.com/juliuste.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# interrail\n\nFind european train stations and journeys. Client for the European [Interrail](http://interrail.eu) / EuRail API. Inofficial, using endpoints by *Interrail/EuRail*. Ask them for permission before using this module in production.\n\nThis module conforms to the [FPTI-JS `0.3.2` standard](https://github.com/public-transport/fpti-js/tree/0.3.2) for JavaScript public transportation modules.\n\n[![npm version](https://img.shields.io/npm/v/interrail.svg)](https://www.npmjs.com/package/interrail)\n[![Build Status](https://travis-ci.org/juliuste/interrail.svg?branch=master)](https://travis-ci.org/juliuste/interrail)\n[![license](https://img.shields.io/github/license/juliuste/interrail.svg?style=flat)](LICENSE)\n[![fpti-js version](https://fpti-js.badges.juliustens.eu/badge/juliuste/interrail)](https://fpti-js.badges.juliustens.eu/link/juliuste/interrail)\n[![chat on gitter](https://badges.gitter.im/public-transport.svg)](https://gitter.im/public-transport)\n\n## Installation\n\n```sh\nnpm install interrail\n```\n\n## Usage\n\n```js\nconst interrail = require('interrail')\n```\n\nThe `interrail` module conforms to the [FPTI-JS `0.3.2` standard](https://github.com/public-transport/fpti-js/tree/0.3.2) for JavaScript public transportation modules and exposes the following methods:\n\nMethod | Feature description | [FPTI-JS `0.3.2`](https://github.com/public-transport/fpti-js/tree/0.3.2)\n-------|---------------------|--------------------------------------------------------------------\n[`stations.search(query, [opt])`](#stationssearchquery-opt) | Search stations by *query*. | [✅ yes](https://github.com/public-transport/fpti-js/blob/0.3.2/docs/stations-stops-regions.search.md)\n[`journeys(origin, destination, [opt])`](#journeysorigin-destination-opt) | Journeys between stations | [✅ yes](https://github.com/public-transport/fpti-js/blob/0.3.2/docs/journeys.md)\n\n---\n\n### `stations.search(query, [opt])`\n\nSearch stations by *query*. See [this method in the FPTI-JS `0.3.2` spec](https://github.com/public-transport/fpti-js/blob/0.3.2/docs/stations-stops-regions.search.md).\n\n#### Supported Options\n\nAttribute | Description | FPTI-spec | Value type | Default\n----------|-------------|------------|------------|--------\n`results` | Max. number of results returned | ✅ | `Number` | `null`\n\n#### Example\n\n```js\ninterrail.stations.search('Ljubl', { results: 1 }).then(…)\n```\n\n```js\n[\n\t{\n\t\t\"type\": \"station\",\n\t\t\"id\": \"7942300\",\n\t\t\"name\": \"LJUBLJANA (Slovenia)\",\n\t\t\"location\": {\n\t\t\t\"type\": \"location\",\n\t\t\t\"longitude\": 14.51028,\n\t\t\t\"latitude\": 46.058057\n\t\t},\n\t\t\"weight\": 12185,\n\t\t\"products\": 28\n\t}\n]\n```\n\n---\n\n### `journeys(origin, destination, [opt])`\n\nFind journeys between stations. See [this method in the FPTI-JS `0.3.2` spec](https://github.com/public-transport/fpti-js/blob/0.3.2/docs/journeys.md).\n\n#### Supported Options\n\nAttribute | Description | FPTI-spec | Value type | Default\n----------|-------------|------------|------------|--------\n`when` | Journey date, synonym to `departureAfter` | ✅ | [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/date) | `new Date()`\n`departureAfter` | List journeys with a departure (first leg) after this date | ✅ | [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/date) | `new Date()`\n`results` | Max. number of results returned | ✅ | `Number` | `null`\n`interval` | Results for how many minutes after `when`/`departureAfter` | ✅ | `Number` | `null`\n`transfers` | Max. number of transfers | ✅ | `Number` | `null`\n`language` | Language of the results | ❌ | [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) | `null`\n\n#### Example\n\n```js\nconst berlin = '8065969' // station id\nconst ljubljana = { // FPTF station\n\ttype: 'station',\n\tid: '7942300',\n\tname: 'Ljubljana'\n\t// …\n}\n\ninterrail.journeys(berlin, ljubljana, { when: new Date('2018-11-02T05:00:00+0200') }).then(…)\n```\n\n```js\n[\n\t{\n\t\t\"id\": \"8065969-2018-11-02t06-37-00…\",\n\t\t\"legs\": [\n\t\t\t{\n\t\t\t\t\"arrival\": \"2018-11-02T06:54:00+01:00\",\n\t\t\t\t\"departure\": \"2018-11-02T06:37:00+01:00\",\n\t\t\t\t\"destination\": {\n\t\t\t\t\t\"id\": \"8003025\",\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"latitude\": 52.534722,\n\t\t\t\t\t\t\"longitude\": 13.196947,\n\t\t\t\t\t\t\"type\": \"location\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"BERLIN-SPANDAU (Germany)\",\n\t\t\t\t\t\"type\": \"station\"\n\t\t\t\t},\n\t\t\t\t\"id\": \"8065969-2018-11-02t06-37-00-01-00-8003025-2018-11-02t06-54-00-01-00-rb-18604\",\n\t\t\t\t\"line\": {\n\t\t\t\t\t\"id\": \"rb-18604\",\n\t\t\t\t\t\"mode\": \"train\",\n\t\t\t\t\t\"name\": \"RB 18604\",\n\t\t\t\t\t\"public\": true,\n\t\t\t\t\t\"type\": \"line\"\n\t\t\t\t},\n\t\t\t\t\"mode\": \"train\",\n\t\t\t\t\"operator\": \"interrail\",\n\t\t\t\t\"origin\": {\n\t\t\t\t\t\"id\": \"8065969\",\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"latitude\": 52.525553,\n\t\t\t\t\t\t\"longitude\": 13.369441,\n\t\t\t\t\t\t\"type\": \"location\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"BERLIN HBF (Germany)\",\n\t\t\t\t\t\"type\": \"station\"\n\t\t\t\t},\n\t\t\t\t\"public\": true\n\t\t\t}\n\t\t\t// …\n\t\t\t{\n\t\t\t\t\"arrival\": \"2018-11-02T18:32:00+01:00\",\n\t\t\t\t\"departure\": \"2018-11-02T12:17:00+01:00\",\n\t\t\t\t\"destination\": {\n\t\t\t\t\t\"id\": \"7942300\",\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"latitude\": 46.058057,\n\t\t\t\t\t\t\"longitude\": 14.51028,\n\t\t\t\t\t\t\"type\": \"location\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"LJUBLJANA (Slovenia)\",\n\t\t\t\t\t\"type\": \"station\"\n\t\t\t\t},\n\t\t\t\t\"id\": \"8020347-2018-11-02t12-17-00-01-00-7942300-2018-11-02t18-32-00-01-00-ec-113\",\n\t\t\t\t\"line\": {\n\t\t\t\t\t\"id\": \"ec-113\",\n\t\t\t\t\t\"mode\": \"train\",\n\t\t\t\t\t\"name\": \"EC   113\",\n\t\t\t\t\t\"public\": true,\n\t\t\t\t\t\"type\": \"line\"\n\t\t\t\t},\n\t\t\t\t\"mode\": \"train\",\n\t\t\t\t\"operator\": \"interrail\",\n\t\t\t\t\"origin\": {\n\t\t\t\t\t\"id\": \"8020347\",\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"latitude\": 48.140274,\n\t\t\t\t\t\t\"longitude\": 11.55833,\n\t\t\t\t\t\t\"type\": \"location\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"MUENCHEN HBF (Germany)\",\n\t\t\t\t\t\"type\": \"station\"\n\t\t\t\t},\n\t\t\t\t\"public\": true\n\t\t\t}\n\t\t],\n\t\t\"type\": \"journey\"\n\t}\n\t// …\n]\n```\n\n## Contributing\n\nIf you found a bug or want to propose a feature, feel free to visit [the issues page](https://github.com/juliuste/interrail/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliuste%2Finterrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliuste%2Finterrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliuste%2Finterrail/lists"}