Newbie Paintball Master

    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    ➡️ Installation | Quick Start ⬅️


    Download GTFS-Realtime data as JSON


    GTFS-realtime transit data is in protobuf format which means its not human-readable by default. node-GTFS-Realtime aims to make it fast and easy to inspect GTFS-realtime data by providing a one-line command for downloading GTFS-realtime format data and converting to JSON.

    Run it right now from your command line:

    npx gtfs-realtime

    The command above will fetch BART's GTFS-Realtime trip updates and save them to a file to the current directory in JSON format, named like gtfs-realtime-2022-05-28T002330.164Z.json (using the current time). You can open the resulting file in a text editor to review.

    node-GTFS-Realtime can be used as a command-line tool or as a node.js module.

    Example JSON

    Below is an example of the JSON result for a GTFS-Realtime Trip Updates request:

      "header": {
        "gtfsRealtimeVersion": "1.0",
        "incrementality": "FULL_DATASET",
        "timestamp": "1653701655"
      "entity": [
          "id": "1001663",
          "tripUpdate": {
            "trip": {
              "tripId": "1001663",
              "scheduleRelationship": "SCHEDULED"
            "stopTimeUpdate": [
                "stopSequence": 13,
                "arrival": {
                  "delay": 25,
                  "time": "1653701754",
                  "uncertainty": 30
                "departure": {
                  "delay": 25,
                  "time": "1653701775",
                  "uncertainty": 30
                "stopId": "SANL"


    If you would like to use this library as a command-line utility, you can install it globally directly from npm:

    npm install gtfs-realtime -g

    Or you can use it directly via npx:

    npx gtfs-realtime

    If you are using this as a node module as part of an application, you can include it in your project's package.json file.

    Quick Start

    Command-Line Examples

    Run via npx:

    npx gtfs-realtime

    If installed globally:


    With custom HTTP headers

    gtfs-realtime --header "Authorization: bearer 1234567"

    Code example

    import gtfsRealtime from 'gtfs';
    const config = {
      url: '',
      output: '/path/to/save/file.json',
      header: ['Authorization: bearer 12345'],
      .then(() => {
        console.log('Import Successful');
      .catch((err) => {

    Command-Line Usage

    gtfs-realtime [options...] <url>
    The `gtfs-realtime` command-line utility will download GTFS-Realtime data from the specified URL and save it as a JSON file.
    ### Options
    `-s, --silent`
    Hides all console output
        gtfs-realtime --silent
    `-H, --header`
    Specify one or more HTTP headers to be included in the request.
        gtfs-realtime --header "Authorization: bearer 1234567" --header "test:true"
    `-o, --output`
    Specify a path to save the JSON file. Optional, defaults to the current directory using a filename with the current time.
        gtfs-realtime --output /path/to/save/file.json
    Show help.
        gtfs-realtime --help
    Show version
        gtfs-realtime --version
    ## Contributing
    Pull requests are welcome, as is feedback and [reporting issues](
    ### Linting
        npm run lint


    npm i gtfs-realtime

    DownloadsWeekly Downloads






    Unpacked Size

    23 kB

    Total Files


    Last publish


    • brendannee