Get a list of train stations

GET /stations

Returns a paginated and searchable list of all train stations.

Query parameters

  • page integer

    The page number to return

    Minimum value is 1. Default value is 1.

  • limit integer

    The number of items to return per page

    Minimum value is 1, maximum value is 100. Default value is 10.

  • The latitude and longitude of the user's location, to narrow down the search results to sites within a proximity of this location.

  • country string(iso-country-code)

    Filter stations by country code

Responses

  • OK

    Hide headers attributes Show headers attributes
    • A comma-separated list of directives as defined in RFC 9111.

    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes object
    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes object
  • Bad Request

    Hide headers attribute Show headers attribute
    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Unauthorized

    Hide headers attribute Show headers attribute
    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Forbidden

    Hide headers attribute Show headers attribute
    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Too Many Requests

    Hide headers attributes Show headers attributes
    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    • The Retry-After header indicates how long the user agent should wait before making a follow-up request. The value is in seconds and can be an integer or a date in the future. If the value is an integer, it indicates the number of seconds to wait. If the value is a date, it indicates the time at which the user agent should make a follow-up request.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Internal Server Error

    Hide headers attribute Show headers attribute
    • The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

GET /stations
curl \
 -X GET https://mocks.example.com/rest/stations \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e",
      "name": "Berlin Hauptbahnhof",
      "address": "Invalidenstraße 10557 Berlin, Germany",
      "timezone": "Europe/Berlin",
      "country_code": "DE"
    },
    {
      "id": "b2e783e1-c824-4d63-b37a-d8d698862f1d",
      "name": "Paris Gare du Nord",
      "address": "18 Rue de Dunkerque 75010 Paris, France",
      "timezone": "Europe/Paris",
      "country_code": "FR"
    }
  ],
  "links": {
    "next": "https://api.example.com/stations?page=3",
    "prev": "https://api.example.com/stations?page=1",
    "self": "https://api.example.com/stations&page=2"
  }
}
Response examples (200)
# Headers
Cache-Control: max-age=3600
RateLimit: limit=10, remaining=0, reset=10

# Payload
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <data type="array">
    <datum>
      <id>efdbb9d1-02c2-4bc3-afb7-6788d8782b1e</id>
      <name>Berlin Hauptbahnhof</name>
      <address>Invalidenstraße 10557 Berlin, Germany</address>
      <country-code>DE</country-code>
      <timezone>Europe/Berlin</timezone>
    </datum>
  </data>
  <links>
    <self>https://example.com</self>
    <next>https://example.com</next>
    <prev>https://example.com</prev>
  </links>
</root>
Response examples (400)
{
  "type": "https://example.com/errors/bad-request",
  "title": "Bad Request",
  "detail": "The request is invalid or missing required parameters.",
  "status": 400
}
Response examples (400)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/bad-request</type>
  <title>Bad Request</title>
  <detail>The request is invalid or missing required parameters.</detail>
  <status type="integer">400</status>
</root>
Response examples (401)
{
  "type": "https://example.com/errors/unauthorized",
  "title": "Unauthorized",
  "detail": "You do not have the necessary permissions.",
  "status": 401
}
Response examples (401)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/unauthorized</type>
  <title>Unauthorized</title>
  <detail>You do not have the necessary permissions.</detail>
  <status type="integer">401</status>
</root>
Response examples (403)
{
  "type": "https://example.com/errors/forbidden",
  "title": "Forbidden",
  "detail": "Access is forbidden with the provided credentials.",
  "status": 403
}
Response examples (403)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/forbidden</type>
  <title>Forbidden</title>
  <detail>Access is forbidden with the provided credentials.</detail>
  <status type="integer">403</status>
</root>
Response examples (429)
{
  "type": "https://example.com/errors/too-many-requests",
  "title": "Too Many Requests",
  "detail": "You have exceeded the rate limit.",
  "status": 429
}
Response examples (429)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/too-many-requests</type>
  <title>Too Many Requests</title>
  <detail>You have exceeded the rate limit.</detail>
  <status type="integer">429</status>
</root>
Response examples (500)
{
  "type": "https://example.com/errors/internal-server-error",
  "title": "Internal Server Error",
  "detail": "An unexpected error occurred.",
  "status": 500
}
Response examples (500)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/internal-server-error</type>
  <title>Internal Server Error</title>
  <detail>An unexpected error occurred.</detail>
  <status type="integer">500</status>
</root>