ResRobot Nearby stops
Obs: Detta innehåll finns inte tillgängligt på svenska. Därför ser du engelska versionen. Om du tycker att denna sida borde översättas till svenska, kan du skriva till oss på support.trafiklab.se.
Om du vill se webbsidan på engelska, klicka här.
What does this API provide?
ResRobot nearby stops provides information about stops, including their ids and position, by searching for a certain pair of coordinates.
New version available
A new version, version 2.1, of ResRobot is available. Existing apps should migrate to the new version, and it is no longer possible to build new apps on version 2.0.
Version 2.0, which you are currently looking at, will be discontinued at June 30th, 2022.
Data format
The data is formatted as JSON or XML, depending on the format
query parameter.
How often is this data updated?
The static data used for this API is updated when changes are made, at most once per day.
Which operators are covered by this dataset?
All operators which operate in Sweden are covered by the ResRobot APIs.
How often does the data format changes? Do breaking changes happen?
This API has the deprecated status and will be discontinued on June 30th 2022.
Using ResRobot Nearby stops
ResRobot Nearby stops takes the search string and the wanted number of results as parameters, and returns a list of matching stations with their location, name and id. Users can choose between exact matching and approximate matching by adding a question mark to the end of the search string.
New version available
A new version of ResRobot is available. Existing apps should migrate to the new version, and it is no longer possible to build new apps on version 2.0.
Example calls
Exact search
Exact search returns only stations that match exactly with the search string.
Call
https://api.resrobot.se/v2/location.nearbystops?input=Göteborg&format=json&key=API_KEY
https://api.resrobot.se/v2/location.nearbystops?input=Göteborg&format=xml&key=API_KEY
Response
{
"StopLocation": [
{
"id": "740098001",
"extId": "740098001",
"name": "GÖTEBORG",
"lon": 11.973479,
"lat": 57.708895,
"weight": 22332,
"products": 254
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<LocationList xmlns="hafas_rest_v1">
<StopLocation id="740098001" extId="740098001" name="GÖTEBORG" lon="11.973479" lat="57.708895" weight="22332" products="254"/>
</LocationList>
Call
https://api.resrobot.se/v2/location.name?input=Göteborg?&format=json&key=API_KEY
https://api.resrobot.se/v2/location.name?input=Göteborg?&format=xml&key=API_KEY
Request parameters
Name | Type | Required | Description |
---|---|---|---|
key | String | Yes | Your API key |
originCoordLat | String | Yes | Latitude (WGS84, decimal degree), eg 59.293611 |
originCoordLong | String | Yes | Longitude (WGS84, decimal degree), eg 18.083056 |
maxNo | Integer | No | The maximum number of results to return, default 10, maximum 1000 |
r | Integer | No | Maximum distance between given coordinates and the stop. Default 1000, max 10000 |
lang | String | No | Language (sv/en/de), default sv. Affects both data (names for different transport types) and error messages. |
format | String | No | Json or Xml |
Response
{
"StopLocation": [
{
"id": "740098001",
"extId": "740098001",
"name": "GÖTEBORG",
"lon": 11.973479,
"lat": 57.708895,
"weight": 22332,
"products": 254
},
{
"id": "740000002",
"extId": "740000002",
"name": "Göteborg Centralstation",
"lon": 11.973479,
"lat": 57.708895,
"weight": 17428,
"products": 182
},
{
"id": "740098526",
"extId": "740098526",
"name": "GÖTEBORG GAMLESTADEN",
"lon": 12.004411,
"lat": 57.729148,
"weight": 16810,
"products": 112
},
{
"id": "740016365",
"extId": "740016365",
"name": "Göteborg Sävenäs lokstation",
"lon": 12.021077,
"lat": 57.725993,
"weight": 13,
"products": 128
},
{
"id": "740025610",
"extId": "740025610",
"name": "Göteborg Berzeliigatan",
"lon": 11.981884,
"lat": 57.698504,
"weight": 4917,
"products": 200
},
{
"id": "740015578",
"extId": "740015578",
"name": "Göteborg Korsvägen",
"lon": 11.986909,
"lat": 57.696625,
"weight": 4917,
"products": 200
},
{
"id": "740016358",
"extId": "740016358",
"name": "Göteborg Kungsportsplatsen",
"lon": 11.969748,
"lat": 57.704023,
"weight": 4917,
"products": 200
},
{
"id": "740072430",
"extId": "740072430",
"name": "Göteborg Stenpiren",
"lon": 11.957424,
"lat": 57.705803,
"weight": 4669,
"products": 448
},
{
"id": "740025609",
"extId": "740025609",
"name": "Göteborg Bellevue",
"lon": 12.023477,
"lat": 57.732456,
"weight": 4488,
"products": 192
},
{
"id": "740020752",
"extId": "740020752",
"name": "Göteborg Brunnsparken",
"lon": 11.967843,
"lat": 57.706945,
"weight": 4488,
"products": 192
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<LocationList xmlns="hafas_rest_v1">
<StopLocation id="740098001" extId="740098001" name="GÖTEBORG" lon="11.973479" lat="57.708895" weight="22332" products="254"/>
<StopLocation id="740000002" extId="740000002" name="Göteborg Centralstation" lon="11.973479" lat="57.708895" weight="17428" products="182"/>
<StopLocation id="740098526" extId="740098526" name="GÖTEBORG GAMLESTADEN" lon="12.004411" lat="57.729148" weight="16810" products="112"/>
<StopLocation id="740016365" extId="740016365" name="Göteborg Sävenäs lokstation" lon="12.021077" lat="57.725993" weight="13" products="128"/>
<StopLocation id="740025610" extId="740025610" name="Göteborg Berzeliigatan" lon="11.981884" lat="57.698504" weight="4917" products="200"/>
<StopLocation id="740015578" extId="740015578" name="Göteborg Korsvägen" lon="11.986909" lat="57.696625" weight="4917" products="200"/>
<StopLocation id="740016358" extId="740016358" name="Göteborg Kungsportsplatsen" lon="11.969748" lat="57.704023" weight="4917" products="200"/>
<StopLocation id="740072430" extId="740072430" name="Göteborg Stenpiren" lon="11.957424" lat="57.705803" weight="4669" products="448"/>
<StopLocation id="740025609" extId="740025609" name="Göteborg Bellevue" lon="12.023477" lat="57.732456" weight="4488" products="192"/>
<StopLocation id="740020752" extId="740020752" name="Göteborg Brunnsparken" lon="11.967843" lat="57.706945" weight="4488" products="192"/>
</LocationList>
Response Data fields
Name | Data type | Description |
---|---|---|
LocationList | StopLocation[] | List with results |
StopLocation | Object | |
name | String | Stop name |
extId | String | Stop id for use in other ResRobot APIs. |
id | String | Internal id. Do not use. |
dist | Integer | Distance from the queried coordinates, in meters. |
lat | String | Latitude (WGS84, decimal degree) for this stop, eg 59.293611 |
lon | String | Longitude (WGS84, decimal degree) for this stop, eg 18.083056 |
products | Integer | Transport modes available at thist stop, as a sum of the following values: 1 – Flyg 2 - Snabbtåg 4 - Tåg 8 - Expressbuss 16 - Lokaltåg 32 - Tunnelbana 64 – Spårvagn 128 – Buss 256 – Båt 512 – Taxi (160 – Tunnelbana och Buss) |
weight | Integer | Shows how much traffic is handled at this stop, a stop with more traffic gets a higher weight. Between 0 and 32767. |