About
SNCF.js is an JavaScript library to get all the information in real time about the ©SNCF a French company.
It is based on the official api of the SNCF.
- Currently under development
- Easy to use
- Open to any request
- It is not an official library, but we use the official SNCF API to get our data.
Getting started
Install the library with npm:
npm i sncf.js
Get your SNCF Token:
https://www.digital.sncf.com/startup/api/token-developpeur
Documentation
Start to use the api:
JS
const {Client} = require('sncf.js');
const sncf = new Client();
sncf.login("YOUR TOKEN").then(async () =>{
}).catch(err => {
console.log(err)
})
Functions available:
sncf.places.search('STATION_NAME')
sncf.places.get('STATION_ID')
sncf.routes.search('ROUTE_NAME')
sncf.routes.get('ROUTE_ID')
sncf.routes.stop_areas('ROUTE_ID')
sncf.user
sncf.user.id
sncf.user.readyAt
sncf.user.connectionType
sncf.user.shape
sncf.user.uptime
sncf.user.timezone
*** all functions are async ***
Need help ?