0.3.5 • Published 3 years ago

tradera-api-client v0.3.5

Weekly downloads
5
License
LGPL-3.0-only
Repository
github
Last release
3 years ago

Tradera API client

This package enables a user to use the official Tradera API from withing their JavaScript/TypeScript projects. At the moment, only a subset of the PublicService and SearchService has been implemented.

Installation

npm install tradera-api-client

Usage

Initialization

import { TraderaApiClient } from "tradera-api-client";

try {
    const appId = "secret"; // Retrieved from Tradera's developer center
    const appKey = "also secret"; // Retrieved from Tradera's developer center
    const apiClient = new TraderaApiClient(appId, appKey);
    await apiClient.init();
} catch (e) {
    console.log(`Error while initializing the API client: ${e});
}

Calling API methods

The Tradera API is divided into six SOAP services: BuyerService, ListingService, OrderService, PublicService, RestrictedService and SearchService. These are exposed through instance variables of TraderaApiClient. For instance, this is how you call GetOfficialTime to retrieve the time from Tradera:

try {
    const officialTime = await apiClient.publicService.GetOfficalTime();
    console.log(`Official time is ${officialTime}`);
} catch (e) {
    console.log(`Error while fetching the time from Tradera: ${e});
}

Contributing

Feel free to send pull requests.

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.3.1

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago