npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ruter-api

v1.0.4

Published

Wrapper for the official Ruter# API (public transportation service in and around Oslo, Norway)

Downloads

24

Readme

npm version Downloads Dependency Status Build Status MIT license GitHub issues GitHub forks GitHub stars

Functions

  • api(apipath, options, result_cb)

Getting Started

In Node.js:

npm install ruter-api
var ruter = require('ruter-api');

// Returns "Pong". Check API server availability
ruter.api("Heartbeat/Index", {}, response => {
	console.log(response);
});

// Get all stops within the ruter zone
ruter.api("Place/GetStopsRuter", {}, response => {
	console.log(response);
});

// Get all lines. Their name, type and respective color,
ruter.api("Line/GetLines", {}, response => {
    console.log(response);
});

API (as of Sept 9 2016)

Heartbeat

  • Heartbeat/Index Returns "Pong".

Place

  • Place/GetStop/{id} Returns all data about a Stop

  • Place/GetArea/{id} This method is not official part of Ruter Open API. It may be removed or changed without prior notice.

  • Place/GetPlaceExtension/{id}?locationType={locationType} This method is not official part of Ruter Open API. It may be removed or changed without prior notice

  • Place/GetPlacesByIdListExtension This method is not official part of Ruter Open API. It may be removed or changed without prior notice

  • Place/GetPlacesByAreaExtension?xmin={xmin}&xmax={xmax}&ymin={ymin}&ymax={ymax}&unique={unique}&locationType={locationType} This method is not official part of Ruter Open API. It may be removed or changed without prior notice

  • Place/GetClosestPlacesExtension?coordinates={coordinates}&proposals={proposals}&maxdistance={maxdistance}&unique={unique}&locationType={locationType} This method is not official part of Ruter Open API. It may be removed or changed without prior notice

  • Place/GetPlaces/{id}?location={location} Returns a list of Places that have names similar to the search string. If a Location is provided, search results are sorted according to geographical proximity.

  • Place/GetPlacesExtension/{id}?location={location}&unique={unique}&locationType={locationType}&proposals={proposals} This method is not official part of Ruter Open API. It may be removed or changed without prior notice

  • Place/GetStopsByLineID/{id} Returns an unsorted list of all Stops served by a Line.

  • Place/GetClosestStops?coordinates={coordinates}&proposals={proposals}&maxdistance={maxdistance} Returns a List of Stops and their real walking distance to the point defined by the argument Coordinates.

  • Place/GetStopsByArea?xmin={xmin}&xmax={xmax}&ymin={ymin}&ymax={ymax}&includeStopPoints={includeStopPoints} Returns a list of Stops within a box defined by the search arguments. All values have to be on UTM33 format.

  • Place/GetSalePointsByArea?longmin={longmin}&longmax={longmax}&latmin={latmin}&latmax={latmax} Returns a list of SalePoints within a box defined by the search arguments. All values have to be long lat.

  • Place/GetCityBikeStations?longmin={longmin}&longmax={longmax}&latmin={latmin}&latmax={latmax} Returns a list of City Bike Sations within a box defined by the search arguments. The stations also contain information about available bicycles and locks.

  • Place/GetStopsRuter Returns a list of stops within the Ruter zones.

Trip

  • Trip/GetTrip/{id}?time={time} Returns a sequence of all Stops served by a Trip.

Meta

  • Meta/GetValidities Returns the date and time for the first and last valid search time.

Travel

  • Travel/GetTravels?fromPlace={fromPlace}&toPlace={toPlace}&isafter={isafter}&time={time}&changemargin={changemargin}&changepunish={changepunish}&walkingfactor={walkingfactor}&proposals={proposals}&transporttypes={transporttypes}&maxwalkingminutes={maxwalkingminutes}&linenames={linenames}&walkreluctance={walkreluctance}&waitAtBeginningFactor={waitAtBeginningFactor} The travel planner covers all public transport modes and walking. In order to plan a journey between two places, you need to input the location of both the starting point and the destination on one of the following formats: National stop ID, Area ID, POI ID or Coordinate (in UTM32 format) In most cases, default parameters for interchange and walking speed should be used, but they can be adjusted according to your wish. The server will return a TravelResponse object, which in turn contains an array of TravelProposals as well as a ReisError object (which should be empty ;)). The TravelProposal objects in turn contain a TravelStage or WalkingStage object for each of the legs of the journey.

  • Travel/GetTravelsExtension?fromplace={fromplace}&toplace={toplace}&isafter={isafter}&time={time}&changemargin={changemargin}&changepunish={changepunish}&walkingfactor={walkingfactor}&proposals={proposals}&transporttypes={transporttypes}&maxwalkingminutes={maxwalkingminutes}&linenames={linenames} No documentation available.

  • Travel/GetRoute?stops={stops}&time={time}&outSR={outSR} No documentation available.

StopVisit

  • StopVisit/GetDepartures/{id}?datetime={datetime}&transporttypes={transporttypes}&linenames={linenames} Returns a List of StopVisits (departures) from a Stop. If no time parameter is supplied, departures in realtime will be returned.

Street

  • Street/GetStreet/{id} Returns all Houses with their coordinates of a Street with the given ID

Line

  • Line/GetLines Returns a List of all Lines available.

  • Line/GetLinesByStopID/{id} Returns a List of all Lines that serve a Stop.

  • Line/GetDataByLineID/{id} Returns data about a Line.

  • Line/GetStopsByLineId/{id} Returns a List of all Stops that are served by a Line.

  • Line/GetLinesRuterExtended?ruterOperatedOnly={ruterOperatedOnly} Returns a list of lines that Ruter operates, including stops for each line. Whether or not to include train lines, airport express lines and other lines by other operators. Set to "true" or "false", default is false if not supplied.

  • Line/GetLinesRuter?ruterOperatedOnly={ruterOperatedOnly} Returns a list of lines that Ruter operates.

Read more

Read more about the API-calls and the values you get in return at Ruters official API specification

Git

Data Sources / Public Documentation

  • http://reisapi.ruter.no/help

Author

William Viker <[email protected]>