Necrotizing Pineapple Music

    toyota-client

    0.0.8 • Public • Published

    Toyota API Client

    An unofficial API client that retrieves data on Toyota vehicles, directly from toyota.com.

    Requirements

    Node.js

    Installation

    npm install toyota-client

    Usage

    Setting up a client instance is simple:

    const Toyota = require('toyota-client');
    const client = new Toyota();

    Methods

    Get all vehicles

    getAllVehicles()

    Example response here.

    This method gets all Toyota vehicles.

    client
        .getAllVehicles()
        .then(function(vehicles) {
            // ...
        })
        .catch(function(err) {
            throw err;
        });

    Get a vehicle

    getVehicle(model[, year])

    Example response with year here and without year here.

    This method gets a specific Toyota vehicle. If a year is not specified, all generations of the vehicle model will be returned. If a year is specified, that year's vehicle model will be returned.

    client
        .getVehicle('Corolla')
        .then(function(generations) {
            // ...
        })
        .catch(function(err) {
            throw err;
        });

    or

    client
        .getVehicle('Corolla', 2022)
        .then(function(generation) {
            // ...
        })
        .catch(function(err) {
            throw err;
        });

    Get information on Toyota dealers

    getDealers(zipCode)

    Example response here.

    This method gets Toyota dealers near a certain zip code.

    client
        .getDealers(53075)
        .then(function(dealers) {
            // ...
        })
        .catch(function(err) {
            throw err;
        })

    Tests

    To run the existing tests, simply issue the following command:

    npm test

    Disclaimer

    This client retrieves data directly from Toyota's website, but is not an "official" Toyota client. This is meant to be used for learning purposes only. Use at your own risk.

    Install

    npm i toyota-client

    DownloadsWeekly Downloads

    22

    Version

    0.0.8

    License

    MIT

    Unpacked Size

    500 kB

    Total Files

    15

    Last publish

    Collaborators

    • camrymps