Import Reddit Data To Google Sheets

How to Iimport Reddit data to Google Sheets
Reading Time: 6 minutes

Steps to import Reddit data to Google Sheets:
Step 1: Install the Amigo Data add-on
Step 2: Register on RapidAPI and generate a key
Step 3: Choose an endpoint
Step 4: Import the data

Ever wanted to keep track of what goes on in Reddit, the so-called Front Page of the Internet–what is trending on the site or in a particular subreddit? Or check the activity of specific users?

If yes, then you’re in luck. We can import various kinds of data from Reddit to Google Sheets. And we don’t even need to have a Reddit account. We’ll create Reddit-Google Sheets integration and import Reddit data to Google Sheets.

Here’s a snippet of the top monthly posts on Reddit imported into Google Sheets.

Reddit data imported into Google Sheets

How to import Reddit data to Google Sheets

Here’s the step-by-step guide on how to import Reddit data to Google Sheets.

Step 1: Install the Amigo Data add-on in Google Sheets

We need a tool with which to import Reddit data to Google Sheets. For this, we’ll use Amigo, a data integration and automation tool that gives you the ability to automatically extract data from several different sources.

You can get it from the Google Workspace Marketplace by clicking the link below.

Install Amigo Data extension

Install Amigo Data to import Reddit data to Google Sheets

Once the installation is complete, we can move on to the next step: getting the API key.

Step 2: Generate a key

Reddit has its own API that allows developers to use it to, well, develop apps. But Reddit’s API documentation is not very concise and the process of generating a token key is quite convoluted–and so not much worth the hassle if all you want is to extract data from Reddit.

So, for the sake of convenience and to save time, we’ll use an unofficial Reddit API on RapidAPI to retrieve Reddit data.

Follow the steps below to get an API key from RapidAPI.

  1. Sign up to RapidAPI
  2. Once you’re logged in, go to the Reddit API documentation page in RapidAPI and choose a subscription plan from the Pricing menu. Choose the Basic option. (You can search for Reddit and click the relevant result.)
Subscribe to the Reddit API to use it
  1. The API key will be generated once you’ve chosen a pricing option. Navigate back to Endpoints to see the API key. Note that and keep it confidential.
The RapidAPI key

After subscribing to the Reddit API, we’ll be able to scrape Reddit data and import the data to Google Sheets.

Step 3:  Choose a Reddit API endpoint

Click on Endpoints to go back to the Reddit API documentation. On the left is a list of endpoints that we can use to import Reddit data to Google Sheets.

Reddit API endpoints

Click on any of the endpoints to scrape Reddit data. We’ll choose the Top Popular Posts endpoint to scrape Reddit’s top posts for a specific period.

In the Required Parameters field, specify the time period for which you want to get Reddit’s top posts–all time, year, month, etc.

Filling the parameters

Leave the other parameters as they are. And click Test Endpoint to run the API query.

On the right side of the screen you’ll see a success message, if all works well.

The Reddit API endpoint URL and headers are found under Code Snippets on the right side of the screen.

Change the programming language from (Node.js) Axios to Shell→cURL.

Fetching the Reddit API  endpoint URL

Copy the URL excluding the apostrophes. And note also the headers. These will be used to import Reddit data to Google Sheets.

Reddit API URL and headers

Step 4: Import Reddit data to Google Sheets

Go back to Google Sheets and launch the Amigo Data extension to pull the data from Reddit to Google Sheets.

Launching Amigo Data to import Reddit data to Google Sheets

Select Custom API from the list of sources.

LIst of sources in Amigo Data

Enter the Reddit API endpoint URL in the API URL field.

Enter the Reddit API endpoint URL

Then expand the Details tab and enter the headers given in the Code Snippets.

Name: RapidAPI-Host, Value: reddit34.p.rapidapi.com
Name: X-RapidAPI-Key, Value: Your_API_key

Replace Your_API_key with your RapidAPI key.
Reddit API headers

Click the PREVIEW button to retrieve and preview the Reddit data to import to Google Sheets. Flatten the data points and then click IMPORT.

Preview of the Reddit data to import to Google Sheets

The data will be imported from Reddit to Google Sheets very shortly. Below is a snippet of the imported data showing the post title, the poster, the number of upvotes, comments and the upvote ratio.

The data imported from Reddit to Google Sheets

To import other types of data from Reddit to Google Sheets, such as the top posts from a subreddit, import the posts of a specific user by the latest post and so on you can follow the same procedure and change the parameter according to the type of data you want to import.

We can also enter the parameters manually in Amigo Data and get the specific data we want.

For example, to import the new comments posted by the user Poem_for_your_sprog along with all the data related to them such as gildings, upvotes, the subreddits on which they’re posted and the time, we’ll enter the following details:

https://reddit34.p.rapidapi.com/getCommentsByUsername

Then expand the Details tab and add these as queries:

Name: username, Value: Poem_for_your_sprog
Name: sort, Value: new

Add the same headers. And follow the same steps as the above to retrieve and import the data from Reddit to Google Sheets.

For other endpoints such as top posts by subreddit, posts for a specific user, and so on, check the Reddit API documentation.

Automatically pull Reddit data to Google Sheets

You can automatically pull Reddit data to Google Sheets with Amigo periodically. All you have to do is set a refresh schedule. And Amigo will auto-update the data regularly.

To set a refresh schedule, specify the refresh time and a frequency and click “Yes, set the refresh timing”. You can also set a refresh schedule later by clicking “View Reports” from the Amigo sidebar, and then click the report, toggle on the Refresh Schedule and select the schedule–hourly, daily, weekly or custom days. Then click Save & Run.

Alerts via email or Slack

You can get the report sent to your email or a Slack channel so that you do not even have to open the spreadsheet to keep track of what’s happening on the Front Page of the Internet.

To set up an alert, click Get Alerts→Add alert data+. Edit the details and click Set Alert.

Conclusion

We can easily import Reddit data to Google Sheets using Amigo Data. Tracking the behaviour and activities of Redditors–and more generally what’s happening around the world–is a fun and easy task. Hope this Google Sheets Reddit integration guide helped you.

See also

Using Amigo Data, you can do several other things such as import Yahoo Finance data to Google Sheets, track cryptocurrencies prices from Google Sheets, and export Facebook Ads and Google Ads data to Google Sheets among other sources. For these and many others, visit our blog.

Some similar articles you may find interesting

Import Spotify data to Google Sheets

Import Wikipedia data to Google Sheets

Import Yahoo Finance data to Google Sheets

Leave a Reply