{"id":17370175,"url":"https://github.com/juliuste/eurolines-de","last_synced_at":"2025-10-31T07:31:24.136Z","repository":{"id":57231076,"uuid":"97647642","full_name":"juliuste/eurolines-de","owner":"juliuste","description":"Client for the eurolines.de coach travel API.","archived":false,"fork":false,"pushed_at":"2020-06-01T07:40:43.000Z","size":129,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T03:13:36.218Z","etag":null,"topics":["bus","coach","library","public-transport"],"latest_commit_sha":null,"homepage":"","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":null,"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-07-18T21:59:43.000Z","updated_at":"2023-06-09T22:43:21.000Z","dependencies_parsed_at":"2022-09-04T20:02:35.588Z","dependency_job_id":null,"html_url":"https://github.com/juliuste/eurolines-de","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Feurolines-de","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Feurolines-de/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Feurolines-de/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliuste%2Feurolines-de/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliuste","download_url":"https://codeload.github.com/juliuste/eurolines-de/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239139709,"owners_count":19588246,"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":["bus","coach","library","public-transport"],"created_at":"2024-10-16T00:31:45.107Z","updated_at":"2025-10-31T07:31:18.859Z","avatar_url":"https://github.com/juliuste.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eurolines-de\n\nJavaScript client for the [eurolines.de](https://www.eurolines.de/) coach travel API. Complies with the [friendly public transport format](https://github.com/public-transport/friendly-public-transport-format). *In progess…*\n\n[![npm version](https://img.shields.io/npm/v/eurolines-de.svg)](https://www.npmjs.com/package/eurolines-de)\n[![Build Status](https://travis-ci.org/juliuste/eurolines-de.svg?branch=master)](https://travis-ci.org/juliuste/eurolines-de)\n[![Greenkeeper badge](https://badges.greenkeeper.io/juliuste/eurolines-de.svg)](https://greenkeeper.io/)\n[![dependency status](https://img.shields.io/david/juliuste/eurolines-de.svg)](https://david-dm.org/juliuste/eurolines-de)\n[![dev dependency status](https://img.shields.io/david/dev/juliuste/eurolines-de.svg)](https://david-dm.org/juliuste/eurolines-de#info=devDependencies)\n[![license](https://img.shields.io/github/license/juliuste/eurolines-de.svg?style=flat)](LICENSE)\n[![chat on gitter](https://badges.gitter.im/juliuste.svg)](https://gitter.im/juliuste)\n\n## Installation\n\n```shell\nnpm install --save eurolines-de\n```\n\n## Usage\n\nThis package contains data in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format).\n\n### `stations([query], [opt])`\n\nGet all stations operated bei eurolines.\n\n```js\nconst stations = require('eurolines-de').stations\n\nstations().then(console.log) // all stations\n\nstations('Berl') // search for stations\nstations({origin: 'Berlin'}) // search for stations reachable by the station with id 'Berlin'\nstations('Frankf', {origin: 'Berlin'}) // search in stations reachable from Berlin\n```\n\nSearches stations based on `query`. If no `query` parameter is found, returns all stations (still regarding `opt` instead).\n\nThe defaults for `opt` look like this:\n\n```js\n{\n    language: 'de',\n    origin: null // set to specific station id to filter for stations reachable by there\n}\n```\n\nReturns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) that will resolve in an array of `station`s in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format) which looks as follows:\n\n```js\n[\n    {\n        type: 'station',\n        id: 'Aachen',\n        name: 'Aachen (DE)'\n    },\n    {\n        type: 'station',\n        id: 'Aalborg',\n        name: 'Aalborg (DK)'\n    },\n    {\n        type: 'station',\n        id: 'Aalen',\n        name: 'Aalen (DE)'\n    }\n    // …\n]\n```\n\n### `journeys(origin, destination, date = Date.now(), opt = {})`\n\nGet directions and prices for routes from A to B. ***scraped 😕***\n\n```js\nconst journeys = require('eurolines-de').journeys\n\njourneys('Berlin', 'Paris', new Date(), {passengers: 1})\n.then(console.log)\n.catch(console.error)\n```\n\n`defaults`, partially overridden by the `opt` parameter, looks like this:\n\n```js\nconst defaults = {\n    passengers: 1\n}\n```\n\nReturns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) that will resolve with an array of `journey`s in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format) which looks as follows.\n*Note that the legs are not fully spec-compatible, as the `schedule` is missing in legs, all dates are Date() objects instead of ISO strings and due to API-specific reasons, there will always only be one leg and the additional `transfers` key instead.*\n\n```js\n[\n    {\n        origin: 'Berlin',\n        destination: 'Paris',\n        type: 'journey',\n        id: 'BerlinParisWed Jul 19 2017 19:30:00 GMT+0200 (CEST)Thu Jul 20 2017 09:45:00 GMT+0200 (CEST)0',\n        departure: '2017-07-19T17:30:00.000Z', // JS Date() object\n        arrival: '2017-07-20T07:45:00.000Z', // JS Date() object\n        transfers: 0,\n        price: {\n            currency: 'EUR',\n            amount: 83,\n            fares: [\n                {\n                    type: 'fare',\n                    model: 'normal',\n                    price: {\n                        currency: 'EUR',\n                        amount: 83\n                    }\n                }\n            ]\n        },\n        legs: [\n            {\n                origin: 'Berlin',\n                destination: 'Paris',\n                departure: '2017-07-19T17:30:00.000Z', // JS Date() object\n                arrival: '2017-07-20T07:45:00.000Z' // JS Date() object\n            }\n        ]\n    }\n    // …\n]\n```\n\n## See also\n\n- [FPTF](https://github.com/public-transport/friendly-public-transport-format) - \"Friendly public transport format\"\n- [FPTF-modules](https://github.com/public-transport/friendly-public-transport-format/blob/master/modules.md) - modules that also use FPTF\n\n## Contributing\n\nIf you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit [the issues page](https://github.com/juliuste/eurolines-de/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliuste%2Feurolines-de","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliuste%2Feurolines-de","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliuste%2Feurolines-de/lists"}