Last active
August 29, 2015 14:03
-
-
Save yefim/2aa1ca4f7a50e7689994 to your computer and use it in GitHub Desktop.
Venmo transaction total
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
from requests import get | |
url = "https://venmo.com/api/v5/users/<YOUR_USER_ID>/feed?access_token=<YOUR_ACCESS_TOKEN>" | |
transactions = [] | |
while url: | |
data = get(url).json() | |
url = data.get('paging', {}).get('next', None) | |
for d in data.get('data', []): | |
transactions += d.get('transactions', []) | |
s = 0 | |
for transaction in transactions: | |
s += transaction.get('amount', 0) | |
print "sum:", s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment