Skip to content

Instantly share code, notes, and snippets.

@yefim
Last active August 29, 2015 14:03
Show Gist options
  • Save yefim/2aa1ca4f7a50e7689994 to your computer and use it in GitHub Desktop.
Save yefim/2aa1ca4f7a50e7689994 to your computer and use it in GitHub Desktop.
Venmo transaction total
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