Webservice SASAplandata Webservice SASAplandata

What kind of data can you query?

This service provides you data associated with the VDV-datamodel (VDV 451 and VDV 452). It responds to every request with an jsonp or a json result. A list of the available data and the VDV related names will be described in the following paragraphs.

URL

The URL to use for querying this webservice is:

http://opensasa.info/SASAplandata/

For json as returned datatype, you don't have to add any special parameter. In order to format the result as jsonp you have to add the following parameter:

jsonp=<nameofthefunction>

For choosing the type of data returned, you have to set the type parameter, which is defined as:

type={REC_ORT|FIRMENKALENDER|BASIS_VER_GUELTIGKEIT|REC_LID|LID_VERLAUF|REC_FRT|SEL_FZT_FELD|REC_FRT_HZT|REC_FRT_FZT|ORT_HZT|REC_LIVAR_HZT}

Available data

For a better comprehension of the names and the "files" or the so called requests please read the English or German version of the description of the VDV 452 standard.

BASIS_VER_GUELTIGKEIT (Update date from the schedule)

This is the date, which shows the beginning of the validity of the schedule. This date changes every time the schedule changes.

Format

[
    {
        "VER_GUELTIGKEIT": "yyyymmdd"
    }
]

REC_ORT (Bus stops)

It represents a list of the bus stops and their information.

Format

[
    {
        "ORT_NAME": "<Name busstop>",
        "ORT_GEMEINDE": "<Name municipality>",
        "busstops": [
            {
                "ORT_NR": <id of the busstop>,
                "ORT_POS_BREITE": <lat>,
                "ORT_POS_LAENGE": <long>
            },...
        ]
    },...
]

FIRMENKALENDER (company's calendar)

This request allows you to query the type of day which have been associated with the comapny's calendar. This allows you to associate every trip to a certain subset of day, or even if you choose one day, you can get all the trips available for one day.

Format

[
    {
        "BETRIEBSTAG": "yyyy-mm-dd",
        "TAGESART_NR": "<type of day as number>"
    },...
]

REC_LID (Information about lines)

This request returns you a list of all the available information about the lines.

Format

[
    {
        "LI_NR": <Number of the line>,
        "LI_KUERZEL": "<short name>",
        "LIDNAME": "<name>",
        "varlist": [ <list of variants of this line>
            <id variant 1>,
            <id variant 2>, ...
        ]
    },...
]

LID_VERLAUF (Track of the line)

This request lets you know, in which order a variant of a line passes on busstops.

Format

[
    {
        "LI_NR": "<number of the line>",
        "varlist": [ <list of all variants>
            {
                "STR_LI_VAR": <number of the variant>,
                "routelist": [ <list of the busstops in ascend order>
                    <id busstop 1>,
                    <id busstop 2>,...
                ]
            },...
        ]
    },...
]

REC_FRT (Trips)

This request gives you a list off all trips available in the database. But there are some filters to, that means, you can set some special parameters when querying for trips.

One of the parameters is the line number, so you recieve back all the trips from a certain line. It is called LI_NR (ex. LI_NR=211).

The second parameter is the type of the day, so you can recieve back only the trips from a certain type of day. This parameter is called TAGESART_NR (ex. TAGESART_NR=66).

Both parameters can be setted simultaneously.

Format

[
    {
        "LI_NR": "<line number>",
        "tagesartlist": [ <list of all type of days for this line>
            {
                "TAGESART_NR": <type of day>,
                "varlist": [ <list of variants on this type of day and for this line>
                    {
                        "STR_LI_VAR": <variant number>,
                        "triplist": [ <list of all trips>
                            {
                                "FRT_START": <start in seconds from midnight>,
                                "FGR_NR": <type of traveltime>,
                                "FRT_FID": <tripnumber>
                            },...
                        ]
                    },...
                ]
            },...
        ]
    }
]

SEL_FZT_FELD (Traveltimes)

This request lets you know the traveltimes from one stop to another. All possibile combinations which are used in the network model are present in this response. It may be more possible travel times for a combination, but you have to watch the type of traveltime which is available from the trip to calculate the right traveltime. For every traveltime then it's only one combination left.

Format

[
    {
        "FGR_NR": "<type of traveltime>",
        "ORT_NR": "<id start busstop>",
        "SEL_ZIEL": "<id next busstop>",
        "SEL_FZT": "<travel times in seconds>"
    },...
]

REC_FRT_HZT (Stop times at bus stops)

Here you get the stop times which on certain busstops were performed by the bus, but always connected to a certain trip (For example if only a few trips stop at a busstop for 3 mins but the others don't stop).

Format

[
    {
        "FRT_FID": "<tripnumber>",
        "ORT_NR": "<bus stop id>",
        "FRT_HZT_ZEIT": "<stop time in seconds>"
    },...
]

REC_FRT_FZT (Special traveltimes for single trips)

Here you get some special traveltimes for single trips, which only a few times a day were performed differently. This is because only for a few trips it isn't worth to create variants.

Format

[
    {
        "FRT_FID": "<tripnumber>",
        "ORT_NR": "<departure busstop id>",
        "FRT_FZT_ZEIT": "<traveltime to next busstop>"
    },...
]

ORT_HZT (stop times )

This request lets you know the stop times at a busstop. This is used for busstops, where most of the trips are stopping for some minutes.

Format

[
    {
        "FGR_NR": "<type of traveltime>",
        "ORT_NR": "<bus stop id>",
        "HP_HZT": "<stop time in seconds>"
    },...
]

REC_LIVAR_HZT (stop times at busstops only for a certain line or variant)

This request is used to produce a list of all stop times which are connected only with a certain line or variant on a busstop, and all the other lines doesn't stop there.

Format

[
    {
        "LI_NR": "<linenumber>",
        "STR_LI_VAR": "<variantnumber>",
        "LI_LFD_NR": "<index of the busstop in the triplist>",
        "ORT_NR": "<busstopnumber>",
        "FGR_NR": "<type of traveltime>",
        "LIVAR_HZT_ZEIT": "<stop time in seconds>"
    },...
]