Metadata-Version: 2.4
Name: ebay-sniper
Version: 0.2.0
Summary: One bid with your maximum on any eBay auction, too late for others to react
Keywords: ebay,auction,sniper,bid-sniping,bidding,cli
Author: Vincenzo Imperati
Author-email: Vincenzo Imperati <61617279+VincenzoImp@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Dist: drissionpage>=4.1.1.4,<5
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/VincenzoImp/ebay-sniper
Project-URL: Issues, https://github.com/VincenzoImp/ebay-sniper/issues
Description-Content-Type: text/markdown

# eBay Sniper

[![CI](https://github.com/VincenzoImp/ebay-sniper/actions/workflows/ci.yml/badge.svg)](https://github.com/VincenzoImp/ebay-sniper/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/ebay-sniper)](https://pypi.org/project/ebay-sniper/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/VincenzoImp/ebay-sniper/blob/main/LICENSE)

**Bid your maximum at the last moment eBay still records it, with no time left for anyone to answer.**

eBay Sniper places one bid on an eBay auction, timed so that eBay records it about half a second before the end. It's free and open source, and it runs on your computer with your own eBay account.

```sh
uvx ebay-sniper 'https://www.ebay.com/itm/123456789012' --max 120
```

## Why the timing matters

eBay doesn't record a bid the moment it arrives: it takes 1.3–1.6 seconds. We measured this with real bids against eBay's own server clock. A bid sent in the final second is recorded after the end.

So eBay Sniper doesn't guess:

- **It measures.** One minute before the end, it times how long eBay takes to handle a bid right now.
- **It sends early enough.** The bid goes out about 2 seconds before the end, and eBay records it about half a second before.
- **It rehearses first.** When you start it, it goes through eBay's bid form up to the confirm button, without clicking it. A too-low amount or a signed-out session shows up then, not in the last second.
- **It corrects your clock** against internet time servers.

A sniper can't beat a higher maximum: if someone else's is higher, they still win. What it prevents is others seeing your bid in time to raise theirs.

## Install and use

You need Chrome, Brave, Edge or Chromium. `uv` installs Python by itself; with `pip`, you need Python 3.13 or later.

```sh
uv tool install ebay-sniper     # or: pip install ebay-sniper
ebay-sniper '<item link>' --max <amount>
```

1. A browser window opens. The first time, sign in to eBay. The session stays on your computer.
2. The bot rehearses the bid, then shows the item, the end time and your maximum. Type `y` to schedule it.
3. Leave the terminal, the browser and the computer on until the auction ends.

It works on every eBay site and language. Run one command per auction; several can run at once. If eBay shows a human check, complete it in the browser.

| Option | Effect |
|---|---|
| `--at HH:MM:SS` | For a test: treat this local time as the end. The bid is real. |
| `--browser PATH` | Use this browser if none is found automatically. |

Every bid is logged to `~/.ebay-sniper/history.jsonl`.

## Limits

- The browser window must stay visible: eBay blocks headless browsers.
- eBay [allows sniping](https://www.ebay.com/help/buying/bidding/bid-sniping?id=4224), but its [User Agreement](https://www.ebay.com/help/policies/member-behaviour-policies/user-agreement?id=5414) prohibits automated access without permission. Use at your own risk.
- If eBay changes its pages, update the selectors at the top of [`browser.py`](https://github.com/VincenzoImp/ebay-sniper/blob/main/src/ebay_sniper/browser.py).

## Develop

```sh
uv sync && uv run ruff check . && uv run pytest
EBAY_ITEM='<item link>' EBAY_MAX=<amount> uv run pytest tests/test_live.py -s  # real flow, never confirms
```
