Menu

1 / 3

Scraping H&M Data with Python: Do Women Pay More? The Data Says Men Do

DEV Community: datascience·Happy Endpoint·7 days ago
#ra7Q9D5L
#devtodatascience#science#devto#dev#women
Reading 0:00
15s threshold

On H&M's US site, the median men's T-shirt style lists at $24.99. The median women's T-shirt style lists at $19.99. For hoodies the gap is $44.99 against $29.99.

That is the opposite of what I expected. The "pink tax" (women paying more for comparable products) is well documented: a 2015 New York City study of 794 products found women's versions cost about 7% more on average, and 8% more for adult clothing. So I scraped H&M's catalogue with Python to see whether a fast-fashion retailer follows the pattern. For jeans, T-shirts and hoodies, it does not. Men pay more for all three, and the reason turns out to be the shape of the range more than the price tags.

The data

I used the H&M API , which returns H&M's search results as JSON. All of it came from a single endpoint, /product-search , which I called with a search word ( jeans , t-shirt , hoodie ), languageCode=en_us for the US site, pageSize=60 , and a filters string that pins two of H&M's own facets: customerGroups (Woman or Man) and productTypes .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.