PY 04: Pricing power

Track: Code (Python client + raw REST) Prerequisite: PY_03.

The task

Fetch a brand's sold lots via the API, compute the per-lot ratio of realized price to pre-sale high estimate in Python, and take the median to get a pricing power score.

Starter steps

  1. Fetch sold lots for one designer, including both price fields you need for the ratio:
rows = client.query(
    "all_watches_data",
    fields=["designer", "usd_price_decimal", "sale_estimates_high_usd_price"],
    filters=[
        {"field": "designer", "op": "eq", "value": "Van Cleef & Arpels"},
        {"field": "status", "op": "eq", "value": "sold"},
    ],
    limit=1000,
)
  1. The API returns raw rows only; it does not compute ratios or medians server-side, so do that in Python. Filter out any rows with a missing or zero high estimate, since dividing by zero or None will error:
import statistics

ratios = [
    r["usd_price_decimal"] / r["sale_estimates_high_usd_price"]
    for r in rows
    if r.get("sale_estimates_high_usd_price")
]
pricing_power_median = statistics.median(ratios)
print(round(pricing_power_median, 2))
  1. Wrap the fetch-and-compute logic in a small function so you can reuse it for other designers:
def pricing_power(designer, table="all_watches_data"):
    rows = client.query(
        table,
        fields=["usd_price_decimal", "sale_estimates_high_usd_price"],
        filters=[
            {"field": "designer", "op": "eq", "value": designer},
            {"field": "status", "op": "eq", "value": "sold"},
        ],
        limit=1000,
    )
    ratios = [r["usd_price_decimal"] / r["sale_estimates_high_usd_price"] for r in rows if r.get("sale_estimates_high_usd_price")]
    return statistics.median(ratios) if ratios else None

for name in ["Van Cleef & Arpels", "Rolex", "Patek Philippe"]:
    print(name, pricing_power(name))

Expected result

pricing_power_median is a float typically in the range of roughly 0.5 to 1.5. A strong, in-demand brand such as Van Cleef & Arpels tends to show a value noticeably above 1.0 (illustratively, around 1.36x in past analysis), meaning at least half of its sold lots realized more than the auction house's own pre-sale high estimate. Looping the pricing_power(...) function over a few designer names prints one score per brand, letting you compare them directly.

Stretch challenge

Extend pricing_power(...) to accept an optional vendor argument and add a matching eq filter when it is provided, so you can compare the same brand's pricing power across two or three different auction houses.