Lists the 1000 most viewed pages for a given project and timespan (month or day).

wx_top_viewed_pages(
  project,
  access_method = c("all", "desktop", "mobile web", "mobile app"),
  granularity = c("daily", "monthly"),
  start_date = "20191101",
  end_date = "20191231"
)

Arguments

project

The name of any Wikimedia project formatted like {language code}.{project name}, for example en.wikipedia. You may pass en.wikipedia.org and the .org will be stripped off. For projects like Wikimedia Commons (without language codes), use commons.wikimedia. For projects like www.mediawiki.org, you can use that full string, or just use mediawiki or mediawiki.org.

access_method

If you want to filter by access method, use one of: "desktop", "mobile app", or "mobile web". If you are interested in pageviews regardless of access method, use "all" (default).

granularity

The time unit for the response data. As of today, supported values are daily (default) and monthly.

start_date

The date of the first day to include, in YYYYMMDD format. Can also be a Date or a POSIXt object, which will be auto-formatted.

end_date

The date of the last day to include, in YYYYMMDD format. Can also be a Date or a POSIXt object, which will be auto-formatted.

Value

A tibble data frame with the following columns:

date

Date; beginning of each month if granularity = "monthly"

project

project

page_name

page name; NOTE: in wikitext, the first letter of the target page is automatically capitalized

views

number of page-views (see meta:Research:Page view for more information on what is considered a page-view)

rank

views-based ranking

License

Data retrieved from the API endpoint is available under the CC0 1.0 license.

See also

Other traffic data & metrics: wx_page_views(), wx_project_views(), wx_unique_devices()

Examples

wx_top_viewed_pages("en.wikipedia")
#> # A tibble: 60,997 x 5 #> date project page_name views rank #> <date> <chr> <chr> <int> <int> #> 1 2019-11-01 en.wikipedia Main Page 14602260 1 #> 2 2019-11-01 en.wikipedia Special:Search 1498770 2 #> 3 2019-11-01 en.wikipedia Henry V of England 240350 3 #> 4 2019-11-01 en.wikipedia Halloween 236076 4 #> 5 2019-11-01 en.wikipedia Solar System 177408 5 #> 6 2019-11-01 en.wikipedia Terminator: Dark Fate 176920 6 #> 7 2019-11-01 en.wikipedia Jimmy Garoppolo 155807 7 #> 8 2019-11-01 en.wikipedia Crown Jewel (2019) 153559 8 #> 9 2019-11-01 en.wikipedia Bible 145717 9 #> 10 2019-11-01 en.wikipedia Joker (2019 film) 136562 10 #> # … with 60,987 more rows