Import Wikipedia Data To Google Sheets

How to import Wikipedia data to Google Sheets
Reading Time: 5 minutes

Wikipedia needs no introduction. What you perhaps don’t know is that you can import Wikipedia data to Google Sheets using its API. This includes meta-information that you wouldn’t find on Wikipedia such as page metrics, page information, page citations, aggregated featured articles, events, births and deaths on a particular day, and many others.

For example, in the snippet below, we have a list of the most visited pages in January 2023 with the number of views.

Most visited pages in Wikipedia

Here’s a quick guide on how to import Wikipedia data to Google Sheets:
Step 1: Install the Amigo Data add-on
Step 2: Choose a Wikipedia endpoint
Step 3: Import the data to Google Sheets

How to import Wikipedia data to Google Sheets

Let’s learn how to import Wikipedia data to Google Sheets step by step.

Step 1: Install the Amigo Data add-on

Install the Amigo Data add-on in Google Sheets to scrape Wikipedia data and import the data from Wikipedia to Google Sheets. Ins it from the Google Workspace Marketplace by clicking the link below.

Install Amigo

Install Amigo Data to import Wikipedia data to Google Sheets

Alternatively, you can get it from Google Sheets itself.

  • Open Google Sheets
  • Go to Extensions→Add-ons→Get add-ons
  • Search for Amigo Data and install it.

Step 2: Choose a Wikipedia endpoint

Go to the Wikipedia API documentation page and choose an endpoint for the data to import from Wikipedia.

The endpoints can be found under their respective headings. For example, page information under Page content; events and featured contents under Feed; article citations list under Citation; and so on.

Let us import the Wikipedia list of (famous) people born on a particular day, for the purpose of this tutorial.

Follow the steps below to get the endpoint.

  • On the API documentation page, expand the Feed heading and click the Events on this day option.
List of endpoints to import Wikipedia data to Google Sheets
  • Then click the Try it out button.
Testing the endpoint in the API documentation page
  • Change the Type of events parameter from all to births, fill in the month and the date, in MM and DD format, and click Execute.
  • For example, to get the list of famous figures born on the leap day, we use enter 02 in the mm string and 29 in the dd string.
The parameters for the datapoint
  • Copy the Request URL under Responses. This is the endpoint URL we’ll use the pull the Wikipedia data to Google Sheets.
Wikipedia API endpoint URL
  • The endpoint to import Wikipedia data to Google Sheets is:
https://en.wikipedia.org/api/rest_v1/feed/onthisday/births/02/29

Import the Wikipedia data to Google Sheets

Now, go back to Google Sheets and launch Amigo Data to retrieve the Wikipedia data and import the data to Google Sheets.

  • Click Extensions→Amigo Data–Connect.
Launch Amigo to import Wikipedia data to Google Sheets
  • Select Custom API from the list of sources.
List of sources to connect
  • Enter the Wikipedia API endpoint in the API URL field.
API URL bar to paste the endpoint
  • Click the PREVIEW button to retrieve the Wikipedia data to import to Google Sheets and preview the data.
  • Then flatten all the nested datasets, delete all those that are not required, and then click the IMPORT button.
Preview of the Wikipedia data to import to Google Sheets
  • The Wikipedia data will be imported into Google Sheets in a few seconds.
Snippet of the data imported from Wikipedia to Google Sheets

And that’s how we import Wikipedia data to Google Sheets in a few steps using Amigo Data.

To import other types of event data, we just need to change the event type and the month and the date.

Endpoint for events on January 1

We can also modify the endpoint URL ourselves to fetch specific types of information. For example, the endpoint for events on January 1 is as given below.

https://en.wikipedia.org/api/rest_v1/feed/onthisday/events/01/01

Deaths on Christmas endpoint

And for famous people who died on Christmas day, the endpoint is:

https://en.wikipedia.org/api/rest_v1/feed/onthisday/deaths/12/25

List of people who share birthday with you

You can likewise import the list of all renowned people who share the same birthday as you by using the births event.

This is the endpoint:

https://en.wikipedia.org/api/rest_v1/feed/onthisday/births/your_birth_month/your_birth_date

Wikipedia page metrics

If you want to retrieve, not Wikipedia contents but information related to the contents on Wikipedia, such as most visited pages, number of visitors for a specific page, page edits data, and so on, you can use the Wikimedia API.

For this, we use the Wikimedia API instead of the Wikipedia API. Click here to visit the Wikimedia API documentation.

For example, the page view counts for a particular article can be fetched with the “Get page view counts for a page” endpoint under Pageviews data.

Endpoint pageview count of Albert Einstein’s English Wikipedia page in September 2022:

https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/Albert_Einstein/daily/2022090100/2022093000

Endpoint for most visited pages on October 2, 2022:

https://wikimedia.org/api/rest_v1/metrics/pageviews/top/en.wikipedia/all-access/2022/10/02

For more examples of page views, you can visit this page.

Auto-update the data

To get the information updated regularly, 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.

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

See also

There are plenty of things that you can use Amigo Data for, such as importing data from Yahoo Finance, US Patent and Trademark Office, and Spotify, or exporting Google Ads data, YouTube Analytics data, and Facebook Ads data.

You can find all these and many more on our blog.

Some related articles you may be interested in:

Import Reddit data into Google Sheets

Import IMDb data to Google Sheets

Import data from the FDA to Google Sheets

Leave a Reply