In this tutorial, you will learn how to connect the Wikipedia REST API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Obtain an API Token (if needed)
  3. Obtain an Endpoint URL
  4. Enter Wikipedia API into Apipheny
  5. Run the Wikipedia API request

Step 1.) Install and open the Apipheny add-on for Google Sheets

Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace:

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser:

Step 2.) Obtain an API Token (if needed)

The API:Tokens module provides tokens required by data-modifying actions, such as logging, editing or moving a page, as well as watching or patrolling changes. For each action, you will need a specific type of token.

For example, if you want to login to a wiki site via the Action API, you would need a token of type “login” to proceed.

To obtain a login token, write the following command in your command prompt window for Windows OS or a terminal for Mac OS and then press the Enter key:

curl -G ""

Note: For Mac OS you may need to use single quotes ( ‘ ) instead of double quotes ( ” ).

Requesting login token
Requesting login token

The type parameter value depends on the type of token you want to obtain. It could be createaccount, csrf, deleteglobalaccount, login, patrol, rollback, setglobalaccountstatus, userrights or watch. The default value is csrf.

If you want to retrieve two tokens simultaneously, then the type parameter will have the two values separated by the pipe symbol (“|”):|patrol
Note: If the token/key that you generate has an expiration time, you will need to complete this same process again to get a new token when the old one expires. 

Step 3.) Choose an Endpoint URL

In this section, I’ll show you how to browse the Wikipedia API documentation to find an API URL that retrieves the information you need. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the Wikipedia API documentation page:

The menu on the right contains the list of links for the available API endpoints, grouped by their roles:

Wikipedia API endpoints
Wikipedia API endpoints

If you click on an API endpoint, then that endpoint’s page will open, containing its description and documentation.

All API calls to Wikipedia should be made to the base domain.

Wikipedia API base domain/root URL:

An example endpoint is Search for a language:

Don’t forget to replace language_code with a real language code.

The documentation for each endpoint contains the HTTP method used (eg. GET), a description of the endpoint’s purpose, a list of its actions, parameters, possible errors and relevant usage examples:

Wikipedia endpoint description page
Wikipedia endpoint description page

Step 4.) Enter the Wikipedia API URL Into Apipheny

Go back to your Google Sheet and make sure that the Apipheny add-on is open with the “Import” tab open.

Then enter these details into the add-on:

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 Wikipedia API endpoint that you need. Now copy the complete API URL and endpoint into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.

For this example, we are using the Search for a title or a text endpoint, to obtain a title or a text in a wiki:

Don’t forget to replace search_term wit a real value.

If you want to use this same example URL, just copy and paste it into Apipheny.

Headers aren’t required for this API request.

Wikipedia API request in Apipheny
Wikipedia API request in Apipheny

Step 5.) Run the Wikipedia API Request

Your last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Wikipedia API data to be pulled in to your Google spreadsheet:

Wikipedia API data in Google Sheets
Wikipedia API data in Google Sheets

After making a successful request to the Wikipedia API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on.

Popular API Tutorials

API Knowledge

What is an API?

What is an API URL?

What are parameters?

What is an endpoint?

What is an API key/token?

What is basic authentication?

What are headers?

What is a GET request?

What is a POST request?

Import JSON to Google Sheets

SEO by SearchCyrus