├── requirements.txt └── streamlit_app.py /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /streamlit_app.py: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | import requests 3 | 4 | # Set the app title 5 | st.title('My First Streamlit App !!') 6 | 7 | # Add a welcome message 8 | st.write('Welcome to my Streamlit app!') 9 | 10 | # Create a text input 11 | widgetuser_input = st.text_input('Enter a custom message:', 'Hello, Streamlit!') 12 | 13 | # Display the customized message 14 | st.write('Customized Message:', widgetuser_input) 15 | 16 | 17 | #API calls 18 | response = requests.get('https://api.vatcomply.com/rates?base=MYR') 19 | 20 | if response.status_code == 200: 21 | data = response.json() 22 | st.write('Output:') 23 | st.json(data) # nicely formatted JSON output 24 | else: 25 | st.error(f"API call failed with status code: {response.status_code}") 26 | 27 | 28 | --------------------------------------------------------------------------------