loader Loading...
Stations Page | PORTAL | Portland State University | Portland Oregon
loader Loading...

About The Portal Data API

Stations | Highways (coming soon) | Systems

Intro To API

The Portal team provides a data API (Application Programming Interface) for direct access to our traffic data. The use of this API assumes you have programing experience. If you are just looking to download a particular data set we encourage you to use the "Download Data" links throughout the site. This API uses HTTP requests to download data in different formats. Our API supports; CSV, XML, JSON, HTML, and Serialized PHP. Most API calls support all these formats however some nested API calls do not support CSV or HTML (the documentation is noted). We recommend you test most of these calls with your web browser before starting to write your script. If you have any questions please feel free to contact us by clicking on our support link in the upper right hand corner.

Access To API

Our data API is nothing more then a url web request. The first part which is refered to as the base, is everything up to the "api" portion of the request. Then you have your Category. Followed by the dataset you would like. After the dataset request you have any number of data attributes. Attributes are key value pairs seperated by the '/'. The possible attributes are different based on the selected dataset. Please refer to the dataset documents for more details.

http://{Base}/{Category}/{Dataset}/{key1}/{value1}/{key2}/{value2}/{key3}/{value3}

How To Acess The Data

Below you will see different ways of accessing the data.

From Your Web Browser

* Just type the following into your browser


https://portal.its.pdx.edu//api/{Category}/{Dataset}/start/{start}/stop/{stop}/id/{id}/format/{format}


ie. https://portal.its.pdx.edu//api/stations/VolumeCongestion/start/2009-09-10/stop/2009-09-11/id/1001/format/csv


* Please note this is just an example. Each API call is going to have its own set of attributes. In the example above everything after "{Dataset}" is an attribute.

Using Curl From The Command Line

curl -X GET https://portal.its.pdx.edu//api/stations/VolumeCongestion/start/2009-09-10/stop/2009-09-11/id/1001/format/csv

Expected Output For The Example Above

curl -X GET https://portal.its.pdx.edu//api/stations/VolumeCongestion/start/2009-09-10/stop/2009-09-11/id/1001/format/csv
hour,volume,congestion
12:00 am,132,0
1:00 am,104,0
2:00 am,90,0
3:00 am,135,0
4:00 am,254,0
5:00 am,585,0
.......

Get A List Of Supported Attributes

https://portal.its.pdx.edu//api/{Category}/{Dataset}/show/1/format/html

ie. https://portal.its.pdx.edu//api/stations/TwoQuantityUngroupedSimpleRange/show/1/format/html

Expected Output For The Example Above

id,start,stop,qty1,qty2,lane,res
integer,YYYY-MM-DD,YYYY-MM-DD,volume/speed/occupancy,volume/speed/occupancy,all,1hr/15min/5min

Data Overview

Below you will find a list of all datasets supported in this API. Click on the category title to explore further.

Category Description
Stations All datasets at the station level throughout our supported highway systems
Highways Coming Soon.....
Systems All datasets at the systems level throughout our supported highway systems