DEV Community

Cover image for Set up cex-uk-prices in 2 minutes, with a live check every week
Christian Anderson
Christian Anderson

Posted on

Set up cex-uk-prices in 2 minutes, with a live check every week

cex-uk-prices looks up CeX UK's sell, cash and voucher prices from the same public search their website uses. Setup takes two minutes, because there's nothing to set up:

git clone https://github.com/casareanderson/cex-uk-prices && cd cex-uk-prices
python3 -m unittest discover -s tests -t .
python3 -m cexuk "Sony WH-1000XM4"
Enter fullscreen mode Exit fullscreen mode

No packages, no key, no account.

Testing something you don't control

The risk with this one isn't my code, it's CeX. It's an undocumented endpoint, and it changes whenever their front end does. So the weekly check makes one real lookup from GitHub, as well as the offline tests:

The weekly check including one live lookup

On 11 October that came back with 6 graded rows and £105 cash for the headphones. If CeX moves the search, that job goes red and I know before anyone opens an issue. It runs from the weekly schedule or a manual run in my repo only, never from pull requests or forks, and it's one request a week. Be slow, say who you are, and if an honest client ever gets turned away, take that as the answer.

Read the traps before you trust a number

The search always answers, even for the wrong product. Ask about a Pi case and you can get a confident £136 cash offer for a Raspberry Pi 500+. That's what --rejected shows:

What CeX returned that wasn't the product

And £0 cash means "won't buy", not "worthless". The full guide has the Python API and the common errors: docs/SETUP.md. Not affiliated with CeX, and their terms apply to you.

What's the worst trade-in quote you've had?


🤖 Drafted with AI assistance from my own homelab notes, logs and repos, then reviewed and edited before publishing.

Top comments (0)