Static Timetables timeout


#1

I’m trying to download the Static Timetables (specifically Public Transport - Timetables - For Realtime) using the endpoint https://api.transport.nsw.gov.au:8443/v1/gtfs/schedule/sydneytrains like so:

curl -v -O test.zip -H "Authorization: Bearer XXXXXXXX-XXX-XXX-XXX-XXXXXXXXXXX" https://api.transport.nsw.gov.au:8443/v1/gtfs/schedule/sydneytrains

Unfortunately, the request times out. Is there a way around this?


#2

We’ve noticed this too. We’re looking into it.


#3

try
curl -v -O test.zip -H "Authorization: Bearer XXXXXXXX-XXX-XXX-XXX-XXXXXXXXXXX" https://api.transport.nsw.gov.au/v1/gtfs/schedule/sydneytrains

The docs endpoint includes :8443 which is not the correct port.


#4

Ahh! Thanks Nirving. I’m now able to download nswtrains like so:

curl -LkSs -o test.zip -H "Authorization: Bearer XXXXXXXX-XXX-XXX-XXX-XXXXXXXXXXX" https://api.transport.nsw.gov.au/v1/gtfs/schedule/nswtrains

However, downloading sydneytrains now appears to truncate the ZIP:

caution:  zipfile comment truncated
error [test.zip]:  missing 3237458933 bytes in zipfile
  (attempting to process anyway)
error [test.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

Do you have the same issue?


#5

Yes I do.


#6

I’ve had trouble with the live data timing out, with none of the fixes above helping… Any advice?

Request:

curl -X GET -H "Authorization: Bearer 4e46……" "https://api.transport.nsw.gov.au/v1/gtfs/vehiclepos/buses" -v

Response (verbose mode):


*   Trying 52.63.168.50...
* Connected to api.transport.nsw.gov.au (52.63.168.50) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: api.transport.nsw.gov.au
* Server certificate: Symantec Class 3 Secure Server CA - G4
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> GET /v1/gtfs/vehiclepos/buses HTTP/1.1
> Host: api.transport.nsw.gov.au
> User-Agent: curl/7.43.0
> Accept: */*
> Authorization: Bearer 4e46……
> 
< HTTP/1.1 504 GATEWAY_TIMEOUT
< Cache-control: no-cache="set-cookie"
< Set-Cookie: AWSELB=777BE349184966AA129955C33D987E6DD8D703B5EF4A7519C0F239B0DEF5976D23C251E17B243FA1120100A38CFDC57F4F47F05B5BFF538671E0CB5671F32FDB3B65D0A6F9;PATH=/
< Content-Length: 0
< Connection: keep-alive
< 
* Connection #0 to host api.transport.nsw.gov.au left intact

#7

We’re looking into it.

We’ll let you know when we have a resolution.

Thanks for letting us know.


#8

Just had a look at yours and see that you are trying to call the buses one. That one has the other issue as the realtime compatible schedule data isn’t available as a bundle and we’re working to get the individual contract area schedules made available via the API Gateway…


#9

hey guys, just wanted to make sure you all know this problem is resolved. Well kinda. The documentation says port 8443 but it’s actually plain old SSL which is port 443. Unfortunately we can’t change the documentation easily but if you can use port 443 you should be fine.


#10

Hey guys,
I’m also trying to download the Sydney Rail file, and I get “401 Unauthorized”. this is what I’m trying to run:
curl -v -O test.zip -H “Authorization: apikey l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” https://api.transport.nsw.gov.au/v1/gtfs/schedule/sydneytrains

and my api key is correct.
Do you know what’s goin on?

Thanks


#11

Seems to work fine for me. I notice you’re using the -O flag, but the output flag should be lowercase -o:

curl -v -o test.zip -H "Authorization: apikey l7xx..." https://api.transport.nsw.gov.au/v1/gtfs/schedule/sydneytrains

Maybe that’s the problem?


#12

Also, double check that “Public Transport - Timetables - For Realtime” is a selected API under API Management.

Go to Applications > (selecting your API key) Edit:


#13

Thank you @jxeeno! that helped a lot!


#14

Hi,

I’m trying to download the buses GTFS file, and I get: "Connection #0 to host api.transport.nsw.gov.au left intact"
this is what I’m trying to run:
curl -v -o buses.zip -H “Authorization: apikey lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” https://api.transport.nsw.gov.au/v1/gtfs/schedule/buses
I also have all the relevant API’s in the Applications section.

is there any problem?

Thank you


#15

That’s the expected response from curl. Are you able to read the buses.zip file that has been saved?


#16

I can’t open the buses.zip file that was created. I’m getting ‘file is invalid’


#17

Interesting… mine works no problem.

Is the MD5 hash same as mine below?

$ md5 buses.zip
MD5 (buses.zip) = b3fcf7e17102789b639b81acf6001447

#18

no @jxeeno , I’m getting:

d804dc58cabfb35f467772e62403e0be


#19

@morpeer we have managed to replicate the problem with your credentials and will raise a ticket. Assume you have been previously successfully using the APIs?


#20

Your account has been updated and should now work.

Can you try again @morpeer?