Search API - RoyalGr4pe/stockx-sdk GitHub Wiki

๐Ÿ“ฆ search(params: dict)

Performs a product search using the StockX Catalog API. This allows you to find products by keyword, with optional pagination.

๐Ÿ”ง Function Signature

search(params: dict) -> dict

๐Ÿงพ Parameters

Name Type Description Default
query str Search term (e.g., product name, style code, SKU). โ€”
pageNumber int Page number of the results to fetch. 1
pageSize int Number of results to return per page. 1

โ„น๏ธ All parameters are optional, but query is generally required for useful results.

โœ… Returns

A dictionary containing:

  • count (int): Number of products returned on this page.
  • hasNextPage (bool): Whether more pages of results are available.
  • pageNumber (int): Current page number.
  • pageSize (int): Number of results per page.
  • products (list): List of product objects.

Each product includes fields like:

{
  "brand": "Nike",
  "productId": "c07b2c5e-7a20-42c8-99ed-bfff0202e97c",
  "styleId": "CU9225-001",
  "title": "Nike Air Force 1 Low Supreme Black",
  "urlKey": "nike-air-force-1-low-supreme-box-logo-black",
  "productType": "sneakers",
  "productAttributes": {
    "color": null,
    "colorway": "Black/Black-Black",
    "gender": "men",
    "releaseDate": "2020-03-05",
    "retailPrice": null,
    "season": null
  }
}

๐Ÿ’ก Example

results = await search({
    "query": "Nike Tech Fleece",
    "pageNumber": 1,
    "pageSize": 4
})

for product in results["products"]:
    print(product["title"], "-", product["styleId"])

๐Ÿšซ Errors

Raises an exception if:

  • The API request fails (e.g., invalid token, network error)
  • Required authentication headers are missing (ensure setup() was called)