Get realtime data

hello, everyone,
I need to implement something like AnyTrip 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.

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

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

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:

Thanks,
Alex

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

Thanks,
Alex

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.

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 Human verification - Stack Overflow

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

ok, that’s good. but what about this

Known issues:
•The text format may be truncated.

??

The realtime feed is provided using Protocol Buffers, see Protocol Buffers  |  Google Developers 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.

1 Like

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.

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 GTFS + GTFS-realtime Book Bundle. It’ll serve as a good introduction to GTFS and the realtime components along with code samples for consuming services.

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

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: GitHub - MobilityData/gtfs-realtime-bindings: Language bindings generated from the GTFS Realtime protocol buffer spec for popular languages. 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.