Fully-typed TypeScript SDK covering Browse, Inventory, Fulfillment, Marketing, and more. Zero dependencies.
A production-ready SDK with built-in auth, rate limiting, retries, and pagination — so you can focus on your app.
Client Credentials for app tokens and Authorization Code Grant for user tokens. Automatic caching and refresh-ahead.
Configurable token-bucket rate limiter prevents you from hitting eBay's API limits. Set your own requests-per-second cap.
Exponential backoff with jitter on 429 and 5xx errors. Configurable max retry attempts to keep your app resilient.
Async iterators and collect-all helpers make it easy to page through large result sets without manual offset management.
1,200+ lines of request/response types. Get autocomplete and compile-time checks for every endpoint parameter.
Uses native fetch (Node.js 18+). No bloated dependency tree — just your code and the eBay API.
Access every major eBay REST API through a single, consistent interface.
6 endpoints
7 endpoints
1 endpoint
18 endpoints
6 endpoints
20 endpoints
17 endpoints
8 endpoints
7 endpoints
2 endpoints
Rate limits
Get your API credentials from the eBay Developer Program, install the package, and start making requests.
import { Client } from "@tradebuddyhq/ebay-wrapper"; const client = new Client({ clientId: process.env.EBAY_CLIENT_ID!, clientSecret: process.env.EBAY_CLIENT_SECRET!, marketplaceId: "EBAY_US", }); // Search for items const results = await client.buy.browse.search({ q: "mechanical keyboard", limit: 5, }); for (const item of results.itemSummaries ?? []) { console.log( `${item.title} — ${item.price?.value}` ); }
Access Inventory, Fulfillment, Account, Marketing, and Finances with the built-in Authorization Code Grant flow.
// 1. Send the user to eBay to authorize const authUrl = client.oauth.generateAuthUrl( "https://yourapp.com/callback" ); // 2. Exchange the callback code const tokens = await client.oauth.exchangeCodeForToken( code, "https://yourapp.com/callback" ); // 3. Use the refresh token going forward const seller = new Client({ clientId, clientSecret, refreshToken: tokens.refresh_token, }); const orders = await seller.sell .fulfillment.getOrders();
Iterate through pages with async iterators or collect all results at once. No manual offset tracking needed.
import { paginate, paginateAll } from "@tradebuddyhq/ebay-wrapper"; // Iterate page by page for await (const page of paginate( (p) => client.buy.browse.search(p), { q: "laptop", limit: 50 } )) { console.log(page.total); } // Or collect everything const all = await paginateAll( (p) => client.buy.browse.search(p), { q: "laptop", limit: 200 }, (page) => page.itemSummaries );
Catch specific error types for rate limits, auth failures, timeouts, and API errors. Each carries structured data from eBay's response.
import { EbayError, EbayRateLimitError, EbayAuthError, EbayTimeoutError } from "@tradebuddyhq/ebay-wrapper"; try { await client.buy.browse.getItem(id); } catch (err) { if (err instanceof EbayRateLimitError) console.log(err.retryAfterMs); else if (err instanceof EbayAuthError) console.log("Auth failed"); else if (err instanceof EbayError) console.log(err.status, err.errors); }
Install the package and make your first API call in under a minute.