Skip to content
On this page

Home > sncf.js > JourneyManager > get

JourneyManager.get() method

Get a journey details with departure and arrival stop areas ids

Signature:

typescript
get(from: string, to: string, date?: Date): Promise<Journey>;

Parameters

Parameter

Type

Description

from

string

The departure stop area id or name

to

string

The arrival stop area id or name

date

Date

(Optional) The date of the journey to get

**Returns:**

Promise<Journey>

Example 1

This example shows how to get a journey using the departure and arrival stop areas names

javascript
const journey = await client.journey.get("Paris", "Bordeaux")
console.log(journey)

Example 2

This example shows how to get a journey using the departure and arrival stop areas ids

javascript
const journey = await client.journey.get("stop_area:SNCF:87611004", "stop_area:SNCF:87686006")
console.log(journey)