Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

car2go

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

car2go

Car2Go REST API

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

car2go

Car2Go REST API

car2go can be used to access car2go's API. If you'd like to use their API and this module you must first request an oauth key and secret.

Quick start

npm install car2go

var car2go = require("car2go").createClient({
  key: MY_OAUTH_KEY,
  secret: MY_OAUTH_SECRET
});

// get a list of available cars in Toronto in JSON format
car2go.vehicles({
  format: "json",
  loc: "Toronto"
}, function(err, cars) {
  if (err) {
    return console.log(err);
  }

  console.log(cars);
});

API

Locations

List of all the cities that car2go operates in.

Usage
car2go.locations(function(err, locations) {
  console.log(locations);
});

// Output

[
  {
    "countryCode": "CA",
    "defaultLanguage": "en",
    "locationId": 13,
    "locationName": "Toronto",
    "mapSection": {
      "center": {
        "latitude": 43.65396,
        "longitude": -79.38635
      },
      "lowerRight": {
        "latitude": 43.6263638049989,
        "longitude": -79.2129903230651
      },
      "upperLeft": {
        "latitude": 43.67671718155003,
        "longitude": -79.55942239476869
      }
    },
    "timezone": "Canada/Eastern"
  },
  ... more cities
]

Vehicles

List available vehicles in a city

Options
  • loc Required - The city to list vehicles in.
  • format - The output format. Must be kml or json, defaults to kml.
Usage
car2go.vehicles({
  format: "json",
  loc: "Toronto"
}, function(err, vehicles) {
  console.log(vehicles);
});

// Output

{
  address: 'Green P-141 Greenlaw Ave(S of St Clair  Ave W)',
  coordinates: [ -79.44774, 43.6762, 0 ],
  engineType: 'CE',
  exterior: 'GOOD',
  fuel: 100,
  interior: 'GOOD',
  name: 'BPXL726',
  vin: 'WMEEJ3BA8DK643640'
},
... more cars

Keywords

FAQs

Package last updated on 28 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc