ResRobot Nearby stops
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.
Data format
The data is formatted as JSON or XML, depending on the format
query parameter.
Updates
The static data used for this API is updated when changes are made, at most once per day.
Operators covered by this dataset
All operators which operate in Sweden are covered by the ResRobot APIs.
Breaking changes
This API has the stable status. When breaking changes are made, we strive to have a 6 months transition period for users to update their implementations. Examples of breaking changes are the changes to existing fields or query parameters, or in case new query parameters are required to keep the results the same. The addition of new fields isn’t considered a breaking change, and can happen without warning.
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.
Example calls
Call
1https://api.resrobot.se/v2.1/location.nearbystops?originCoordLat=57.708895&originCoordLong=11.973479&format=json&accessId=API_KEY
1https://api.resrobot.se/v2.1/location.nearbystops?originCoordLat=57.708895&originCoordLong=11.973479&format=xml&accessId=API_KEY
Request parameters
Changes compared to ResRobot v2.0:
- The
key
parameter has been renamed toaccessId
.
Name | Type | Required | Description |
---|---|---|---|
accessId | 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
1{
2 "StopLocation": [
3 {
4 "id": "740098001",
5 "extId": "740098001",
6 "name": "GÖTEBORG",
7 "lon": 11.973479,
8 "lat": 57.708895,
9 "weight": 22332,
10 "products": 254
11 }
12 ]
13}
1<?xml version="1.0" encoding="UTF-8"?>
2<LocationList xmlns="hafas_rest_v1">
3 <StopLocation id="740098001" extId="740098001" name="GÖTEBORG" lon="11.973479" lat="57.708895" weight="22332" products="254"/>
4</LocationList>
Data fields
Changes compared to ResRobot v2.0:
- The root object now contains an array of
stopLocationOrCoordLocation
instead of an array ofstopLocation
. stopLocation
can now be found in the items present in thestopLocationOrCoordLocation
array.- The
products
field has been replaced with an array of Products. Instead of accessing the sum of all products throughproducts
, you can now obtain all the individual products throughProductAtStop[].cls
timezoneOffset
has been added to eachStopLocation
.
Name | Data type | Description |
---|---|---|
stopLocationOrCoordLocation | stopLocationOrCoordLocation[] | List with results |
stopLocationOrCoordLocation.StopLocation | StopLocation | Actual data is contained in the StopLocation property |
StopLocation | Object | Object containing a single stop |
StopLocation.name | String | Stop name |
StopLocation.extId | String | Stop id for use in other ResRobot APIs. |
StopLocation.id | String | Internal id. Do not use. |
StopLocation.dist | Integer | Distance from the queried coordinates, in meters. |
StopLocation.lat | String | Latitude (WGS84, decimal degree) for this stop, eg 59.293611 |
StopLocation.lon | String | Longitude (WGS84, decimal degree) for this stop, eg 18.083056 |
StopLocation.productAtStop | Product[] | See
common data types. Only the cls field of each product will contain actual data. |
StopLocation.weight | Integer | Shows how much traffic is handled at this stop, a stop with more traffic gets a higher weight. Between 0 and 32767. |