A Python SDK for seamless interaction with the StockX marketplace API
Project description
StockX SDK
A Python SDK for seamless interaction with the StockX Marketplace API. This SDK provides a simplified and secure interface to programmatically interact with StockX's selling features, including listings and order management.
📦 Installation
pip install stockx
🛠 Setup
Before calling any functions, you must configure the SDK with your API key and JWT token:
from stockx.connection import setup
setup(api_key="YOUR_API_KEY", jwt="YOUR_JWT_TOKEN")
🔍 Functions
get_all_listings(params: dict)
Fetch all listings based on various filters.
Parameters:
pageNumber(int): The requested page number. Starts at 1.pageSize(int): Number of listings per page.productIds(str): Comma-separated product IDs.variantIds(str): Comma-separated variant IDs.batchIds(str): Comma-separated batch IDs.fromDate(str): Start date inYYYY-MM-DDformat.toDate(str): End date inYYYY-MM-DDformat.listingStatuses(str): Listing statuses (e.g.,ACTIVE).inventoryTypes(str):STANDARDorFLEX.initiatedShipmentDisplayIds(str): Unique shipment display IDs.
Returns:
dict – JSON response containing listing data.
get_single_listing(listingId: str)
Fetch a single listing by its ID.
Parameters:
listingId(str): The unique ID of the listing.
Returns:
dict – JSON response of the listing.
get_active_orders(params: dict)
Fetch active orders using optional filters.
Parameters:
pageNumber(int): Page number to retrieve.pageSize(int): Number of results per page.orderStatus(str): Status filter (CREATED,SHIPPED, etc.).productId(str): StockX product ID.variantId(str): StockX variant ID.sortOrder(str): Sort field (CREATEDAT,SHIPBYDATE).inventoryTypes(str): Comma-separated list, e.g.,STANDARD.initiatedShipmentDisplayIds(str): Shipment display ID.
Returns:
dict – JSON response with active orders.
get_order_history(params: dict)
Fetch historical orders using filters and date range.
Parameters:
fromDate(str): Start date (YYYY-MM-DD).toDate(str): End date (YYYY-MM-DD).pageNumber(int): Page number (default: 1).pageSize(int): Page size (default: 10).orderStatus(str): Historical status (CANCELED,COMPLETED, etc.).productId(str): Product ID.variantId(str): Variant ID.inventoryTypes(str):STANDARD,FLEX.initiatedShipmentDisplayIds(str): Shipment display ID.
Returns:
dict – JSON response with order history.
get_single_order(orderNumber: str)
Fetch a specific order by order number.
Parameters:
orderNumber(str): The unique order number to fetch.
Returns:
dict – JSON response with order details.
search(params: dict)
Search the StockX product catalog using a keyword and optional pagination.
Parameters:
query(str): Search term (e.g., product name, style code).pageNumber(int): Page number of results to retrieve (default: 1).pageSize(int): Number of results per page (default: 1).
Returns:
dict – JSON response containing matched products and pagination metadata.
📄 License
This project is licensed under the MIT License.
📬 Contact
Created by Nick. Contributions welcome!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stockx-1.1.0.tar.gz.
File metadata
- Download URL: stockx-1.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1622792ad1e09fa8f41efb2ede7e4485f50822cb337c5d0713337f6c947ea772
|
|
| MD5 |
edefbce24c2ec5fb3fccb689cf14a20e
|
|
| BLAKE2b-256 |
ec6314256f4206f52a3a89e66d47174a132a3bde24fa6590597811dd2ae026ea
|
File details
Details for the file stockx-1.1.0-py3-none-any.whl.
File metadata
- Download URL: stockx-1.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a53023d1c204ed36550834a57152247fe6b34d2251578c6b919d63ee515ef765
|
|
| MD5 |
e1f13232240e74e317c649d1451fe5e2
|
|
| BLAKE2b-256 |
54ed287fae4630bb8f05b6949b41fc3e32cfef768c7368cfa552e6752bce43da
|