How to extract data from Product Hunt into Google Sheets using the Product Hunt 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.

In this tutorial, I’ll show you how to connect the Product Hunt API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Create a Product Hunt App & Generate Access Token
  3. Choose your Product Hunt Endpoint URL
  4. Enter Product Hunt API Request into Apipheny
  5. Run the Product Hunt API Request

Step 1.) Install and open the Apipheny Add-on in 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. Click here if you want to learn more about Apipheny.

1. Install Apipheny by clicking the Install button on this page.

Install the Apipheny add-on
Install the Apipheny add-on

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons 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.

Open the Apipheny add-on
Open the Apipheny add-on

Step 2.) Create a Product Hunt “App” and Generate an Access Token

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:

Product Hunt API Dashboard
Product Hunt API Dashboard

Once on the dashboard, in the My Applications section, click the ADD AN APPLICATION button:

Product Hunt API: Add an Application
Product Hunt API: Add an Application

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:

Create a Product Hunt API app
Create a Product Hunt API app

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:

Create a Product Hunt API Token
Create a Product Hunt API Token

The token will then be displayed on your screen:

Product Hunt API Token
Product Hunt API Token

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.

Step 3.) Choose your Product Hunt API Endpoint URL

In this section, we’ll show you how to browse the Product Hunt API documentation to find the API URL that retrieves the information you need from Product Hunt.

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:

Product Hunt API Endpoints
Product Hunt API 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:
https://api.producthunt.com/v1/

An example endpoint is Show notifications, as you can see we’ve appended it to the base URL here:

https://api.producthunt.com/v1/notifications

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:

Product Hunt Notifications API Endpoint Documentation
Product Hunt Notifications API Endpoint Documentation

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.

Step 4.) Enter your Product Hunt API URL Into Apipheny

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):

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

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:

https://api.producthunt.com/v1/users

In the Headers section, add three rows with the following keys and values:

Header 1
Key:
Accept
Value:
application/json
Header 2
Key:
Content-Type
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”. Do not include the carrots “<>” around your access token.

Product Hunt API Request entered into Apipheny
Product Hunt API Request entered into Apipheny

Step 5.) Run the Product Hunt API Request

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:

Product Hunt data imported into Google Sheets using the Product Hunt API and the Apipheny add-on
Product Hunt data imported into Google Sheets using the Product Hunt API and the Apipheny add-on

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, such as:

  • Save and schedule your API request
  • Make a POST request (if available)
  • Use the custom =APIPHENY() function to call the API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in the API URL with three curly braces eg. {{{Sheet1!A1}}}

If you want to import Product Hunt data into Google Data Studio, this is one way to do it. Just follow the steps above and then connect your Google Sheet to your Google Data Studio report.

Apipheny Google Sheets API Tool Demo

Related articles:

Related Posts

Leave a Comment