Simple Flask or ApiGateway + Lambda powered implementation of an endpoint that returns the current Tokyo Olympic rankings and medal tallys in a JSON format.
Data source: Official Olympic Site
Endpoint currently hosted on AWS EC2 for free use: http://3.25.134.23/
Heres to the end of another Olympics. Repository has now been archived :)
Totaled 38,000+ hits to the API over the course of the Olympics.
Get the entire ranking table:
http://example.com/api/olympic/rankings
Retrieve country current standings:
Using ISO Alpha 3 Country Codes
http://example.com/api/olympic/rankings?country=AUS
[
{
"country": "Japan",
"country_alpha3": "JPN",
"rank": 1,
"medals": {
"gold": 3,
"silver": 1,
"bronze": 0,
"total": 4
}
},
{
"country": "United States of America",
"country_alpha3": "USA",
"rank": 3,
"medals": {
"gold": 1,
"silver": 2,
"bronze": 4,
"total": 7
}
},
{
"country": "Australia",
"country_alpha3": "AUS",
"rank": 4,
"medals": {
"gold": 1,
"silver": 1,
"bronze": 1,
"total": 3
}
},
...
]
- SAM CLI
- AWS Account
- In the
aws\olympic-api
folder sam build
sam deploy
- Python 3.8+
- Gunicorn
- Install requirements:
pip install -r requirements.txt
- Run development server with:
python api.py
OR - Run production server with:
./run.sh
Branding, data, and other relevant properties.
© 2021 – The Tokyo Organising Committee of the Olympic and Paralympic Games