{"id":30142110,"url":"https://github.com/shahidmalik4/fastapi-streamlit","last_synced_at":"2026-05-02T23:41:43.232Z","repository":{"id":305318540,"uuid":"1022562851","full_name":"shahidmalik4/fastapi-streamlit","owner":"shahidmalik4","description":"Real-time cryptocurrency tracker with FastAPI, Streamlit, WebSocket, and CoinGecko API.","archived":false,"fork":false,"pushed_at":"2025-07-19T10:50:44.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-19T15:46:52.548Z","etag":null,"topics":["coingecko-api","cryptocurrency","fastapi","plotly","python","realtime","streamlit","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shahidmalik4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-19T10:45:45.000Z","updated_at":"2025-07-19T11:00:24.000Z","dependencies_parsed_at":"2025-07-19T15:46:56.600Z","dependency_job_id":"c8613bd0-b43d-4ba5-89ce-f2785992ff44","html_url":"https://github.com/shahidmalik4/fastapi-streamlit","commit_stats":null,"previous_names":["shahidmalik4/fastapi-streamlit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shahidmalik4/fastapi-streamlit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahidmalik4%2Ffastapi-streamlit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahidmalik4%2Ffastapi-streamlit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahidmalik4%2Ffastapi-streamlit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahidmalik4%2Ffastapi-streamlit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahidmalik4","download_url":"https://codeload.github.com/shahidmalik4/fastapi-streamlit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahidmalik4%2Ffastapi-streamlit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269837220,"owners_count":24483176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coingecko-api","cryptocurrency","fastapi","plotly","python","realtime","streamlit","websocket"],"created_at":"2025-08-11T05:40:27.451Z","updated_at":"2025-09-19T11:20:15.870Z","avatar_url":"https://github.com/shahidmalik4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💰 Real-Time Crypto Tracker\n\nThis is a full-stack **real-time cryptocurrency tracker** built with:\n\n- 🧠 **FastAPI** – Backend REST API \u0026 WebSocket server  \n- 🎨 **Streamlit** – Frontend UI  \n- 📡 **WebSockets** – Real-time updates  \n- 📊 **Plotly** – Interactive historical charts  \n- 🔗 **CoinGecko API** – Live market data source  \n\n---\n\n## 🚀 Features\n\n✅ Top cryptocurrencies (auto-updating)  \n✅ Real-time price \u0026 market cap via WebSocket  \n✅ Live 24h change with 🔴/🟢 indicators  \n✅ Display of absolute price change  \n✅ Currency selector (USD, EUR, PKR, etc.)  \n✅ Sort by price, market cap, change %  \n✅ Interactive 30-day historical line chart  \n✅ Optimized with API response caching  \n\n---\n\n## 🛠 Requirements\n\nInstall dependencies with:\n\n```bash\npip install -r `requirements.txt`\n```\n\n```\nfastapi==0.110.0\nuvicorn==0.29.0\nhttpx==0.27.0\nstreamlit==1.35.0\npandas==2.2.2\nplotly==5.22.0\npython-dotenv==1.0.1\n```\n\n---\n\n## 📁 Project Structure\n\n```\ncrypto-tracker/\n│\n├── main.py           # FastAPI backend with REST \u0026 WebSocket\n├── streamlit.py      # Streamlit frontend UI\n├── README.md         # Project documentation\n└── requirements.txt  # (Optional) Dependencies\n```\n\n---\n\n## ▶️ Running the Project\n\n### Step 1: Run FastAPI Backend\n\n```bash\nuvicorn main:app --reload\n```\n\nRuns at: `http://localhost:8000`  \nWebSocket: `ws://localhost:8000/ws/prices`\n\n---\n\n### Step 2: Run Streamlit Frontend\n\n```bash\nstreamlit run streamlit.py\n```\n\nRuns at: `http://localhost:8501`\n\n---\n\n## 📡 FastAPI Endpoints\n\n| Method | Endpoint                                | Description                            |\n|--------|-----------------------------------------|----------------------------------------|\n| GET    | `/price/{coin_id}`                      | Get current price, market cap, 24h %   |\n| GET    | `/history/{coin_id}?days=30`            | 30-day historical chart data           |\n| GET    | `/top-coins/?limit=20`                  | List of top N coins                    |\n| WS     | `/ws/prices`                            | WebSocket for real-time top coin data  |\n\n---\n\n## ⚙️ How WebSocket Works\n\n- Clients connect to `/ws/prices`  \n- Server sends **live data** every 5 seconds  \n- CoinGecko API is hit **only once per minute**  \n- Multiple users reuse the **cached result**\n\n✅ Efficient and avoids API rate limit errors\n\n---\n\n## ⚠️ Notes on CoinGecko API\n\n- Free tier allows ~50–100 requests/min  \n- This project uses **global cache** in the backend  \n- Ensures performance and stability for many users  \n\n---\n\n## 👨‍💻 Built using:\n\n- [FastAPI](https://fastapi.tiangolo.com/)  \n- [Streamlit](https://streamlit.io/)  \n- [CoinGecko API](https://www.coingecko.com/en/api)  \n- [Plotly](https://plotly.com/)  \n\n---\n\n## 📜 License\n\nMIT License – free to use and modify!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahidmalik4%2Ffastapi-streamlit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahidmalik4%2Ffastapi-streamlit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahidmalik4%2Ffastapi-streamlit/lists"}