Last active
          November 21, 2017 15:48 
        
      - 
      
- 
        Save bitnik/94c9c4e38d70dca607ccf149dfd2a354 to your computer and use it in GitHub Desktop. 
    How to query WikiWho API
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import requests | |
| session = requests.session() | |
| # log in data | |
| session.auth = ('wikiwho_api_username', 'wikiwho_api_password') | |
| language = 'en' | |
| wikiwho_api_base_url = 'https://api.wikiwho.net/{}/api/v1.0.0-beta/'.format(language) | |
| # Example: get revision content by page id | |
| page_id = 2161298 | |
| wikiwho_api_rev_content_url = '{}rev_content/page_id/{}/'.format(wikiwho_api_base_url, page_id) | |
| # exclude ins and outs | |
| rev_content_params = {'o_rev_id': 'true', 'editor': 'true', 'token_id': 'true', 'out': 'false', 'in': 'false'} | |
| response = session.get(url=wikiwho_api_rev_content_url, params=rev_content_params).json() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment