Get realtime data


#1

hello, everyone,
I need to implement something like https://anytrip.com.au/map real-time

I have only RealtimeTripId.

can anyone help me that which API will give me this kind of result?

I need to track particular single vehicle(bus, train) of NSW.


#2

Hi @dhamu143, AnyTrip was created by one of our users @jxeeno who posts here regularly. The following thread might be of use to you: TfNSW real-time map

Unfortunately we only provide open data as is and don’t offer detailed instructions on how to build complex apps. That’s for you guys to work out. From reading the thread linked above you can get a good idea of how our data was used to build something like AnyTrip.

Short answer is that you will need to use a mix of various datasets, parse the data you need and build a frontend to display that how you want.

Thanks,
Alex


#3

which API have they accessed?
even the vehicle position api is not giving the perfect data


#4

Hi @dhamu143, I strongly recommend you read all our documentation. For those APIs you will need to use a proto file to decode the data it returns into a readable format. See:
https://opendata.transport.nsw.gov.au/documentation
https://opendata.transport.nsw.gov.au/troubleshooting
https://opendata.transport.nsw.gov.au/developer-information

Thanks,
Alex


Vehicle position api returns currupted data
#5

Hi @dhamu143, some more resources that will help you with what you’re trying to do:

Thanks,
Alex


#6

but this API is giving all result.all data is missing in vehicle position.
at last it is giving us like this

  ````id: "10"
 `` vehicle {
    trip {
      trip_id:


it's written like this on API 

Known issues:
•The text format may be truncated.

#7

Hey @dhamu143

Just seeing this thread – unfortunately we only provide support for our data. We are not app developers or data scientists and can only help so much. Please review the available resources that Alex and others have provided.

We also would like you to respect the other forum member’s time and availability.

Whilst we encourage your learning and development unfortunately this is not the right forum for that type of detailed discussion. Stackoverflow may be better for this https://stackoverflow.com/search?q=gtfs-r

You mention you are trying to implement something like AnyTrip. AnyTrip is an endorsed app for Transport for NSW. It is not an app that can be built overnight or quickly or easily. If you want AnyTrip developed for your needs we can introduce you to facilitate a commercial discussion with the developer.

Thank you.

Kind regards
Yvonne


#8

ok, that’s good. but what about this

Known issues:
•The text format may be truncated.

??


#9

The realtime feed is provided using Protocol Buffers, see https://developers.google.com/protocol-buffers/ for more information. This is a binary feed which explains the odd characters and formatting you were seeing.

The text version, formatted as JSON, is simply there for debug purposes and will be truncated. In order to access all of the realtime feed data you’ll need to look into Protocol Buffers. Think of the debug version as just a glimpse at the data to give you an idea of what it holds.


#10

I have been stuck on this issue. I need to track all the vehicle and vehicle API returns incomplete data.please help me.I need all data.


#11

It doesn’t returned truncated data when accessed via Protocol Buffers. It’s just the JSON debug representation that is truncated and that is expected and normal behaviour.

I’d really suggest you purchase the GTFS and GTFS Realtime books from https://gumroad.com/l/gtfsbundle. It’ll serve as a good introduction to GTFS and the realtime components along with code samples for consuming services.


#12

but by using mode: ‘direct’ in request its gives us direct data no need to direct conversion of some GTFS to normal JSON.


#13

it looks like in an earlier post you were downloading the data fine, but for some reason you thought it was corrupt. it was not corrupt, but in a binary format that you need. these libraries will help you somewhat: https://github.com/google/gtfs-realtime-bindings but in some cases tfnsw’s format is non-standard in which case you’ll have to read the links posted earlier to figure it out.

the text format (not JSON!!! @phiali) you got by enabling debug=true is truncated for most modes, but you shouldn’t use this anyway as you will use terabytes of internet bandwidth for nothing. this option is ONLY for debugging.

alternatively you can try asking the anytrip developer for a widget that does what you need.