Part I — Markets and attention over time · Chapter 3
Is search still Wikipedia's front door?
In seven Wikipedias, arrivals from search engines fell more than arrivals overall between the years to October 2024 and October 2026; in English, by about a fifth. The decline survives checks against Wikimedia's own pageview counts. What caused it, AI summaries included, the clickstream cannot say.
For most of its life, the usual way into a Wikipedia article was a search engine: you typed a question, the article was one of the first results, and you clicked. Search engines now answer many questions on the results page, with snippets, panels and, since 2024, generated summaries, and Wikimedia said in October 2025 that it sees fewer human pageviews. Wikimedia's clickstream files record where each visit to an article came from, so they can show whether the search door is the one closing.
It is closing faster than the others, but it is still the main way in. Readers of the English Wikipedia arrived from a search engine 31.3 billion times in the twelve months to October 2026, against 39.6 billion in the twelve months to October 2024: a drop of 21%. All arrivals fell 15%, so search's share of them went from 47% to 43%.
Search arrivals to the English Wikipedia have fallen since early 2024, and arrivals through links fell less
Querychapters/10-wikipedia-search/pipeline/20_model.sqlShow SQL
CREATE OR REPLACE TABLE monthly AS
SELECT wiki, month,
sum(clicks) FILTER (WHERE source = 'search')::BIGINT AS search,
sum(clicks) FILTER (WHERE source = 'no referer')::BIGINT AS no_referer,
sum(clicks) FILTER (WHERE source = 'article link')::BIGINT AS article_link,
sum(clicks)::BIGINT AS total
FROM sources GROUP BY wiki, month;742 wiki-monthsRuns at build time in DuckDB 2.0; shown for reading.Open file
What a clickstream row records
Each month, Wikimedia publishes one file per language edition with four columns: the referer, the article, the type of link and a count. The referer is either another article or one of five classes: a search engine (other-search), no referer at all (other-empty), another Wikimedia site, any other website, and anything else. An empty referer covers bookmarks, typed addresses, many apps and browsers that strip the header, and, Wikimedia notes, some bots that escape its filters. The seven editions here are English, German, Spanish, French, Italian, Japanese and Russian. Each has a file for every month since January 2018; so do Polish, Portuguese and Chinese, which are left out to keep the run to one sitting.
How much of the traffic the files capture
The check compares the clickstream with Wikimedia's own count of pageviews by people on desktop and mobile web. Clickstream drops rare pairs, so it should come in a little lower, and for English it does: 94% of the API count in October 2024 and 92% in October 2026. Each edition holds a steady level, and checks.sql fails any month more than 5 points from its edition's median, except the months it pins. In April 2025 every wiki's file is short, at 80% for English. In May 2020 the English file has slightly more arrivals than the API has pageviews (102%). Japanese and Russian coverage steps up in April 2019, so trends here start then. The two windows compared below avoid April 2025, but four low months fall inside them: French August 2024 (78%), which lowers the French base, and Spanish February 2026, French October 2026 and Italian October 2026, which lower the later window.
Every edition lost search traffic
Search arrivals fell in all seven editions after 2024, most in Spanish and Russian
Comparing the same two windows, search fell more than arrivals as a whole in all seven editions. The gap is small in French (18% against 17%) and Japanese (5% against 4%), and widest in English, where no-referer arrivals fell 9% and link arrivals 9%. In German, no-referer arrivals barely moved (3%). Spanish and Russian lost over a third of their search arrivals (43% and 37%) and nearly as much with no referer (43% and 36%), though only about half as much through links. That points to something beyond search engines in those two; this data cannot say what.
Nearly every door let in fewer readers in 2026 than in 2024; in English, search lost more than any other door
| Edition · Door, and the API count | Search | No referer | Article links | All arrivals | Pageviews (API, users) |
|---|---|---|---|---|---|
| English | -20.9% | -9.2% | -9.2% | -14.7% | -13.9% |
| German | -19.7% | -3.1% | -14.5% | -16.0% | -14.4% |
| Spanish | -43.5% | -42.6% | -24.6% | -39.3% | -36.5% |
| French | -17.7% | -19.8% | -12.3% | -16.9% | -15.7% |
| Italian | -25.3% | -15.4% | -15.4% | -21.4% | -18.9% |
| Japanese | -4.9% | 13.5% | -7.4% | -4.0% | -3.5% |
| Russian | -36.6% | -36.3% | -18.7% | -32.2% | -30.3% |
Querychapters/10-wikipedia-search/pipeline/20_model.sqlShow SQL
SELECT a.wiki,
b.search / a.search - 1 AS search_change,
b.no_referer / a.no_referer - 1 AS no_referer_change,
b.article_link / a.article_link - 1 AS links_change,
b.total / a.total - 1 AS total_change,
b.api_views / a.api_views - 1 AS api_change
FROM ttm a JOIN ttm b USING (wiki)
WHERE a.month = DATE '2024-10-01' AND b.month = DATE '2026-10-01';7 editionsRuns at build time in DuckDB 2.0; shown for reading.Open file
Internal link clicks rose relative to outside arrivals
If search engines now answer the quick questions, the readers who still come may be the ones who want more. The files cannot test that directly: they count clicks on pairs of pages, not sessions or people, so no row says what any one reader did after arriving. What they do give is an aggregate ratio, the number of clicks on links between articles for each arrival from outside Wikipedia. In English it rose from 50 to 55 per 100 outside arrivals, and in the twelve months to March 2020 it was 37. It rose in six of the seven editions; the exception is Japanese.
Internal link clicks per outside arrival are higher than in 2020
Articles that depended on search lost the most of it
The totals mix two things: fewer search visits to the same articles, and visits spread over different articles. Following a fixed set separates them. The panel is the 454,636 English articles with at least 1,000 arrivals in every month of both windows. Of these, 78% got fewer search arrivals in the later window, and the median article kept 76% of its search arrivals.
Articles that relied most on search lost the most. Where under half of an article's arrivals in the first window came from search, the median article kept 81%; where 85% or more did, it kept 57%. That fits the idea that answers on the results page replace visits to pages people only reach by searching. It is also what regression to the mean would produce, since an article with an unusually search-heavy year tends to have a less search-heavy one next, so the gradient is an association, not a measured effect of AI summaries.
The more an article depended on search, the more search traffic it lost
| under 50% from search | 81% | 63% to 101% |
|---|---|---|
| 50–70% from search | 69% | 51% to 88% |
| 70–85% from search | 60% | 44% to 81% |
| 85% or more from search | 57% | 37% to 82% |
Querychapters/10-wikipedia-search/pipeline/20_model.sqlShow SQL
SELECT coalesce(search_dependence, 'all articles') AS search_dependence, count(*) AS articles,
median(search_ratio) AS median_search_ratio,
quantile_cont(search_ratio, 0.25) AS q25_search_ratio,
quantile_cont(search_ratio, 0.75) AS q75_search_ratio,
avg((search_ratio < 1)::INT) AS share_lost_search
FROM panel GROUP BY GROUPING SETS ((search_dependence), ());454,636 articlesRuns at build time in DuckDB 2.0; shown for reading.Open file
How the pipeline reads 742 files once
List the files from the dump's own index pages
HTTPS has no glob, so the month folders are generated in SQL,
read_textfetches each folder's HTML listing, and a regular expression pulls out each file's name and size.inventory.sqlSQL SET VARIABLE month_pages = ( SELECT list(getvariable('base') || strftime(m, '%Y-%m') || '/' ORDER BY m) FROM range(getvariable('first_month'), getvariable('last_month') + INTERVAL 1 MONTH, INTERVAL 1 MONTH) t(m)); SELECT unnest(regexp_extract_all(content, 'clickstream-([a-z]+)-(\d{4}-\d{2})\.tsv\.gz</a>\s+(\S+ \S+)\s+(\d+)', 0)) AS line FROM read_text(getvariable('month_pages'));742 files, 84.7 GBchapters/10-wikipedia-search/stage/inventory.sql
Read each file once, aggregated two ways
An English month averages 0.42 GB compressed and 32 million rows.
GROUPING SETSproduces the totals by source and the totals by article in one pass, so the rows are never held in memory, and three DuckDB processes can share the machine.stage.sqlSQL CREATE TEMP TABLE agg AS SELECT grouping(source) AS by_article, source, curr AS article, count(*) AS pairs, sum(n)::BIGINT AS clicks, sum(n) FILTER (WHERE source = 'search')::BIGINT AS from_search FROM (SELECT source_class(prev, type) AS source, curr, n FROM clickstream(getenv('URL'))) GROUP BY GROUPING SETS ((source), (curr));6.4 billion rows to two small Parquet files per file; 36 minutes with 3 files at a timechapters/10-wikipedia-search/stage/stage.sql
Fetch Wikimedia's own pageview counts
The Pageviews API asks clients to identify themselves and rate-limits those that do not. An HTTP secret adds a
User-Agentheader to every request under its scope, andread_jsontakes the whole list of URLs, one per edition, access method and agent.pageviews.sqlSQL CREATE OR REPLACE SECRET wikimedia_api ( TYPE http, SCOPE 'https://wikimedia.org/api/rest_v1/', EXTRA_HTTP_HEADERS MAP {'User-Agent': 'DuckDBCasebook/1.0 (https://github.com/ctzn-pub/duckdb-casebook)'}); SELECT unnest(items, max_depth := 2) FROM read_json(getvariable('api_urls'), format = 'auto');Monthly counts per edition, access method and agent, kept in pipeline/pageviews_api.csvchapters/10-wikipedia-search/stage/pageviews.sql
Twelve-month windows
Wikipedia's traffic follows the school year, so trends are sums over the twelve months ending in each month. A named
WINDOWkeeps the sums readable.20_model.sqlSQL SELECT wiki, month, count(*) OVER w AS months_in_window, bool_or(month = DATE '2025-04-01') OVER w AS has_short_month, sum(search) OVER w AS search, sum(total) OVER w AS total FROM monthly WINDOW w AS (PARTITION BY wiki ORDER BY month ROWS BETWEEN 11 PRECEDING AND CURRENT ROW);560 windowschapters/10-wikipedia-search/pipeline/20_model.sql
Reusing the approach
bash chapters/10-wikipedia-search/stage/run.sh # every file, read in place; resumable
bash chapters/10-wikipedia-search/pipeline/run.sh # everything after the stage, in secondsWhen a public dataset is a folder of monthly files on a plain web server, list the folder from its own index page, read each file once into the few aggregates the analysis needs, and keep those small outputs per file so a failed download costs one file, not the run. GROUPING SETS gives several aggregates from one read; the resumable loop and the checks against an independent count do the rest. Full pipeline: chapters/10-wikipedia-search.