0

I'm trying use Wmata's metro gtfs apis but I'm not getting anything back. I tried using a fetch and also their own javascript example but I keep getting this type of response back.

enter image description here

I am able to get a response from their other feeds but just not any of the gtfs ones. When I try using postman I get a bunch of gibberish:

1495323752907:32:0020200213 *RED0ǃ��"9360(˅��"7993(����"3969(ш��"22094(����"3542(㋕�"2640(����"4387(͎��"4364( ����"5660(

I don't get what's going on.

const url =
  "https://api.wmata.com/gtfs/rail-gtfs-static.zip?api_key=e13626d03d8e4c03ac07f95541b3091b";

let config = {
  method: "GET",
  mode: "no-cors"
};

fetch(url, config)
  .then(res => console.log("res", res))
  .catch(err => console.log("err", err));
meijiOrO
  • 411
  • 4
  • 7
  • 14
  • Looks like you're getting a zip-file from the API with the given URL. – Teemu Feb 13 '20 at 15:05
  • 2
    Paste the link into your browser, it should start downloading a ZIP file for you. Your code should process the response as a file (in this case a .zip) instead of a text response. – lordvlad30 Feb 13 '20 at 15:06
  • The other gtfs feed is https://api.wmata.com/gtfs/rail-gtfsrt-tripupdates.pb, is this a download and process thing also? I tried downloading it but I can't open the file anywhere. – meijiOrO Feb 13 '20 at 18:47

0 Answers0