Returns a paginated and searchable list of all train stations.
Query parameters
-
The page number to return
Minimum value is
1. Default value is1. -
The number of items to return per page
Minimum value is
1, maximum value is100. Default value is10. -
The latitude and longitude of the user's location, to narrow down the search results to sites within a proximity of this location.
-
A search term to filter the list of stations by name or address.
-
Filter stations by country code
GET
/stations
curl \
--request GET 'https://try.microcks.io/rest/Train+Travel+API/1.0.0/stations' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"data": [
{
"id": "efdbb9d1-02c2-4bc3-afb7-6788d8782b1e",
"name": "Berlin Hauptbahnhof",
"address": "Invalidenstraße 10557 Berlin, Germany",
"country_code": "DE",
"timezone": "Europe/Berlin"
},
{
"id": "b2e783e1-c824-4d63-b37a-d8d698862f1d",
"name": "Paris Gare du Nord",
"address": "18 Rue de Dunkerque 75010 Paris, France",
"country_code": "FR",
"timezone": "Europe/Paris"
}
],
"links": {
"self": "https://api.example.com/stations&page=2",
"next": "https://api.example.com/stations?page=3",
"prev": "https://api.example.com/stations?page=1"
}
}
Response examples (200)
# Headers
# Payload
<?xml version="1.0" encoding="UTF-8"?>
<root>
<data type="array">
<datum>
</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",
"status": 400,
"detail": "The request is invalid or missing required parameters."
}
Response examples (400)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/bad-request</type>
<title>Bad Request</title>
<status type="integer">400</status>
<detail>The request is invalid or missing required parameters.</detail>
</root>
Response examples (401)
{
"type": "https://example.com/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "You do not have the necessary permissions."
}
Response examples (401)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/unauthorized</type>
<title>Unauthorized</title>
<status type="integer">401</status>
<detail>You do not have the necessary permissions.</detail>
</root>
Response examples (403)
{
"type": "https://example.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Access is forbidden with the provided credentials."
}
Response examples (403)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/forbidden</type>
<title>Forbidden</title>
<status type="integer">403</status>
<detail>Access is forbidden with the provided credentials.</detail>
</root>
Response examples (429)
{
"type": "https://example.com/errors/too-many-requests",
"title": "Too Many Requests",
"status": 429,
"detail": "You have exceeded the rate limit."
}
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>
<status type="integer">429</status>
<detail>You have exceeded the rate limit.</detail>
</root>
Response examples (500)
{
"type": "https://example.com/errors/internal-server-error",
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected error occurred."
}
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>
<status type="integer">500</status>
<detail>An unexpected error occurred.</detail>
</root>