Latest 4.0.0
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0

Swift libary for the TPG Open Data.

For more explanation: TPG Open Data

Build Status

MIT License
Carthage compatible
CocoaPods Compatible


import TPGSwift

// MARK: - Setting the key

// Set the API Key

// MARK: - Creating an API call url

// Get stops for the stop code "WTC0"
let getStops = API.getStops(stopCode: "WTC0", stopName: nil, line: nil, latitude: nil, longitude: nil)

print("API Stops: (getStops.URL)")
// -> API Stops:

// MARK: - Decode

let json = JSONDecoder()
// This is mandatory
decoder.dateDecodingStrategy = .iso8601

do {
    let stops = try json.decode(Record<Stop>.self, from: data)
    print("Stops: (stops)")
} catch let error {
    print("Error: (error)")


You can find a basic Paw file which will help you to play with the API.
Open TPGSwift.paw and change the KEY variable in the Production group
with the one received from the TPG.


TPGSwift is released under the MIT license. See LICENSE for details.

Latest podspec

    "name": "TPGSwift",
    "version": "4.0.0",
    "summary": "A library to access the TPG opendata.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Yannick Heinrich": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    "source": {
        "git": "",
        "tag": "4.0.0"
    "source_files": "Sources/*.swift"

Pin It on Pinterest

Share This