Wikipedia has a free API that tells you how many people read any article, every month, back to 2015. No key, no signup, no rate plan. Hardly anyone uses it.
This post shows how the API works and how to get it into Google Sheets two ways: a small Apps Script function you can paste in yourself, or my free template, the Wikipedia Trends Tracker, which already does it and draws the chart.
The short answer
Call https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/user/ARTICLE/monthly/START/END with the article title and two dates. It returns JSON with one item per month. Google Sheets can't read that JSON with a plain formula, so use a short Apps Script custom function, or a template that has one built in.
How the API URL works
Here's a real request for the Pickleball article, monthly, October 2021 through September 2026:
https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/user/Pickleball/monthly/20211001/20260930
Each part of the path means something:
-
en.wikipedia: the project. Use
de.wikipedia,fr.wikipedia, and so on for other languages. -
all-access: desktop and mobile together. You can also ask for
desktop,mobile-web, ormobile-app. -
user: human readers only.
all-agentsincludes known bots and crawlers. Useuser. -
Pickleball: the article title, exactly as it appears after
/wiki/in the address bar, with underscores for spaces. -
monthly: or
daily. - 20211001/20260930: start and end dates as YYYYMMDD.
Open that link in a browser and you'll see a list of months, each with a timestamp and a views number.
Why IMPORTDATA and IMPORTXML don't work here
The API returns JSON. IMPORTDATA expects CSV or TSV, and IMPORTXML expects HTML or XML, so neither can pull the views out cleanly. You need a little script, or a template that already has one.
Option 1: a custom function in Apps Script
Here's the whole function:
function WIKIVIEWS(article, start, end) {
var url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' +
'en.wikipedia/all-access/user/' + encodeURIComponent(article) +
'/monthly/' + start + '/' + end;
var res = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
if (res.getResponseCode() !== 200) return 'No data';
var items = JSON.parse(res.getContentText()).items;
return items.map(function (i) {
return [i.timestamp.slice(0, 4) + '-' + i.timestamp.slice(4, 6), i.views];
});
}
- In your sheet, open Extensions, then Apps Script.
- Paste the function above and save.
- Back in the sheet, type
=WIKIVIEWS("Pickleball", "20211001", "20260930")in an empty cell. - Give it a few seconds. You'll get two columns: month and views.
- Select both columns and insert a line chart.
Two things trip people up. Titles with special characters, like Tesla,_Inc., need encoding, which encodeURIComponent handles. And if an article was renamed, its history is split across the old and new titles, so you'll need to call both and add them together.
Option 2: the no-code template
If you don't want to touch Apps Script, the Wikipedia Trends Tracker is a free Google Sheet with the API already wired up.
- Get the template and make a copy.
- On the Controls tab, paste a Wikipedia link or just the title into Page 1 and another into Page 2. No formatting needed.
- Set Range to All time and Daily or monthly to Monthly, then click Fetch views + chart.
- You get one chart and a winner table. Add up to three more pages for more lines.
A real example: Tesla vs BYD
I ran this pair through the API (English Wikipedia, human readers). The Tesla, Inc. article went from about 3.55 million views in 2022 to about 2.47 million in 2025. The BYD Auto article went from about 388,000 to about 1.40 million over the same years.
Tesla still gets more readers. But BYD's line is the one that more than tripled. That's the kind of thing you only see with real counts over several years. The live chart is on the Tesla vs BYD page.
FAQ
Do I need an API key for the Wikipedia pageviews API?
No. It's public and free. Wikimedia asks that you send a descriptive user agent and keep request rates reasonable. If you hammer it, you'll get a "too many requests" error.
How far back does the data go?
July 2015 for the pageviews API.
Why does the last month look so low?
The current month is still being counted. Leave it out, or treat it as partial.
Can I pull daily views instead?
Yes. Change monthly to daily in the URL. Expect a lot more rows and a much noisier chart.
Rather skip the script? Get the free Wikipedia Trends Tracker. The API is already connected. Paste two links and you're done.
More on tracking trends
- How to see Wikipedia page views over time, including the 30-day view built into every article.
- A free Google Trends alternative with real numbers.