Commerce / FIELD GUIDE

How to scrape AliExpress search results with Python

New in version 1.1.7 (12 November 2026)

Three optional inputs. None of them adds a charge.

Compare the same product across countries. Add "compare_countries": ["GB", "AU", "DE"] (up to 10 codes). Each product gets a country_comparison object with its listing price in every country where the same product appeared in the search results, the cheapest country and the price spread. In a live run on 12 November 2026 with "yoga mat", 14 of 30 US products were also found in GB, AU or DE. A product missing from another country's results is listed under not_in_results; that does not mean it cannot be bought there.

Track price and sales changes between runs. Add "track_changes": true and run the same search again later, for example on a daily schedule. Each product gets a changes object: previous price, price change, units sold since the previous run and whether it is new in the results. The first run only records the baseline. AliExpress shows different products from one request to the next, so use 60 or more products per search.

Supplier match from a Shopify product link. Give "store_product_urls": ["https://store.com/products/product-name"] (up to 20). The run reads the product's public title and price, searches AliExpress by the title and returns up to 5 listings with title_similarity and the price gap. Matching is by title text only: it does not confirm that a listing is the same product, and the gap is not profit. Branded or unique products usually return "no close match" and are not charged.

Every product also has sold_per_day (units sold divided by days since the listing date, a lifetime average) and global_product_id (the same product has the same ID on every country storefront). Very low prices such as 1.09 USD can be promotional prices for new visitors. Check the product page before relying on a price.

Compare AliExpress listing prices in Excel

Open AliExpress input in Apify · Download starter JSON

Try one keyword, such as yoga mat, with a limit of five products. Choose a delivery country and currency. Check event pricing and set a total charge limit before running. In Output, export CSV.

View the captured November 4 sample (JSON) or download CSV. Listing prices may exclude shipping and taxes.

中文快速开始(速卖通商品比价)

打开采集工具,输入关键词(例如 `yoga mat`),首次最多取 5 条。选择收货国家和币种,运行前查看计费并设置费用上限。运行后在 Output(输出)中导出 CSV,用 Excel 比较同一收货地、同一币种的商品标价。标价可能不含运费和税费。

Get AliExpress search results as JSON with Python: titles, prices in your currency, ratings, orders sold and links. No browser, 60 products per page.

Start with a product question and a query you can inspect. The AliExpress Search Scraper accepts search terms, a currency and a ship-to country, then returns product search results as JSON. Keep those settings with your output when you compare listings or repeat a collection.

The AliExpress Search Scraper uses plain HTTP with automatic proxy fallback and returns 60 products per page. It does not require a browser. You can inspect the real ten-product test sample on the tool page before running your own query.

Whether you are performing competitor price benchmarking, dropshipping product research, or e-commerce catalog audits, this guide shows you how to query AliExpress search results programmatically using Python and cURL.

Data attributes extracted per product

For each matching product listing, the scraper extracts clean commercial and catalog attributes:

  • Identification & links: The full title, the product url, the primary image_url and a product_id.
  • Pricing & discounts: The active selling price, the strikethrough original_price and a ready-made discount_percent, in your selected currency.
  • Social proof & traction: The listing rating and the number of items sold.
  • Listing details: Whether the card is a sponsored placement (is_sponsored) and when it was listed (listed_since), when shown.
  • Localization: Prices for your chosen ship_to country and currency.

Quick start with cURL

You can execute a search run immediately with a single HTTP POST request. Replace YOUR_APIFY_TOKEN with your personal token:

curl --fail-with-body -X POST "https://api.apify.com/v2/acts/hirepulse~aliexpress-search-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "queries": [
    "wireless earbuds"
  ],
  "max_results_per_query": 120,
  "ship_to": "US",
  "currency": "USD"
}'

This request queries the term "wireless earbuds" localized for shipping to the United States (US) with pricing formatted in US Dollars (USD), capping results at 120 products (2 pages of 60 items each).

Building a Python product research pipeline

Using the official apify-client package, you can run search queries, compute product discounts, sort items by their returned sold count, and save the dataset to a structured file.

pip install apify-client
import os
import json
from pathlib import Path
from apify_client import ApifyClient

# Initialize the Apify client
client = ApifyClient(os.environ.get("APIFY_TOKEN", "YOUR_APIFY_TOKEN"))

# Define search parameters
run_input = {
    "queries": ["wireless earbuds"],
    "max_results_per_query": 120,
    "ship_to": "US",
    "currency": "USD"
}

# Run the Actor and wait for dataset completion
run = client.actor("hirepulse/aliexpress-search-scraper").call(run_input=run_input)

if not run or run.get("status") != "SUCCEEDED":
    raise RuntimeError("Actor did not complete successfully; inspect the run.")

# Iterate over returned dataset items
raw_products = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Retrieved {len(raw_products)} products from AliExpress.\n")

# Process and analyze product records
catalog = []
for p in raw_products:
    title = p.get("title", "Untitled Product")
    price = p.get("price")
    orig_price = p.get("original_price")
    rating = p.get("rating")
    sold_count = p.get("sold") or 0
    listed_discount = p.get("discount_percent")
    link = p.get("url", "")

    # Calculate discount percentage if original price is available
    discount_pct = 0
    if price and orig_price and orig_price > price:
        discount_pct = round(((orig_price - price) / orig_price) * 100, 1)

    catalog.append({
        "title": title,
        "price": price,
        "original_price": orig_price,
        "discount_pct": discount_pct,
        "rating": rating,
        "orders_sold": sold_count,
        "listed_discount_pct": listed_discount,
        "product_url": link
    })

# Sort catalog by total sales volume (descending)
sorted_catalog = sorted(catalog, key=lambda x: x["orders_sold"], reverse=True)

# Display top 5 best-selling items
print("--- Top 5 Best-Selling Listings ---")
for item in sorted_catalog[:5]:
    print(f"[{item['orders_sold']:,} sold | {item['rating']}★] {item['title'][:60]}...")
    print(f"  Price: ${item['price']} (Orig: ${item['original_price']}, -{item['discount_pct']}%)\n")

# Save processed results to JSON
Path("aliexpress_results.json").write_text(
    json.dumps(sorted_catalog, indent=2, ensure_ascii=False),
    encoding="utf-8"
)

Practical tips for e-commerce data engineering

1. Consistent localization settings

Keep ship_to and currency fixed when comparing runs, and record both settings beside the output. The tool returns the requested ship-to country; it does not return shipping costs or delivery estimates. Label collections with different settings separately so a reader can tell which request produced each price.

2. Handling missing or zero sales counts

Check the actual returned values before calculating derived metrics. Use Python’s .get() method when reading optional fields, and preserve an absent value rather than inventing an explanation for it. Keep source values separate from your calculated discount or ranking.

3. Rate limiting and pagination

The tool extracts 60 products per page. Setting max_results_per_query: 120 fetches two pages. For large catalog audits across dozens of queries, keep your batches modular (e.g., 5 to 10 queries per run) so your downstream processing can validate datasets incrementally.

Limitations and pricing

  • Catalog scope: This tool is an optimized search results scraper. It captures the public search-card attributes (title, price, original price, discount, rating, sold count, image and URL). It does not return seller/store names, shipping costs or delivery estimates, review text, stock levels or coupon codes.
  • Pricing: Billed at $2.50 per 1,000 products returned (pay per result, no monthly subscription required). On the free Apify tier, you can test runs up to 100 products.

Next steps