AliExpress search cards round their sales: "1,000+ sold", "5,000+ sold", "10,000+ sold". For product research that hides a lot. In my test runs, the cards that said "10,000+ sold" had between 10,000 and 39,196 orders, and the ones that said "5,000+ sold" had between 5,000 and 9,966. Two products with the same label can differ by almost 4x.
This post walks through two small Python scripts:
- Best sellers: search a few keywords sorted by orders, keep products with 500 or more orders, rank them across all keywords by their exact order count, and save them to CSV.
- Rank tracker: run once a day and see which products moved up or down for a keyword.
The full code is on GitHub: scrapelark/aliexpress-search-scraper-python. The scripts call the AliExpress Search Scraper on Apify, which I built. It costs $2 per 1,000 products with a price, and Apify's free plan includes $5 of usage a month, so everything in this post fits in the free plan.
Setup
You need Python 3.11 or newer, a free Apify account and your API token from Console > Settings > API & Integrations.
git clone https://github.com/scrapelark/aliexpress-search-scraper-python.git cd aliexpress-search-scraper-python python3 -m venv .venv .venv/bin/pip install -r requirements.txt export APIFY_TOKEN=your_token One search
Here is the core of it, without the CSV and printing parts:
import os from decimal import Decimal from apify_client import ApifyClient client = ApifyClient(os.environ["APIFY_TOKEN"]) run = client.actor("scrapelark/aliexpress-search-scraper").call( run_input={ "searchQueries": ["wireless earbuds"], "maxResults": 20, "shipTo": "US", "currency": "USD", }, max_total_charge_usd=Decimal("0.05"), # a hard cap: 20 products at $0.002, plus room ) for row in client.dataset(run.default_dataset_id).iterate_items(): if row["status"] == "ok" and row["price"] is not None: print(row["rank"], row["price"], row["totalSoldCount"], row["title"][:50]) max_total_charge_usd is worth knowing: the run stops before it would cost more than that, so a typo in maxResults can't turn into a surprise bill.
search.py in the repo is this plus a table and a CSV file. A real run from 3 December 2026, the first 8 of 20 rows:
Rank Price Crossed-out Without deal Orders Stars From Title 1 18.79 57.55 57.55 463 4.9 US 2026 New Air 3【 Pro 】 Bluetooth Wireless Earbuds, 2 3.74 33.73 33.73 634 4.9 US SK26 Bluetooth 5.4 Wireless Earphones Small Earbud 3 5.80 30.74 30.74 102 4.9 US 2026 New Open-ear Bone Conduction Headphones Built 4 8.99 30.37 ? 25346 4.6 CN Wireless Bluetooth Headphones Lenovo LP75 Sports W 5 6.09 36.49 36.49 46 4.9 US INSONIXN SK55 Mini Invisible Wireless Bluetooth Ea 6 15.30 51.95 51.95 6840 4.9 US 2026 New Air 3【 Pro 】 Bluetooth Wireless Earbuds, 7 1.09 15.42 15.42 1926 4.9 CN TWS True Wireless Stereo Headset Touch Contro With 8 15.39 31.74 ? 14351 4.7 CN Wireless Bluetooth Headset Lenovo XT80 Wireless He The product at rank 4 shows "10,000+ sold" on AliExpress, and totalSoldCount gives the number behind it: 25,346. Further down the same run, rank 11 also says "10,000+ sold" and has 39,196.
Every row also has rank (the position a shopper scrolls to), isAd (sponsored cards), shipFrom (CN, US, ...), delivery days and isChoice. "Crossed-out" is the price before the discount; "Without deal" and the ? are explained further down.
Best sellers across keywords
For product research you usually look at a niche, not one keyword. best_sellers.py searches several keywords at once, each sorted by orders, and lets the scraper drop products under 500 orders:
run_input = { "searchQueries": ["dog toys", "cat bed", "pet water fountain"], "maxResults": 50, # products with a price per keyword "sort": "orders", # most orders first "minOrders": 500, "shipTo": "US", "currency": "USD", } The same product can come up for more than one keyword, so the script keeps it once and remembers its keywords. Then it ranks everything by the exact count:
best = {} for p in run_search(run_input): product = best.setdefault(p["id"], {**p, "keywords": []}) if p["searchQuery"] not in product["keywords"]: product["keywords"].append(p["searchQuery"]) ranked = sorted(best.values(), key=lambda p: p.get("totalSoldCount") or 0, reverse=True) Sorting on the rounded "10,000+ sold" text would put 10,000 and 39,196 in a tie. Sorting on totalSoldCount doesn't.
A real run (3 December 2026), the top 10 of 150 products:
Orders Price Crossed-out Without deal Stars From Title 58006 2.65 5.82 2.65 4.9 CN Dog Toy Rolling Ball Cat Rechargeable Interactive 36702 1.09 9.86 ? 4.6 CN Dog Cooling Mat Summer Pet Cold Bed Extra Large Fo 35908 0.33 4.89 ? 4.9 CN Yellow Duck Dog Plush Toy Bite Resistant Corn Velv 25745 0.33 3.11 ? 4.9 CN Cross-border pet dog leakage toy balls, teething p 23221 1.09 4.97 4.97 4.6 CN New Dog Interactive Ball Toy,Automatic Rolling Dog 21932 0.33 5.12 ? 4.8 CN Dog sleeping with a dog hug duck toys to relieve b 21127 0.33 5.36 ? 4.9 CN Indestructible Pet Toys for Aggressive Chewers Cat 20856 1.86 4.07 1.86 4.9 CN Interactive Cat Dog Toy Set with Colorful Flying D 20321 0.33 5.91 ? 4.9 CN Squeaky Octopus Dog Plush Chew Toy with Braided Co 20177 0.33 3.17 ? 4.9 CN 16.5 Inches Dog Toy Snake Interactive Toy Kitten K A rolling ball toy leads with 58,006 orders. The $0.33 plush toys are new-shopper deals, more on that below.
All of them go to best_sellers.csv. Two settings at the top of the script narrow it down:
-
SHIP_FROM = "US": only products sent from a US warehouse, for fast delivery to US customers -
MAX_PRICE = 20: only products up to that price
The whole run is 150 products, so at most $0.30.
Don't use the card price for margins
The "Without deal" column is there for a reason. AliExpress treats a logged-out visitor as a new shopper, and many products show a first-order deal ("New shoppers save $20.97", or just a "WELCOME DEAL" banner on the photo). In 7 test searches I ran this week (US, UK, Canada and Australia), 72% of 650 cards were new-shopper deals. That price is not what you pay when you order the product again.
newShopperDeal marks those cards. When the card shows the saving, priceWithoutNewShopperDeal adds it back: what a repeat buyer likely pays. A ? means the card marks the deal but doesn't show the amount. For those, use the crossed-out price: on every card that did show the saving, price + saving was exactly the crossed-out price (176 of 176).
The crossed-out price alone isn't enough, though. Plenty of cards are on a normal sale for everyone: at rank 14 of the earbuds search above, a pair costs $5.95 with $11.90 crossed out and no new-shopper mark, and everybody pays $5.95. You need the mark to know which case you're in.
Honest note: writing this post is how I found that my scraper missed the deals marked only by that photo banner. The mark is in the card's data, it just wasn't being read. It's fixed, and the numbers here come from the fixed version. More on new-shopper prices: Most AliExpress prices you scrape are new-shopper deals.
Track rank every day
rank_tracker.py answers a different question: where do products rank for my keyword, and what moved since yesterday? Each run adds the top 60 products (about the first page) to ranks.csv: time, product id, rank, rank without ads, price, price without the deal and orders. From the second run on, it prints the biggest moves. My first run for "led strip lights" was on the evening of 2 December (UTC), the second about 10 hours later:
Added 60 products to ranks.csv (2026-12-03 06:03:34 UTC). Biggest moves since the last check: #5 (was #62, up 57): Neon Rope Light, Flexible Led Lights Control with #51 (was #4, down 47): WS2812B Led Lights DC5V WS2812 RGB Led Strip Light #52 (was #24, down 28): LED Strip Light COB 1-50M 220V COB LED Strip Light #57 (was #35, down 22), price without deal 2.96 -> 2.97: DC 5V USB LED Lights Strips 2835 White Warm White #58 (was #41, down 17): DC 12V 5M 300led RGB Led Strip SMD 2835 Blue Red G #4 (was #20, up 16): LED Strip Light COB UL Listed COB LED Strip Light #37 (was #22, down 15): COB Lights LED Strip Touch Dimmer Flexible Diode T #47 (was #33, down 14): 5V USB COB Led Strip Lights with 3key Dimmer Flexi #42 (was #29, down 13), price without deal 15.65 -> 15.67: FOB COB LED Strip Lights 12V 2M 3M 5M High Density #55 (was #42, down 13): LED Strip Lights USB 5V COB Led Strip with Dimmer New in the top 60: 38. Dropped out: 38. A few things to know when you read it:
-
rankcounts every card a shopper scrolls past, ads included, and also cards the script leaves out (like free-gift cards). That's why 60 products can reach #62. - Three of these ten are sponsored cards. The biggest drop, #4 to #51, is one of them: at #4 it was an ad, now it's a normal card. Sponsored spots move a lot, so
rankWithoutAdsinranks.csvis the steadier number to follow. - Both price changes are a cent or two. Of the 22 products seen in both runs, 9 had their price without the deal go up by about 0.15% at the same time and the rest stayed the same, so it looks like currency conversion, not a seller's change.
- 38 of the 60 products were new after only 10 hours. I don't know yet how much of that is real movement and how much is AliExpress showing a new visitor a different mix, so one jump isn't a trend.
ranks.csvkeeps every run: look at a week before you act on it.
The tracker compares the price without the deal, not the card price, because new-shopper prices change from one visit to the next and would show up as fake price changes.
Run it every day at 8:00 with cron:
0 8 * * * APIFY_TOKEN=your_token /path/to/repo/.venv/bin/python /path/to/repo/rank_tracker.py >> /path/to/repo/rank_tracker.log 2>&1 The README has the Windows Task Scheduler line too. One run is 60 products, $0.12, so about $3.60 a month if you run it every day.
Next: variants and shipping
A search card has one price. If you want every variant (color, size) with its own price and stock, and every shipping option for your country, send the productUrl values to the AliExpress Product Details Scraper. The repo README has a short example of search, then details.
If you're missing a field or something breaks, tell me in the comments.