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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tradera-soap-api-client

v1.5.1

Published

Tradera API Client with typescript support

Readme

Tradera SOAP API Client

A fully-typed TypeScript client for the Tradera SOAP API. This package provides easy-to-use clients for Tradera's services, with auto-generated TypeScript types and client bindings.

Features

  • 🔒 Fully typed - Complete TypeScript definitions for all API methods and responses
  • Async/await support - All API methods return Promises
  • 🛠️ IntelliSense support - Full autocomplete in VS Code and other TypeScript-aware editors
  • 🌳 Tree-shakeable - Import only what you need
  • 🔄 Auto-generated - Client code is generated directly from Tradera's WSDL definitions

Official Tradera API Documentation

Installation

npm install tradera-soap-api-client

or if you use yarn

yarn add tradera-soap-api-client

Usage

Search Service

Use TraderaSearchClient for searching items on Tradera:

import { TraderaSearchClient } from 'tradera-soap-api-client';

const searchClient = new TraderaSearchClient({
  appId: YOUR_APP_ID,
  appKey: "YOUR_APP_KEY"
});

// Basic search
const result = await searchClient.search({
  query: "vintage",
  categoryId: 0
});

console.log(result.SearchResult?.Items);
console.log(result.SearchResult?.TotalNumberOfItems);

// Advanced search with filters
const advancedResult = await searchClient.searchAdvanced({
  query: "retro",
  categoryId: 0,
  pageNumber: 1,
  itemsPerPage: 50,
  orderBy: "EndDateAscending"
});

// Search by zip code
const localResult = await searchClient.searchByZipCode({
  zipCode: "11122",
  distance: 10,
  categoryId: 0
});

Public Service

Use TraderaPublicClient for accessing item details, user information, categories, and more:

import { TraderaPublicClient } from 'tradera-soap-api-client';

const publicClient = new TraderaPublicClient({
  appId: YOUR_APP_ID,
  appKey: "YOUR_APP_KEY"
});

// Get item details
const item = await publicClient.getItem({ itemId: 123456789 });
console.log(item.GetItemResult?.Title);
console.log(item.GetItemResult?.CurrentBid);

// Get all categories
const categories = await publicClient.getCategories({});
console.log(categories.GetCategoriesResult?.Categories);

// Get user information
const user = await publicClient.getUserByAlias({ alias: "username" });
console.log(user.GetUserByAliasResult?.TotalRating);

// Get seller's items
const sellerItems = await publicClient.getSellerItems({ sellerId: 12345 });
console.log(sellerItems.GetSellerItemsResult?.Items);

// Get user feedback
const feedback = await publicClient.getFeedback({ userId: 12345 });
console.log(feedback.GetFeedbackResult?.Feedbacks);

// Get official Tradera time (for auction endings)
const time = await publicClient.getOfficalTime({});
console.log(time.GetOfficalTimeResult);

Using the Raw SOAP Client

For more control, you can use the generated SOAP client directly:

import { createClientAsync } from './src/generated/search/client.js';

async function searchTradera() {
  const wsdlUrl = "http://api.tradera.com/v3/SearchService.asmx?WSDL";
  const client = await createClientAsync(wsdlUrl);

  // Add required Tradera authentication headers
  client.addSoapHeader({
    AuthenticationHeader: {
      AppId: YOUR_APP_ID,
      AppKey: "YOUR_APP_KEY"
    }
  }, '', 'tns', 'http://api.tradera.com');

  // Search for items
  const result = await client.SearchAsync({
    query: "vintage",
    categoryId: 0
  });

  console.log(result.SearchResult?.Items);
  console.log(result.SearchResult?.TotalNumberOfItems);
}

Available API Methods

Search Service

Official Documentation

| Method | Description | Documentation | |--------|-------------|---------------| | search | Search for items | Search | | searchAdvanced | Advanced search with filters | SearchAdvanced | | searchCategoryCount | Get category counts for search | SearchCategoryCount | | searchByFixedCriteria | Search with fixed criteria lists | SearchByFixedCriteria | | searchByZipCode | Search items near a zip code | SearchByZipCode |

Public Service

Official Documentation

| Method | Description | Documentation | |--------|-------------|---------------| | getItem | Get details for a specific item | GetItem | | getSellerItems | Get items from a specific seller | GetSellerItems | | getSellerItemsQuickInfo | Get minimal item info (useful for new items) | GetSellerItemsQuickInfo | | getUserByAlias | Get user information by alias | GetUserByAlias | | fetchToken | Fetch authorization token | FetchToken | | getOfficalTime | Get official Tradera time | GetOfficalTime | | getCategories | Get category hierarchy | GetCategories | | getAttributeDefinitions | Get attribute definitions for a category | GetAttributeDefinitions | | getAcceptedBidderTypes | Get accepted bidder types | GetAcceptedBidderTypes | | getExpoItemTypes | Get expo item types with prices | GetExpoItemTypes | | getItemTypes | Get available item types | GetItemTypes | | getCounties | Get list of counties for search | GetCounties | | getItemFieldValues | Get available item field values | GetItemFieldValues | | getItemAddedDescriptions | Get added descriptions for an item | GetItemAddedDescriptions | | getFeedback | Get user feedback | GetFeedback | | getFeedbackSummary | Get user feedback summary | GetFeedbackSummary | | getShippingOptions | Get shipping options for countries | GetShippingOptions |

Deprecated Methods

| Method | Description | Use Instead | |--------|-------------|-------------| | getSearchResult | Search for items | TraderaSearchClient.search | | getSearchResultAdvanced | Advanced search | TraderaSearchClient.searchAdvanced | | getSearchResultAdvancedXml | XML-based search | TraderaSearchClient.searchAdvanced | | getPaymentTypes | Get payment types | getItemFieldValues | | getShippingTypes | Get shipping types | getItemFieldValues |

Scripts

Build

npm run build

Compiles TypeScript to JavaScript in the dist/ folder.

Regenerate Client

npm run generate-client

Regenerates the TypeScript client from Tradera's WSDL definitions. This fetches the latest WSDL from:

  • http://api.tradera.com/v3/SearchService.asmx?WSDL
  • http://api.tradera.com/v3/PublicService.asmx?WSDL

Authentication

To use the Tradera API, you need to register for API credentials at Tradera's developer portal. You will receive:

  • AppId - Your application ID (number)
  • AppKey - Your application key (GUID string)

These are automatically included in SOAP headers when using the wrapper clients.

User Impersonation

Some services require user impersonation in addition to app credentials. This means you need to provide the Tradera user's ID and authorization token:

const client = new TraderaRestrictedClient({
  appId: YOUR_APP_ID,
  appKey: "YOUR_APP_KEY",
  userId: 12345,          // Tradera user ID
  token: "USER_TOKEN"     // Authorization token
});

To obtain a user token, use the fetchToken method from TraderaPublicClient:

import { TraderaPublicClient } from 'tradera-soap-api-client';

const publicClient = new TraderaPublicClient({
  appId: YOUR_APP_ID,
  appKey: "YOUR_APP_KEY"
});

const tokenResponse = await publicClient.fetchToken({
  userName: "trader-username",
  password: "trader-password"
});

console.log(tokenResponse.FetchTokenResult); // The auth token

Tree Shaking

This package supports tree shaking. You can import only what you need:

// Import only the search client
import { TraderaSearchClient } from 'tradera-soap-api-client';

// Or import types directly from subpaths
import { Search } from 'tradera-soap-api-client/search';
import { Public } from 'tradera-soap-api-client/public';

Dependencies

License

MIT