This is an unofficial Python SDK for Popular Ecommerce (Tokopedia, Lazada). The project is still under development.
- Search products from Tokopedia and Lazada
- Get product details from Tokopedia and Lazada
- Get product reviews from Tokopedia and Lazada
- Get product categories from Tokopedia and Lazada
- Get product brands from Tokopedia and Lazada
This project uses the following libraries:
- requests for making HTTP requests
- marshmallow for serializing and deserializing JSON data
- urllib3 for making secure HTTP requests
- tqdm for displaying progress bars
You can install the package directly from PyPI using pip:
pip install ecommerce_api_wrapperHere is a simple example of how to use the package:
from ecommerce_api_wrapper import EcommerceApiWrapper
if __name__ == "__main__":
crawler = EcommerceApiWrapper(
ecom_type="tokopedia",
)
response = crawler.search_products(["samsung"])
print(response)
# RESULT:
#Project Structure
ecommerce_api_wrapper/
├── src/
│ ├── ecommerce_api_wrapper/
│ │ ├── __init__.py
│ │ ├── __version__.py
│ │ ├── ecommerce_api_wrapper.py
│ │ ├── providers/
│ │ │ ├── __init__.py
│ │ │ ├── lazada_api_wrapper/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── constants.py
│ │ │ │ ├── lazada.py
│ │ │ │ └── schemas/
│ │ │ └── tokopedia_api_wrapper/
│ │ │ ├── __init__.py
│ │ │ ├── constants.py
│ │ │ ├── tokopedia.py
│ │ │ ├── schemas/
│ │ │ └── utils/
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── faker.py
│ │ └── transform.py
├── tests/
│ └── unit_test.py
├── pyproject.toml
├── README.md
└── LICENSE
- The
src/ecommerce_api_wrapperdirectory contains the package code. - Each major provider (Lazada, Tokopedia) resides in its own subpackage under
src/ecommerce_api_wrapper/providers. - Utility modules are grouped under
utils. - Schemas for each provider are organized in their respective
schemasfolders. src/ecommerce_api_wrapper/__init__.pyallows importing the package.testscontains test cases.
- This project is licensed under the MIT License. See the LICENSE file for details.