piemadd / amtrak

NPM library to get Amtrak tracking data.
GNU Affero General Public License v3.0
50 stars 4 forks source link

`/stations` endpoint broken #10

Closed owen-hayes closed 1 week ago

owen-hayes commented 5 months ago

As seen on https://amtraker.com/stations, calls to the /stations endpoint are returning incorrect data for lat, lon, address1, address2, city, state, zip.

For example, here is the response for /stations/CHI:

{
  "CHI": {
    "name": "Chicago Union",
    "code": "CHI",
    "tz": "America/Chicago",
    "lat": 0,
    "lon": 0,
    "address1": "ADDRESS1",
    "address2": "ADDRESS2",
    "city": "CITY",
    "state": "STATE",
    "zip": 0,
    "trains": [
      "3-4",
      "3-3",
      "4-4",
      "5-4",
      "5-3",
      "6-3",
      "6-4",
      "7-4",
      "7-3",
      "8-4",
      "8-3",
      "21-4",
      "21-3",
      "22-4",
      "29-4",
      "30-4",
      "49-4",
      "50-4",
      "58-4",
      "305-4",
      "306-4",
      "307-5",
      "318-4",
      "319-4",
      "339-4",
      "340-4",
      "352-4",
      "354-4",
      "355-4",
      "364-4",
      "370-4",
      "382-4",
      "383-4",
      "392-4",
      "393-4"
    ]
  }
}
kunwarsahni01 commented 4 months ago

Seeing the same issue

piemadd commented 4 months ago

Hey, this was a temporary fix for Amtrak's stations API being down. Since the API seems to be back, I should have a fix out today, if not by the end of the week.

piemadd commented 1 week ago

There is now a hasAddress attribute on each station to allow for checking whether a station has address data available. This shouldn't happen with Amtrak stations, but VIA doesn't provide address data.