Till senaste kommentaren
Kommentaren du söker har flyttats till en ny diskussion, eller är borttagen.

Real Time based on stop id/trip id/route id

Hey,

We are trying to use your SL Realtidsinformation 4 API. Here is the query:

http://api.sl.se/api2/realtimedeparturesV4.json?key=?&siteid=740021644&timewindow=60 

We also use SL Platsuppslag API with this request:

https://api.sl.se/api2/typeahead.Json?key=?& search string=740021644&station only=True&maxresults=50

1) we get a proxy error for SL Platsuppslag API request



2) Is it possible to use a request based on stop id/trip id/route id? Thank you!

Kommentarer

  • Hi Anastasia,

    Regarding your first question, can you check if your request URL contains spaces? As you pasted it, it contains a space before searchString, between search and string, and between Station and only. While the 1008 error code can be confusing and unclear, it often points to an invalid request. In this case it could be spaces in the URL. I tried successfully with the following URL: https://api.sl.se/api2/typeahead.Json?key=example&searchstring=740021644&stationonly=True&maxresults=50

    Regarding your second question, do you want to retrieve (realtime) data based on GTFS identifiers? What data do you want to retrieve, and which stop/trip/route id do you mean?

    Regards,
    Bert
    Trafiklab
  • Yes, exactly - GTFS identifiers in combination with an API
    Anastasia
  • - The stop_id identifiers in GTFS Sverige 2 correspond to the stop identifiers in the ResRobot APIs.
    - GTFS Regional cannot be combined with APIs, but we offer GTFS-RT for those, meaning there is no need for an API.
    - The SL APIs can be matched with the GTFS Sverige 2 data. For this you need to use the mapping file, found at https://api.trafiklab.se/v2/samtrafiken/gtfs/extra/agency_stops.txt. More information can be found in the GTFS Sverige 2 documentation

    We generally consider GTFS Regional as the way to go, especially for companies. This GTFS dataset has the highest data quality, and offers/will offer GTFS-realtime including vehicle positions. For example Apple Maps uses this dataset.

    Regards,
    Bert
    Trafiklab
  • Thank you for the assistance!
    Anastasia

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.