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!
Release files for stockx 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stockx-1.1.1.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stockx-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.9 kB
Release files / stockx-1.1.1.tar.gz
| Download URL | stockx-1.1.1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bbb3a431384ba766a423b70183913f287629f2e2fc2a4192ac6dd8e9137480f
|
|
BLAKE2b-256 checksum How to use checksums |
9866c65fd809afc424ce7304cb1425f3acb55b057da64c2a6bc23f14e7de6415
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / stockx-1.1.1-py3-none-any.whl
| Download URL | stockx-1.1.1-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb05c9ac3076c8292682ccad038aa3b4c408116d2919dbc4ca0759bbe7a3ca86
|
|
BLAKE2b-256 checksum How to use checksums |
c25ad59053f3d51c7a18958f636589a62813f8b182f4615493109c072c068134
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|