Skip to content

Instantly share code, notes, and snippets.

@Jasperhino
Created February 4, 2022 11:54
Show Gist options
  • Select an option

  • Save Jasperhino/c4aaa1fb8a9927649144bd8d080f6b1a to your computer and use it in GitHub Desktop.

Select an option

Save Jasperhino/c4aaa1fb8a9927649144bd8d080f6b1a to your computer and use it in GitHub Desktop.
Collect Publix keys of usernames via Github API in Python
from pprint import pprint
import requests
API_URL = 'https://api.github.com/users'
USERS = ['username1', 'username2']
for user in USERS:
print(user)
r = requests.get(f"{API_URL}/{user}/keys")
json = r.json()
print('Number of keys:', len(json))
pprint(json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment