eBay CLI tool for searching items, managing seller orders, and handling shipping. Also works as a Claude Code plugin.
git clone https://github.com/bradjmsu/ebay-cli.git
cd ebay-cli
npm install
npm linkVerify: ebay --version
- Sign up at https://developer.ebay.com
- Go to https://developer.ebay.com/my/keys
- Create a Production keyset if you don't have one
- Note your App ID (Client ID) and Cert ID (Client Secret)
ebay auth set-credentials --app-id "YOUR_APP_ID" --cert-id "YOUR_CERT_ID" --ru-name "YOUR_RU_NAME"This saves them to ~/.ebay/.env (never committed to git).
With just App ID + Cert ID, you can search and browse items. For seller features (orders, shipping), you need OAuth2 user authentication — continue to step 3.
ebay auth loginThis opens eBay's sign-in page in your browser. After you consent:
- eBay redirects to a success page
- Copy the full URL from the browser bar (it contains a
code=parameter) - Extract the code value (everything after
code=up to the next&, URL-decoded) - Run:
ebay auth exchange "YOUR_AUTHORIZATION_CODE"This exchanges the code for an access token (2 hours) and refresh token (~18 months). The CLI auto-refreshes expired access tokens using the stored refresh token.
Note: eBay requires HTTPS redirect URIs in production, so the CLI can't catch the callback automatically on localhost. The manual code exchange is the workaround.
To set up the RuName (redirect URL), go to the User Tokens page on the eBay developer portal and configure an eBay Redirect URL for your app.
ebay auth status --pretty# Basic search
ebay search "mechanical keyboard" --pretty
# With filters
ebay search "macbook pro" --condition USED --max-price 800 --buy-now --pretty
# Auctions only, sorted by price
ebay search "vintage rolex" --auction --sort price --limit 5 --pretty
# Free shipping, price range
ebay search "usb-c dock" --free-shipping --min-price 50 --max-price 200 --pretty| Flag | Description | Default |
|---|---|---|
--limit <n> |
Max results | 10 |
--offset <n> |
Skip first N results | 0 |
--sort <field> |
price, -price, date, -date, newlyListed |
relevance |
--condition <cond> |
NEW, USED, REFURBISHED, UNSPECIFIED |
all |
--min-price <n> |
Minimum price (USD) | — |
--max-price <n> |
Maximum price (USD) | — |
--category <id> |
eBay category ID | — |
--buy-now |
Fixed price listings only | — |
--auction |
Auction listings only | — |
--free-shipping |
Free shipping only | — |
--fields <list> |
Comma-separated fields to include | all |
--pretty |
Pretty print JSON | — |
# Full item details
ebay item get "v1|382282567190|651094235351" --pretty
# Compare multiple items
ebay item compare "v1|123,v1|456,v1|789" --pretty# List recent orders
ebay orders list --pretty
# Filter by status
ebay orders list --status IN_PROGRESS --pretty
# Last 7 days
ebay orders list --days 7 --pretty
# Full order details
ebay orders get "11-06241-16499" --pretty
# Mark order as shipped
ebay orders ship "ORDER_ID" --tracking "9400111899223456789012" --carrier USPSCommon carriers: USPS, UPS, FEDEX, DHL, OTHER
# Get shipping rates for an order
ebay labels rates "ORDER_ID" --pretty
# Create a label from a quote
ebay labels create "QUOTE_ID" --pretty
# Download label PDF
ebay labels download "SHIPMENT_ID"Note: The Logistics API is restricted to approved eBay partners. If you get a 403 error, buy labels on ebay.com or Pirate Ship, then use
ebay orders shipto record the tracking number.
All commands output JSON by default. Add --pretty for formatted output, or pipe to jq:
ebay search "gpu" | jq '.items[] | {title, price}'
ebay item get "v1|123" | jq '.specs'This repo works as a Claude Code plugin. To install it:
- Clone the repo and
npm install - Symlink it into your plugins directory:
ln -s /path/to/ebay-cli /path/to/your/plugins/ebay-cli-skill- Register the plugins directory as a local marketplace in your Claude Code
settings.json:
{
"extraKnownMarketplaces": {
"my-local": {
"source": {
"source": "directory",
"path": "/path/to/your/plugins"
}
}
}
}The skill doc teaches Claude how to use every command with examples and workflows.
Not all eBay APIs are available to every developer account. Here's what you can expect:
| Feature | API | Access |
|---|---|---|
| Search items | Browse API | Open |
| Item details | Browse API | Open |
| Seller orders | Fulfillment API | Open (user OAuth) |
| Mark shipped | Fulfillment API | Open (user OAuth) |
| Inventory management | Inventory API | Open (user OAuth) |
| Shipping labels | Logistics API | Restricted (partner approval) |
| Place orders / Buy It Now | Order API | Restricted (business approval) |
| Place auction bids | Offer API | Restricted (business approval) |
For restricted APIs, apply through the eBay Developer Portal.
All credentials are stored locally in ~/.ebay/.env with 600 permissions. Nothing is committed to this repo. You'll need:
| Variable | Where to Get It |
|---|---|
EBAY_APP_ID |
eBay Developer Portal → App ID (Client ID) |
EBAY_CERT_ID |
Same page → Cert ID (Client Secret) |
EBAY_RU_NAME |
User Tokens page → RuName (eBay Redirect URL name) |
EBAY_REFRESH_TOKEN |
Generated via ebay auth login + ebay auth exchange |
EBAY_ACCESS_TOKEN |
Auto-managed (refreshed from refresh token) |
MIT