Till senaste kommentaren

SL Platsuppslag - This api is currently not available for keys with priority above 0

Hi,
I'm trying my first project scraping information via API. Exciting!

When I request
parameters = {
'key': sl_reseplanerare2_api_nyckel,
'lang': 'sv',
'numChg': '0',
'originId': 9509,
'destId': 6086,
'useMetro': 0,
'useTram':0,
'realtime': 'true'
}

from https://api.sl.se/api2/TravelplannerV2/trip.json

I get the response "This api is currently not available for keys with priority above 0". Is this a temporary thing? Is there something I can do to get the trip suggestions?
Tim

Kommentarer

  • Sorry, of course the title of the question is wrong/misleading. I'm using the API SL Reseplanerare 2 Trip. My bad.
    Tim
  • Hi Tim,

    Just to be sure, are you calling the API with the parameters in the query string? (As your example is a JSON array). It should look like https://api.sl.se/api2/TravelplannerV2/trip.json?key=...&originExtId=..&...

    Also note that you probably should be using originExtId and destExtId instead of originId and destId.

    Regards,
    Bert
    Bert på Trafiklab
  • Thanks for the quick answer.
    My bad, I looked at a documentation page for Travelplanner 2 and pointed my script to the V2 endpoint, while I tried to authenticate with a V3.1 key.

    Seems using V3.1 documentation, key and endpoint consistently works wonders...

    Thanks for pointing me in the right direction
    Tim

Kommentera eller skriv ett nytt inlägg

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