Back to articles
Scraping Product Hunt: Finding New Tools Before They Go Viral
How-ToTools

Scraping Product Hunt: Finding New Tools Before They Go Viral

via Dev.to Tutorialagenthustler

Product Hunt is the ultimate launchpad for tech products. Scraping it lets you identify trending tools early, analyze launch patterns, and build competitive intelligence. Using Product Hunt's GraphQL API import requests from datetime import datetime class PHScraper : def __init__ ( self , token ): self . url = ' https://api.producthunt.com/v2/api/graphql ' self . headers = { ' Authorization ' : f ' Bearer { token } ' , ' Content-Type ' : ' application/json ' } def get_posts ( self , date = None ): if not date : date = datetime . now (). strftime ( ' %Y-%m-%d ' ) query = ''' query { posts(postedAfter: " START " , postedBefore: " END " , first: 50) { edges { node { id name tagline votesCount commentsCount website url topics { edges { node { name } } } makers { name username } } } } } ''' . replace ( ' START ' , f ' { date } T00:00:00Z ' ). replace ( ' END ' , f ' { date } T23:59:59Z ' ) resp = requests . post ( self . url , headers = self . headers , json = { ' query ' : query }) data =

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles