Skip to content

Instantly share code, notes, and snippets.

@knishioka
Last active May 15, 2022 22:23
Show Gist options
  • Save knishioka/1022cd8f81660972f1b701439aee8080 to your computer and use it in GitHub Desktop.
Save knishioka/1022cd8f81660972f1b701439aee8080 to your computer and use it in GitHub Desktop.
Count merged pull requests
import requests
import json
token = ''
org = ''
author = ''
start_date = '2019-10-01'
end_date = '2019-12-31'
query = f'org:{org}+author:{author}+merged:{start_date}..{end_date}'
end_point = 'https://api.github.com/search/issues'
requests.get(f'{end_point}?q={query}&access_token={token}').json()['total_count']
@shinitiandrei
Copy link

hey there, thanks for that!

Just an update, Github doesn't support tokens via URL anymore, it should be set through HEADERS instead as in: https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/
Hope that helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment