Last active
August 29, 2018 20:24
-
-
Save yefim/b5ba5cd4534aead3a914 to your computer and use it in GitHub Desktop.
Hit venmo public feed API to see what the most liked venmo was
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 | |
| def hit_api(): | |
| page = "https://venmo.com/api/v5/public" | |
| venmos = [] | |
| counter = 0 | |
| while (counter < 50): | |
| r = requests.get(page) | |
| page = r.json["paging"]["next"] | |
| venmos += r.json["data"] | |
| counter += 1 | |
| return venmos | |
| if __name__ == "__main__": | |
| venmos = hit_api() | |
| print [v["likes"]["count"] for v in venmos if v["likes"]["count"] > 0] | |
| print max(venmos, key=lambda v: v["likes"]["count"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment