On Day 4, our code officially connected to the outside world. Up until today, everything was running offline on our local laptops. Today, we learned how computers talk to other computers across the internet using APIs.
1. What is an API Anyway?
Rashmi gave a great restaurant analogy: You are the customer at the table (the client). The kitchen is where the food gets prepared (the server/database). But you can't just walk into the kitchen yourself—you give your order to the waiter (the API), who brings back your meal (the response). That is all an API is: a standardized messenger between apps.
2. Speaking JSON
We looked at JSON (JavaScript Object Notation), which is the universal language for web APIs. If you know Python dictionaries with keys and values, you already know JSON. It's lightweight, clean, and every programming language can read and write it effortlessly.
3. Building the Gemini AI Chatbot Route
For our main project, we used Flask (a lightweight Python web framework) and integrated Google's Gemini API. While several students were getting confused by API keys and JSON parsing, I got our local Flask server route running smoothly. You type a prompt into the endpoint, Flask packages it into JSON, sends it to Gemini-1.5-flash, and streams the answer back. Rashmi tested my bot live and was super happy with the clean setup.