<jupyter_start><jupyter_text>Copyright (C) 2016-2020 <NAME>, <NAME>, <NAME>Licensed under the MIT license, see ../LICENSE  Question 8: How many views did Panama_Papers have… the day it was created?<jupyter_code>import requests
from urllib.parse import quote<jupyter_output><empty_output><jupyter_text>Notes:1. Documentation is online at: https://wikimedia.org/api/rest_v1/?doc2. There is no view data for 20160403, bug?<jupyter_code>ENDPOINT = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'

wp_code = 'en.wikipedia'
access = 'all-access'
agents = 'all-agents'
page_title = 'Panama Papers'
period = 'daily'
start_date = '20160404'
end_date = '20160404'
wp_call = requests.get(ENDPOINT + wp_code + '/' + access + '/' + agents + '/' + quote(page_title, safe='') + '/' + period + '/' + start_date + '/' + end_date)
response = wp_call.json()
response
print(page_title + ' had ' + str(response['items'][0]['views']) + ' page views the first day')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15640766902119072, 'fraction_numerical': 0.03834510595358224, 'mean_word_length': 5.569536423841059, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '323636', 'license': 'MIT', 'n_tokens_mistral': 379, 'n_tokens_neox': 347, 'n_words': 80, 'path': 'wikipedia-question-5.ipynb', 'repo_name': 'makoshark/wikipedia-cdsw', 'size': '1011'}