⚠️ Note: Product Hunt has deprecated their V1 API and has launched a new V2 GraphQL API. The tutorial below shows the steps to use the (no longer active) V1 deprecated API and has not been updated to reflect the new V2 API. Those who are familiar with how to use GraphQL can try testing the new Product Hunt GraphQL API with Apipheny, until we update this tutorial.
⭐️ Related tutorial: Empire Flipper API
Product Hunt, as you probably know, is a curated list of just-launched startups and products. If you want to use Product Hunt for business intelligence, keep reading to learn how to import data from Product Hunt into Google Sheets.
To pull data from the Product Hunt API to Google Sheets easily and without writing any code, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs (including the Product Hunt API), save API requests, schedule API requests, and more.
1. Install Apipheny by clicking the Install button in the Google Marketplace: https://apipheny.io/install
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons dropdown menu, you should see Apipheny.
Then just click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
To start the process of creating a Product Hunt “app”, first log in to your Product Hunt profile, then once logged in click on your profile icon, and in the drop-down menu, select the API DASHBOARD option:
Once on the dashboard, in the My Applications section, click the ADD AN APPLICATION button:
In the Create an application section, complete the name of your app and the redirect URI in the corresponding fields. Since in this tutorial, we don’t use a public website for the application, we’ve used http://localhost as the redirect URL. Once you fill out the fields, click the Create Application button:
Your app has been created and listed in the My Applications section. That is also where you’ll find the app’s API Key and API Secret.
Next, on the same page, in the Developer Token subsection, you can create an access token by clicking the CREATE TOKEN button:
The token will then be displayed on your screen:
Copy and paste all of the values (the API Key, API Secret, and the generated token) somewhere safe and easy to access because you will need them in the next steps.
If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.
To browse the Product Hunt API documentation, first open the Product Hunt API documentation page: https://api.producthunt.com/v1/docs
The menu on the right contains a list of APIs, each with its own endpoints:
Clicking on an API scrolls to that API’s section, containing a list of associated endpoints. For instance, if you click on the Notifications API the page scrolls to the list of its 2 endpoints: Show notifications and Clear your notifications count.
All API calls to Product Hunt should be made to the https://api.producthunt.com/v1/ base domain. All endpoints should be appended to this domain.
Product Hunt API Base URL/Root Domain:
An example endpoint is Show notifications, as you can see we’ve appended it to the base URL here:
The above URL is what we will enter into the Apipheny add-on.
The documentation for this endpoint contains a short description of the endpoint’s purpose, a description of the available parameters, the HTTP method used (GET) and the link you should append to the root API URL for querying this endpoint (/notifications), the request headers and example response details:
As you can see from this example, for endpoints that accept parameters, this documentation is where you would find them listed and explained, along with example inputs and responses.
Now go back to your Google Sheet and make sure that the Apipheny add-on is open and the “Import” tab is open.
With the Import Tab open, enter these details into the Apipheny add-on (screenshot example below):
API URL: In Step 3, we explained how you can find the Product Hunt REST API endpoint that you need depending on the data that you want to import into your Google Sheet. Now copy the complete URL (base URL + endpoint + any parameters) into the Apipheny add-on, where it says API URL Path (JSON / CSV).
For this example, we are using the Users endpoint, to get all users. The corresponding URL for this endpoint is:
In the Headers section, add three rows with the following keys and values:
Header 1 Key: Accept Value: application/json
Header 3 Key: Authorization Value: Bearer your_access_token
Enter these three headers as separate rows in the Headers section of the Apipheny add-on. For the third header, your_access_token is the value you generated previously, in Step 2. There should be a literal space between “Bearer” and “your_access_token”.
Here’s the last step. After entering the Product Hunt API details into Apipheny, click the Run button at the bottom of the add-on and then wait for the Product Hunt API to import into your Google Sheet:
After making a successful request to the Product Hunt API, try querying a different Product Hunt API endpoint, or try using one of the more advanced features in the Apipheny add-on.