GTFS generator for the Belgian Railway company in PHP
PHP Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

NMBS/SNCB to GTFS scraper

MIT StyleCI Join the chat at

Scrapes the Belgian railways and generates GTFS files for the current year.

If you're unsure what GTFS is, check the explanation at

Following traintypes are included: IC, ICE, L, P, S, TGV, THALYS, TRN and EXT

You can download a copy at:


We use the PHP package manager composer. Make sure it's installed and then run composer install from this directory. It's safe to run composer update each time you generate a new GTFS dump: the stations list is fetched over composer.

We also have a dependency for nodejs and npm. You will need this to generate the stations file.

Custom configuration

You can configure the start_date, end_date, feed_version, language and train_types of the GTFS-files by changing config.php in your favorite editor.

By default, the $TEST variable is set to true, which means that you are only going to scrape 1 day. Set this to false to scrape 3 months of data

Generating the GTFS file

There are a couple of scripts in the scripts folder. Run them in order. The scraped results will be in the dist folder.

mkdir dist

Afterwards, go to the dist folder, and create a zip archive:

cd dist/
zip *
# remove them for the next run
rm *.txt

Your NMBS/SNCB GTFS file is now ready for publishing!