Auto-fill bazaar items with market-based pricing (PDA optimized)
A userscript for Torn that fills your bazaar listings with market-based prices in one click — per item or for the whole page — with configurable discounting, NPC-floor protection, and ranked-war weapon detection.
Current version: 2.9.1 — see the CHANGELOG for what's new.
torn-bazaar-quick-pricer.user.js from this repo's raw view.###PDA-APIKEY###
mechanism — no manual key entry needed.The script only reads public item market data, so a Public-level key is all it needs. Don't paste a Full Access key into any third-party script.
To create one: Torn → Settings → API Keys → Create Key → Public.
You'll be prompted for the key on first run; you can change it later from the
settings panel (gear icon on the floating chip). The key is stored locally in your
userscript manager's storage and sent only to api.torn.com.
Open with the gear icon on the floating chip.
| Setting | Default | Meaning |
|---|---|---|
| API key | — | Your 16-character Torn API key (Public scope is enough). |
| Discount % | 0 | Percentage knocked off the market value (0–99.9). |
| Alert at % | 20 | Ask before applying a price change larger than this (0 asks on every change). |
| Cache (min) | 5 | How long fetched prices are reused before re-querying the API (1–120 minutes). |
| NPC floor enforcement | on | Never price below the item's NPC sell value. |
| Skip RW weapons | on | Batch runs skip detected ranked-war weapons. |
| Skip $1 items | on | Update All leaves $1 (giveaway) listings alone; per-item buttons still work on them. |
| Clear cache | — | Drops all cached prices immediately. |
npm install
npm run lint # ESLint (flat config, userscript globals)
npm test # Vitest + jsdom unit tests
The script is a single file, torn-bazaar-quick-pricer.user.js. A test hook at the
bottom of the IIFE exports its pure helpers to the Node test runner; the hook is
inert in the browser. CI runs lint + tests on every pull request.
Maintenance notes:
SELECTORS object near the top of the script — if Torn ships a rebuild,
that's the place to fix.###PDA-APIKEY### literal must appear exactly once in the file (Torn PDA
find/replaces every occurrence with the real key). Never compare against the
token; validate keys by format.debug flag in userscript storage to enable verbose per-item logging.An audit-driven task list lives in IMPROVEMENT-TASKS.md; almost all of it shipped in v2.9.
MIT — © Zedtrooper [3028329]