Reading Buses APIV2.1.0
A C#, .net Standard Library for the Reading Buses Open Data API (http://rtl2.ods-live.co.uk/cms/apiservice), available to use in your C# console, WPF, UWP or Win Form Applications.
Reading Buses API Documentation

.NET Core Codacy Badge https://img.shields.io/badge/Documentation-View-blue

Reading Buses API

A C#, .net Standard Library for the Reading Buses API, available to use in your C# console, UWP, WPF or Win Form Applications.

The library supports the List of Bus Stops, Live Vehicle Positions, Stop Predictions, List of Services, Line Patterns, Timetabled Journeys, Tracking History and the Vehicle Position History API..

Get your own API Keys from: http://rtl2.ods-live.co.uk/cms/apiservice

Examples

Examples code can be found on the Examples Repository here

Documentation

Documentation can be found by online here or the "docs" folder of this repository.

Download & Installation

Get the package from the nuget store here

Very Quick Start

First you need to initialise the Library by providing your API key:

{c#}
ReadingBuses Controller = await ReadingBuses.Initialise("APIKEY");

Once Initlised all future reference can be got using:

{c#}
ReadingBuses Controller = ReadingBuses.GetInstance();

Get a List of Bus Services

To get a list of bus services operated by Reading Buses and the information about them you can do any of the following:

To get all Services:

{c#}
BusService[] Services = Controller.GetServices();

To get all Services from a company:

{c#}
BusService[] RBServices = Controller.GetServices(Company.ReadingBuses);
BusService[] KNServices = Controller.GetServices(Company.Kennections);

To get specific Services based on their brand:

{c#}
BusService[] Services = Controller.GetServices("pink");

To get specific Service by Service Number and Company Operator:

{c#}
BusService Services = Controller.GetService("17", Company.ReadingBuses);

Get a List of Locations (Bus Stops)

To get all locations

{c#}
BusStop[] Locations = Controller.GetLocations();

To get location based on Acto-Code (Bus Stop ID)

{c#}
BusStop Locations = Controller.GetLocation("33245365434");

Get GPS Data

To get Live GPS Data

{c#}
LivePosition[] Positions = await Controller.GpsController.GetLiveVehiclePositions();

To get Archived GPS Data

{c#}
LivePosition[] Positions = await Controller.GpsController.GetArchivedVehiclePositions(DateTime.Now.AddDays(-1), new TimeSpan(3, 0, 0));

Once you have the bus service or location you want to inspect, they have various properties to let you get further data about them. Such as live bus stop data, GPS data, bus service routes. For more examples please see the repository linked above.