PTV API – aka “Is my train on time today?”

17 January 2016 , In: automation , With: No Comments
0

Ever since Carlos setup the Mosquitto server, we have been receiving cute texts at 5 when it’s time to go home (only if our state is ‘at work’ of course, and there’s nothing more exciting in the calendar)… I still get excited seeing Friday’s “TGIF, it’s party time” message…

Of course the logical next step was to let us know about train departure info from our closest station, back towards home. It would make the decision to sprint or take it easy much simpler!

Enter Public Transport Victoria’s API... Still seemingly in its infancy, it took a couple of days after emailing APIKeyRequest@ptv.vic.gov.au for me to get a “Developer ID” and “Security Key”. Despite a lack of documentation and a few stumpers on direction (Why are there so many direction ids?) it wasn’t long before we were up and running with a bit of Python letting us know the time of the next 3 scheduled departures and what time those trains were really expected to leave the platform.

  1. Pingback: » DIY Weather Station (IOT stuff – MQTT)Our Smart Castle

There are no comments yet. Be the first to comment.

Leave a Comment