{"id":37213832,"url":"https://github.com/rijdendetreinen/gotrain","last_synced_at":"2026-01-18T17:09:05.754Z","repository":{"id":41141973,"uuid":"175093454","full_name":"rijdendetreinen/gotrain","owner":"rijdendetreinen","description":"HTTP API for train departures, arrivals and trip details. Transforms real-time status messages to a REST API.","archived":false,"fork":false,"pushed_at":"2025-08-21T14:45:52.000Z","size":4510,"stargazers_count":43,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-22T14:55:53.089Z","etag":null,"topics":["api-server","departure-board","golang","netherlands","public-transport","train-information"],"latest_commit_sha":null,"homepage":"https://www.rijdendetreinen.nl","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rijdendetreinen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-11T22:28:19.000Z","updated_at":"2025-10-09T20:29:36.000Z","dependencies_parsed_at":"2024-06-20T02:55:27.470Z","dependency_job_id":"868eda17-4d9a-4772-8113-168a6375480a","html_url":"https://github.com/rijdendetreinen/gotrain","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/rijdendetreinen/gotrain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijdendetreinen%2Fgotrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijdendetreinen%2Fgotrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijdendetreinen%2Fgotrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijdendetreinen%2Fgotrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rijdendetreinen","download_url":"https://codeload.github.com/rijdendetreinen/gotrain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rijdendetreinen%2Fgotrain/sbom","scorecard":{"id":776378,"data":{"date":"2025-08-11","repo":{"name":"github.com/rijdendetreinen/gotrain","commit":"24c26b93f5785651508f193006df50ac3bb4b8f0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'packages' permission set to 'read': .github/workflows/codeql.yml:36","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:39","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:40","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/docker.yml:3","Info: topLevel 'contents' permission set to 'read': .github/workflows/go.yml:6","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docker.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/docker.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/go.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/rijdendetreinen/gotrain/go.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:13: pin your Docker image by updating debian to debian@sha256:6d87375016340817ac2391e670971725a9981cfc24e221c47734681ed0f6c0f5","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/docker.yml:16"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (4) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3787 / GHSA-fv92-fjc5-jj9h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T03:44:35.476Z","repository_id":41141973,"created_at":"2025-08-23T03:44:35.476Z","updated_at":"2025-08-23T03:44:35.476Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-server","departure-board","golang","netherlands","public-transport","train-information"],"created_at":"2026-01-15T00:42:09.501Z","updated_at":"2026-01-15T00:42:10.213Z","avatar_url":"https://github.com/rijdendetreinen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GoTrain\n=======\n\n![Go](https://github.com/rijdendetreinen/gotrain/workflows/Go/badge.svg)\n[![codecov](https://codecov.io/gh/rijdendetreinen/gotrain/branch/master/graph/badge.svg)](https://codecov.io/gh/rijdendetreinen/gotrain)\n[![Maintainability](https://api.codeclimate.com/v1/badges/e35ed750fa4facc99e92/maintainability)](https://codeclimate.com/github/rijdendetreinen/gotrain/maintainability)\n\nGoTrain is a server application for receiving, processing and distributing\nreal-time data about train services in the Netherlands.\n\nGoTrain is designed to continuously receive data streams offered as open data\nby the [Dutch Railways (NS)](http://www.ns.nl/). The data is processed and\nsaved in-memory in order to offer a very fast REST API, which can be used by\nnumerous clients to show live information about train departures, arrivals etc.\n\nGoTrain is currently able to process the following data streams:\n\n* Arrivals (arriving service at a station)\n* Departures (departing service from a station)\n* Services (data about a complete trip for a single train)\n\nAnd it offers the received data through a number of REST APIs, which allow you\nto:\n\n* Request a summary of all departing trains for a single station\n* Detailed information for a departing train\n* All upcoming arrivals for a single station\n* Detailed information about a single train journey\n\nYou can also use GoTrain to store all services to a Redis queue for further\nprocessing (archive function).\n\nIt is easy to extend GoTrain's functionality or to build your own applications\nusing the REST API. For example: create your live departures board, or analyze\nwhich trains are currently delayed or cancelled on the Dutch rail network.\n\nREST API\n--------\n\nGoTrain includes a convenient REST API. \n\nAn example request: Request all departures from Utrecht Centraal: \n`/v2/departures/station/UT`\n\nResponse (shortened):\n\n```json\n{\n    \"departures\": [\n        {\n            \"cancelled\": false,\n            \"company\": \"NS\",\n            \"delay\": 0,\n            \"departure_time\": \"2019-07-14T00:49:00+02:00\",\n            \"destination_actual\": \"'t Harde\",\n            \"destination_actual_codes\": [\n                \"HDE\"\n            ],\n            \"destination_planned\": \"'t Harde\",\n            \"name\": null,\n            \"platform_actual\": \"12\",\n            \"platform_changed\": false,\n            \"platform_planned\": \"12\",\n            \"remarks\": [],\n            \"service_date\": \"2019-07-13\",\n            \"service_id\": \"591\",\n            \"service_number\": \"591\",\n            \"station\": \"UT\",\n            \"status\": 2,\n            \"timestamp\": \"2019-07-13T22:49:00Z\",\n            \"tips\": [\n                \"Stopt ook in Harderwijk\"\n            ],\n            \"type\": \"Intercity\",\n            \"type_code\": \"IC\",\n            \"via\": \"Amersfoort\",\n            \"wings\": []\n        }\n   ],\n    \"status\": \"UP\"\n}\n```\n\nThe following endpoints are available:\n\n* `/` - API version\n* `/v2/status` - System status\n* `/v2/arrivals/stats` - Arrival statistics\n* `/v2/arrivals/station/{station}` - Arrivals for `{station}` (e.g. `UT`)\n* `/v2/arrivals/arrival/{id}/{station}/{date}` - Specific arrival details\n* `/v2/departures/stats` - Departures statistics\n* `/v2/departures/station/{station}` - Departures for `{station}` (e.g. `UT`)\n* `/v2/departures/departure/{id}/{station}/{date}` - Specific departure details\n* `/v2/services/stats` - Services statistics\n* `/v2/services/service/{service_number}/{date}` - Specific service details\n\nThe full API documentation, including parameters and response formats, is included\nin the [GoTrain OpenAPI specification](openapi.yaml). Or check out the nicely\nformatted [GoTrain API on Apiary](https://rijdendetreinen.docs.apiary.io/).\n\nArchiver\n--------\n\nThe archive function allows you to store all data to an archive for further\nprocessing or analysis at a later time. When running `gotrain archiver`,\nGoTrain simply pushes all received services to a Redis queue (in JSON format).\n\nPrometheus\n----------\n\nA [Prometheus](https://prometheus.io/) integration is included to expose metrics about recieved messages\nand API requests. This integration can be enabled optionally on a separate port.\n\nInstallation\n------------\n\nBinary packages will be provided in a future update. For now, the best way to install GoTrain is by\n[downloading the source code](https://github.com/rijdendetreinen/gotrain/releases) and manually compile\nthe application.\n\n1. Download source code\n2. Install dependencies: `go get`\n3. Compile: `go build`\n\nNow, configure the application:\n\n4. Go the the `config/` directory\n5. Copy `example.yaml` to `config.yaml`\n6. Modify the configuration parameters. Change at least the 'server' line (which should point to the NDOV ZeroMQ server - see below), and the API port (unless you want to run on port 8080).\n\nConfiguration is also possible with environment variables. Example:\n```bash\nAPI_ADDRESS=:8080\nSOURCE_SERVER=tcp://pubsub.besteffort.ndovloket.nl:7664\nSOURCE_ENVELOPES_ARRIVALS=/RIG/InfoPlusDASInterface4\nSOURCE_ENVELOPES_DEPARTURES=/RIG/InfoPlusDVSInterface4\nSOURCE_ENVELOPES_SERVICES=/RIG/InfoPlusRITInterface2\n```\n\nUsage\n-----\n\n7. Start your server by running `./gotrain server`.\n8. GoTrain keeps all information in memory, so you should aim to keep the server running for a long time.\n   Process monitors like [supervisord](http://supervisord.org/) may help with that.\n9. The REST API should be available on the address you have specified in your configuration file.\n\nThe CLI interface of GoTrain also allows you to:\n\n* Request the current status of your server: \n  `./gotrain status -u http://localhost:8080/` \n  Initially, your server will have the status UNKNOWN and then RECOVERING, as it slowly starts to build up a complete dataset.\n  Arrivals and departures should be UP after approximately 80 minutes.\n* Inspect a single XML message, for example: \n  `./gotrain inspect departure parsers/testdata/departure.xml` \n* Run `./gotrain help` to show all commands.\n\nDocker\n------\nIt is also possible to deploy GoTrain with Docker.\n```bash\ndocker build -t gotrain\n```\nRunning the container:\n```bash\ndocker run gotrain\n```\n(To use environment variables with docker, add them with `-e KEY=VALUE`)\n\nYou can also use the official [GoTrain Docker image](https://hub.docker.com/r/rijdendetreinen/gotrain) which is updated with the latest release.\n\nData feed\n---------\n\nYou need access to a data feed from NS called InfoPlus. This data feed is distributed freely by the [NDOVloket](https://ndovloket.nl/).\n\nTip: you can find a public best-effort data feed from the NDOV on this page: [NDOVloket realtime](http://data.ndovloket.nl/REALTIME.TXT).\nYou need the address listed for 'NS InfoPlus', likely in the format `tcp://pubsub.besteffort.ndovloket.nl:...` \nConsider [signing up](https://ndovloket.nl/aanmelden/) for free if you are planning to use this application for production purposes.\nThe data feed is the same, but it's covered by a SLA, and it helps NDOVloket to keep track of their users.\n\nDevelopment roadmap\n-------------------\n\nThe main objectives for GoTrain have now been developed, but there is a roadmap\nfor further development. The main planned improvements are:\n\n* Increase test coverage - the API is currently not tested\n* Packaging - make it easier to install gotrain on a server by just downloading\n  and installing the binaries\n\nStatus\n------\n\nGoTrain is currently being used in production by\n[Rijden de Treinen](https://www.rijdendetreinen.nl/) as a source for realtime\ndeparture times, arrivals and for trip details, both on the website and in the\nmobile app. Please let it known when you use GoTrain for a cool project, a big\napplication or for some other purpose!\n\nLicense\n-------\n\nCopyright (c) 2019-2025 Geert Wirken, Rijden de Treinen\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frijdendetreinen%2Fgotrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frijdendetreinen%2Fgotrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frijdendetreinen%2Fgotrain/lists"}