A professional modular Python scraper for Digikala API that extracts all product details — including variants, prices, images, attributes, and categories — into WooCommerce-ready JSON.
🇮🇷 پشتیبانی کامل از ساختار محصولات دیجیکالا (ساده و متغیر)، با تنظیمات قابل سفارشیسازی و ساختار ماژولار.
✅ Supports both Simple and Variable products
✅ Extracts prices, variants, categories, attributes, tags, and images
✅ Configurable via config.py — enable/disable gallery, debug logs, or image download
✅ Saves output as clean, WooCommerce-compatible JSON
✅ Built with modular structure (utils/ folder) for reusability and extension
✅ Supports Persian content natively (UTF-8 output)
git clone https://github.com/moomoein/digikala-product-scraper.git
cd digikala-product-scraper
pip install requestsEdit the config.py file:
SEARCH_KEYWORD = "گوشی موبایل"
PAGES_TO_SCRAPE = 2
ENABLE_GALLERY = True
ENABLE_IMAGE_DOWNLOAD = False
ENABLE_DEBUG_LOGS = Falsepython scraper_final.pyResults will be saved in:
output/<OUTPUT_NAME>/
├── <OUTPUT_NAME>_products.json
└── images/
{
"sku": "DKP-12345",
"type": "variable",
"name": "گوشی موبایل سامسونگ مدل Galaxy A54",
"regular_price": 21500000.0,
"sale_price": 19800000.0,
"attributes": [...],
"variations": [...],
"categories": [{"name": "موبایل"}]
}digikala-product-scraper/
├── config.py # Configuration & options
├── scraper_final.py # Main entry point
└── utils/
├── fetcher.py # API requests
├── parser.py # JSON parsing & data extraction
└── downloader.py # Image & file handling
- 🔄 Importing Digikala products into WooCommerce / WordPress
- 📊 Competitive product analysis or dataset creation
- 🧠 AI/ML product recommendation training datasets
- 💾 Backup of Digikala product catalogs
MIT License — feel free to use, modify, or contribute.
Pull requests are welcome!
If you find this project useful, don't forget to ⭐ Star the repo and share it with other developers!
Created by @moomoein — feel free to reach out for collaboration.