Listings API - RoyalGr4pe/stockx-sdk GitHub Wiki

📦 Listings API

The Listings API provides access to your current and historical product listings on StockX. This includes listing statuses, inventory types, and associated shipment data.


🔐 Authentication

Make sure you have called setup() with your API key and JWT token before using any Listings API function.

from stockx.connection import setup

setup({"api_key": "YOUR_API_KEY", "jwt": "YOUR_JWT_TOKEN"})

📘 Available Functions

get_all_listings(params: dict) -> dict

Fetch a paginated list of your product listings.

Parameters

Name Type Description
pageNumber int Page number (starts at 1).
pageSize int Number of results per page (1–100).
productIds str Comma-separated product IDs.
variantIds str Comma-separated variant IDs.
batchIds str Comma-separated batch IDs.
fromDate str Filter listings created on or after this date. Format: YYYY-MM-DD.
toDate str Filter listings created on or before this date. Format: YYYY-MM-DD.
listingStatuses str Comma-separated statuses: "INACTIVE", "ACTIVE", "DELETED", "CANCELED", "MATCHED", "COMPLETED".
inventoryTypes str Comma-separated types: "STANDARD", "FLEX".
initiatedShipmentDisplayIds str Comma-separated shipment display IDs.

Example

from stockx.listings import get_all_listings
import asyncio

async def main():
    listings = await get_all_listings({
        "pageNumber": 1,
        "pageSize": 50,
        "listingStatuses": "ACTIVE",
    })
    print(listings)

asyncio.run(main())

get_single_listing(listing_id: str) -> dict

Fetch a single listing by its ID.

Parameters

Name Type Description
listing_id str The StockX listing ID.

Example

from stockx.listings import get_single_listing
import asyncio

async def main():
    listing = await get_single_listing("abc123")
    print(listing)

asyncio.run(main())

📎 Notes

  • All date fields must use the format: YYYY-MM-DD.
  • All list-type parameters (like productIds, listingStatuses, etc.) must be passed as comma-separated strings without brackets or quotes.
  • If an invalid or expired JWT token is used, you will receive a 401 error.

🛠️ Need Help?

Feel free to open an issue or refer to the Setup & Authentication page for configuration steps.