Is there an api that only returns the <arrivalAndDeparture> chunk?

19 views
Skip to first unread message

Rafael Zimberoff

unread,
Nov 28, 2011, 10:50:23 PM11/28/11
to onebusa...@googlegroups.com
I apologize if this is right in front of me and I missed it...

I have been using the api "arrivals-and-departures-for-stop" which is GREAT.

But for busy stops, it returns a BIG response.

I really only need the <arrivalAndDeparture> section, and (ideally) would be able to request "stop" "route" and get <arrivalAndDeparture> for just that stop and route.

Does this api exist, or should I continue to parse out the big response?

Thanks!

Brian Ferris

unread,
Nov 29, 2011, 2:13:47 AM11/29/11
to onebusa...@googlegroups.com
Every API method supports a "includeReferences=true|false" parameter
that determines if the <references/> section is included in the API
response. If you don't need the references section, excluding it can
reduce the size of the response substantially. Also, if you are
working with a mobile app, you might also consider accepting gzip
compression for the http response, which can also dramatically reduce
the size of the response that actually travels over the network.

Thanks,
Brian

> --
> You received this message because you are subscribed to the Google Groups
> "OneBusAway API" group.
> To post to this group, send email to onebusa...@googlegroups.com.
> To unsubscribe from this group, send email to
> onebusaway-ap...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/onebusaway-api?hl=en.
>

David Robinson

unread,
Nov 30, 2011, 12:47:46 PM11/30/11
to OneBusAway API
An alternative approach that I have used to minimize bandwidth usage
is to
infrequently use "arrivals-and-departures-for-stop" and instead
extract out
the list of TripIDs and use "trip-details" with its options (and
includeReferences=false) to return just
the <status> element. The result is that you can quickly and
efficently
get only the dynamic data while caching the static data.
Delaying by 2-5 minutes the addition of a trip
that is 35-45 minutes away should not have much impact on the user.

-David

> >http://groups.google.com/group/onebusaway-api?hl=en.- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages