A simple Flask application that fetches and exposes public Tiltify donation data for the #TeamWater campaign β a historic effort to raise $40 million to provide clean water to two million people.
#TeamWater will be the biggest and most impactful campaign for clean water in history. With thousands of the world's top Creators talking about water, we're changing the world, one drop at a time.
This app provides three public API endpoints:
/leaderboardβ Returns top donors for the campaign./donationsβ Returns the latest donations made to the campaign./total_raisedβ Returns the total amount raised.
All data is fetched from the Tiltify API using GraphQL queries.
- Python 3.7+
Flaskrequests
pip install Flask requestspython app.pyBy default, the app will run on http://localhost:5000.
Query Parameters:
limit: (optional) number of donors to return (default:5)fact_id: (optional) Tiltify fact (campaign) ID
Example:
GET /leaderboard?limit=10Query Parameters:
limit: (optional) number of donations to return (default:10)fact_id: (optional) Tiltify fact (campaign) ID
Example:
GET /donations?limit=5Query Parameters:
fact_id: (optional) Tiltify fact (campaign) ID
Example:
GET /total_raised- The default campaign fact ID is:
0478358a-c4ff-4ab0-9cc7-5f0b328df9dc(used iffact_idis not specified). - This app uses the public Tiltify API, which does not require authentication for read-only data.
Pull requests are welcome. For major changes, please open an issue first.
MIT β feel free to use and adapt.