Getting error to decode response body of timetable

hello every one
i am getting this type of error

Illegal wire type of unknown field 0 in Message .transit_realtime.FeedMessage#decode: 3
my code is

var request = require(‘request’);
var GtfsRealtimeBindings = require(‘gtfs-realtime-bindings’);
var fs = require(‘fs’);

var token;
var tokenConfig = {
scope: ‘user’,
grant_type: ‘client_credentials’

var credentials = {
clientID: ‘##############’,
clientSecret: ‘###########’,
site: ‘’,
tokenPath: ‘/auth/oauth/v2/token’,
useBasicAuthorizationHeader: true,
useBodyAuth: false

// Initialize the OAuth2 Library
var oauth2 = require(‘simple-oauth2’)(credentials);
oauth2.client.getToken(tokenConfig, saveToken);
function saveToken(error, result) {
if (error) {
console.log(‘Access Token Error’, error.message);
} else {
token = oauth2.accessToken.create(result);
var requestSettings = {
method: ‘GET’,
encoding: null,
‘auth’: {
‘bearer’: token.token.access_token
request.get(requestSettings, function(err, res, body) {
var feed = GtfsRealtimeBindings.FeedMessage.decode(body);
feed.entity.forEach(function(entity) {
if (entity) {
// console.log(“'” + entity.vehicle.vehicle.label + “',” + entity.vehicle.position.latitude + “,” + entity.vehicle.position.longitude);
please help me

Hi dhamu143, We are looking into it, will keep you update

I get the same error when I try.
However I think I may have found the problem.

Static timetables and stop locations in TransXChange (TXC) format for all operators, including regional and private operators and routes not currently available in realtime feeds. Note: Identifiers do not match the realtime APIs

If I download using curl and save the output to a zip file and then unzip the file I get a lot of xml files.

curl -H"Authorization: Bearer xxxxx-xxxxx-xxxxx-xxxxx-xxxxx" -o unzip -l

Hope that helps.

1 Like

Hi Dharmu143

The data from this URL is in TransXChange format. The format your code seems to be expecting is in GTFS format per your declaration var GtfsRealtimeBindings = require(‘gtfs-realtime-bindings’);

The formats don’t match. You may need to use the schedule data for Realtime instead.

More details about TransXChange can be reviewed here TransXChange - GOV.UK

You will also note Nivring’s comments about using TransXChange data.

if we use this URL and URL instead of using transxchange data then
it also gives same error.
now what to do ?

Unfortunately there is currently an issue that should be resolved shortly… where we don’t have the scheduled data that you need.

Refer to this thread for more information and updates: