Get started

    API Endpoint

        https://api.ridewta.com/
                

The Whatcom Transportation Authority API provides access to transit data such as routes, stops, and pass information. Some methods require an API key to access.

To use methods requiring an API key. Please contact us at it@ridewta.com to get your own API key.

fares/goodlist/{agency}

API Key required

GET


# Here is a powershell example
$uri = “https://api.ridewta.com/fares/goodlist/AgencyName”
$key = "your api key here"
$headers = @{
“x-api-key” = $key;
"Content-Type" = "application/json";
}
Invoke-WebRequest -Uri $uri -Method GET -Headers $headers
                

To retrieve a list of all good lists associated with your agency, send a GET request to:
https://api.ridewta.com/fares/goodlist/{agency}

Successful return incudes:


{
    "agency": "Agency Name",
    "lists": [
        {
            "listId": "ID of list",
            "listName": "Example List"
        }
    ]
}
                        


POST


# Here is a powershell example
$uri = “https://api.ridewta.com/fares/goodlist/AgencyName”
$key = "your api key here"
$headers = @{
“x-api-key” = $key;
"Content-Type" = "application/json";
}
$body = @{
    "fromList": "List ID",
    "toList": "List ID",
    "cardIds": ["Hexidecimal Card UID", "Hexidecimal Card UID"]
}
$body = ConvertTo-Json -InputObject $body
Invoke-WebRequest -Uri $uri -Method POST -Headers $headers -UseBasicParsing -Body $body
                

To move one or more cards from one list to another, send a POST request to:
https://api.ridewta.com/fares/goodlist/{agency}

Valid card UIDs are in hexidecimal format, 13 or 14 characters in length (leading zeroes may be dropped). Cards must be on a list and in the PUT or "good" state before they can be moved via the POST method. Successful return incudes:


{
    "totalCards": 1,
    "validCards": 1,
    "addedCards": 1,
    "removedCards": 0,
    "status": "STATUS_RUNNING",
    "errors": [] //errors array will indicate card number that failed in decimal format
}
                        


fares/goodlist/{agency}/{list}

API Key required

GET


# Here is a powershell example
$uri = “https://api.ridewta.com/fares/goodlist/AgencyName/ListID”
$key = "your api key here"
$headers = @{
“x-api-key” = $key;
"Content-Type" = "application/json";
}
Invoke-WebRequest -Uri $uri -Method GET -Headers $headers
                

To retrieve a list of all cards on a good list, send a GET request to:
https://api.ridewta.com/fares/goodlist/{agency}/{list}

Successful return incudes an array of hexidecimal card UIDs on the good list:


["Hexidecimal card UID", "Hexidecimal card UID", ...]
                        


fares/goodlist/{agency}/{list}/card

API Key required

PUT


# Here is a powershell example
$uri = “https://api.ridewta.com/fares/goodlist/AgencyName/ListID/card”
$key = "your api key here"
$headers = @{
“x-api-key” = $key;
"Content-Type" = "application/json";
}
$body = @{
    ["Hexidecimal Card UID", "Hexidecimal Card UID", ...]
}
$body = ConvertTo-Json -InputObject $body
Invoke-WebRequest -Uri $uri -Method PUT -Headers $headers -UseBasicParsing -Body $body
                

To add one or more new cards to a list, or mark a previously DELETED card(s) as valid send a PUT request to:
https://api.ridewta.com/fares/goodlist/{agency}/{list}/card

Successful return incudes:


{
    "totalCards": 1,
    "validCards": 1,
    "addedCards": 1,
    "removedCards": 0,
    "status": "STATUS_RUNNING",
    "errors": [] //errors array will indicate card number that failed in decimal format
}
                        


DELETE


# Here is a powershell example
$uri = “https://api.ridewta.com/fares/goodlist/AgencyName/ListID/card”
$key = "your api key here"
$headers = @{
“x-api-key” = $key;
"Content-Type" = "application/json";
}
$body = @{
    ["Hexidecimal Card UID", "Hexidecimal Card UID", ...]
}
$body = ConvertTo-Json -InputObject $body
Invoke-WebRequest -Uri $uri -Method DELETE -Headers $headers -UseBasicParsing -Body $body
                

To mark one or more cards on a list as invalid, send a DELETE request to:
https://api.ridewta.com/fares/goodlist/{agency}/{list}/card

Successful return incudes:


{
    "totalCards": 1,
    "validCards": 1,
    "addedCards": 0,
    "removedCards": 1,
    "status": "STATUS_RUNNING", 
    "errors": [] //errors array will indicate card number that failed in decimal format
}
                        


detours

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/detours"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of detours affecting WTA's routes, send a GET request to:
https://api.ridewta.com/detours

Please note that detours are assigned to a particular direction of travel for each route and may only affect a single direction or both.

notices/en

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/notices/en"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of WTA's recent notices, send a GET request to:
https://api.ridewta.com/notices/en


notices/es

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/notices/es"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of WTA's recent notices in Spanish, send a GET request to:
https://api.ridewta.com/notices/es


routes

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of WTA's routes, send a GET request to:
https://api.ridewta.com/routes


routes/{route}

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes/80x"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about a single WTA route, send a GET request to:
https://api.ridewta.com/routes/{route}


routes/{route}/bulletins

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes/80x/bulletins"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of service bulletins affecting a WTA route, send a GET request to:
https://api.ridewta.com/routes/{route}/bulletins


routes/{route}/detours

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes/80x/detours"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about available detours affecting a WTA route, send a GET request to:
https://api.ridewta.com/routes/{route}/detours


routes/{route}/directions

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes/80x/directions"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about available directions of travel for a WTA route, send a GET request to:
https://api.ridewta.com/routes/{route}/directions


routes/{route}/patterns

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/routes/80x/patterns"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get sequenced geospatial point information about a WTA route, send a GET request to:
https://api.ridewta.com/routes/{route}/patterns

Note that only currently active patterns or patterns marked as default are returned. Patterns often correspond to directions of travel, so there are multiple patterns for each route in most cases.


servicebulletins

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/servicebulletins"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of service bulletins affecting the entire WTA system, send a GET request to:
https://api.ridewta.com/servicebulletins


stops

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/stops"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of WTA's stops, send a GET request to:
https://api.ridewta.com/stops


stops/{stop}

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/stops/2001"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about a single bus stop, send a GET request to:
https://api.ridewta.com/stops/{stop}

The {stop} url parameter represents the stop number. This number is on each stop sign.


stops/{stop}/attachments

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/stops/2001/attachments"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get image attachments of a bus stop, send a GET request to:
https://api.ridewta.com/stops/{stop}/attachments

The {stop} url parameter represents the stop number. This number is on each stop sign. If an image of the bus stop is available, this method returns the publicly accessible url for the image.


stops/{stop}/bulletins

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/stops/2001/bulletins"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get a list of service bulletins affecting a WTA bus stop, send a GET request to:
https://api.ridewta.com/stops/{stop}/bulletins


stops/{stop}/predictions

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/stops/2001/predictions"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get upcoming bus arrival predictions for a bus stop, send a GET request to:
https://api.ridewta.com/stops/{stop}/predictions

The {stop} url parameter represents the stop number. This number is on each stop sign. This method will return up to the next 3 predictions, if available.


vehicles

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/vehicles"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about WTA vehicles, send a GET request to:
https://api.ridewta.com/vehicles


vehicles/{vehicle}

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/vehicles/801"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get information about a single WTA vehicle, send a GET request to:
https://api.ridewta.com/vehicles/{vehicle}

The {vehicle} url parameter refers to the bus number. The number is painted on each vehicle.


vehicles/{vehicle}/predictions

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/vehicles/801/predictions"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get upcoming bus arrival predictions for a bus, send a GET request to:
https://api.ridewta.com/vehicles/{vehicle}/predictions

The {vehicle} url parameter refers to the bus number.

If data is available for the supplied parameters, this method will return up to the next 3 predicted arrivals.


vehicles/{vehicle}/{timestamp}

GET


# Here is a powershell example
$uri = "https://api.ridewta.com/vehicles/801/1586415600000"
Invoke-WebRequest –Uri $uri –Method GET -Headers $headers –UseBasicParsing
                

To get vehicle history for a WTA vehicle, send a GET request to:
https://api.ridewta.com/vehicles/{vehicle}/{timestamp}

The {vehicle} url parameter refers to the bus number. The {timestamp} url parameter should be in unix timestamp format.

If data is available for the supplied parameters, this method will return history for the entire day that is specified by the timestamp.