Product Hunt API — Parse a Product Hunt URL
Documentation menu
FetchLayer FetchLayer API

Parse a Product Hunt URL

Turn any Product Hunt URL into the structured input it encodes — whether it points at a product, a launch, a user, a topic, a category, a collection, a leaderboard or a search, plus the slug, comment id, query or period carried with it. Parsing a URL does not consume a credit.

POST /resolve-url Utility
https://api.fetchlayer.dev/producthunt/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

Any Product Hunt URL, to be parsed into structured input.

format string optional

json or markdown. (default: json)

Response Fields

resolve-url

Parse a Product Hunt URL

kind string

What the URL points at: product, launch, user, topic, category, collection, leaderboard, search, home, or unknown. Only the fields matching the kind are filled in.

productSlug string | null

Present when the URL names a product.

launchSlug string | null

Present when the URL names a launch.

username string | null

Present when the URL names a profile.

topicSlug string | null

Present when the URL names a topic, with categorySlug and collectionSlug for those kinds.

commentId string | null

Present when the URL deep-links to a comment.

query string | null

Present when kind is search.

leaderboardPeriod string | null

daily, weekly, monthly or yearly, with leaderboardYear, leaderboardMonth, leaderboardDay and leaderboardWeek alongside it.

Request

curl -X POST "https://api.fetchlayer.dev/producthunt/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.producthunt.com/posts/granola-2-0"}'

Response

{
  "kind": "launch",
  "launchSlug": "granola-2-0",
  "productSlug": null,
  "username": null,
  "commentId": null
}