Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Don brito
.
Toggle Highlighting
SQL
df = pd.read_json("https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/all-agents/Pompeu_Fabra_University/daily/2018020100/2018020300",orient='records') import urllib import json import pandas as pd def getViews(page,start,end,project): base_url = "https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/%s/all-access/all-agents/%s/daily/%s/%s" % (project,page,start,end) data = urllib.request.urlopen(base_url) dataJson = json.loads(data.read())['items'] df = pd.DataFrame(dataJson) [['views','timestamp']] df['timestamp'] = pd.to_datetime(df['timestamp'], format='%Y%m%d%H') return df df = getViews('Universitat_Pompeu_Fabra','2018010100','2018020300','ca.wikipedia') df
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...