<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged apis</title>
<link>https://coderlegion.com/tag/apis</link>
<description>Powered by Question2Answer</description>
<item>
<title>What Are APIs? And How Do They Work?</title>
<link>https://coderlegion.com/31206/what-are-apis-and-how-do-they-work</link>
<description>&lt;p&gt;&lt;em&gt;A beginner-friendly guide, with a bit of Python and a lot of food analogies.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Imagine you're building a weather application, and it needs to show the current temperature in Mutare. There's just one problem: you don't own any weather sensors, and you definitely don't have a meteorological database lying around. Building that infrastructure yourself would be a huge project. Why reinvent the wheel? So you borrow the data from a service that already has it.&lt;/p&gt;
&lt;p&gt;The tool that makes this possible is something developers use all the time, often without noticing: an &lt;strong&gt;API&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Welcome to another article, where we talk about APIs. Why they're needed, what they are, how they work, types of APIs, and show an example of a code block using an API. &lt;/p&gt;
&lt;p&gt;In simple terms, an &lt;strong&gt;API&lt;/strong&gt; is a defined interface that lets one piece of software interact with another. If you like, think of APIs as the cellphones of applications: they give programs a set way to call each other up and ask for things, like: &quot;Hey, can I have all the PDF documents on machine learning for beginners?&quot;&lt;/p&gt;
&lt;p&gt;In this article, we'll cover what APIs are, how they work, how to make your first API request in Python, the main types you'll hear about, and five beginner projects to practise on.&lt;/p&gt;
&lt;h3 id=&quot;why-do-applications-need-to-communicate-&quot;&gt;Why Do Applications Need to Communicate?&lt;/h3&gt;
&lt;p&gt;Modern applications rarely work alone. They depend on data and services provided by other systems.&lt;/p&gt;
&lt;p&gt;Take a food delivery app. It needs restaurant menus, a payment service, a map to show your location, and live tracking so you can follow your food as it's being delivered. Each job belongs to a different system, and the app connects to them instead of building everything itself.&lt;/p&gt;
&lt;p&gt;The same is true for AI applications. A chatbot might send a prompt to an AI model through one API, then fetch relevant information from a database through another, and combine both to write its answer. Each part has one responsibility, and each is reached through its own interface.&lt;/p&gt;
&lt;p&gt;Now let's bring this closer to home. In my current capstone project, we have five group members, each with different roles and strengths. We can't just disappear into our corners and hope everything magically fits together at the end. We need agreed rules: who builds what, what each piece takes in, and what it hands back.&lt;/p&gt;
&lt;p&gt;Software components need the same thing. Without a clearly defined way to talk to each other, they can't reliably work together. That defined way of making requests and passing information is the API.&lt;/p&gt;
&lt;h3 id=&quot;what-is-an-api-&quot;&gt;What Is an API?&lt;/h3&gt;
&lt;p&gt;Six months ago, I didn't even know what the letters stood for. Today I can tell you that API stands for &lt;strong&gt;Application Programming Interface&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here's the more precise definition. An API is a defined interface that allows one software component to interact with another. It specifies how requests can be made, what information or functionality is available, and how the receiving system communicates the result (Amazon Web Services, n.d.).&lt;/p&gt;
&lt;p&gt;The application using the API doesn't need to know all the internal details of the system providing the service. It needs to understand the interface and follow the rules for using it.&lt;/p&gt;
&lt;h4 id=&quot;the-restaurant-menu-analogy&quot;&gt;The restaurant menu analogy&lt;/h4&gt;
&lt;p&gt;Think of a restaurant menu. It tells you what you can order and what to expect back: &quot;Quarter chicken and chips with lettuce&quot;, and sometimes even a picture of the plate you're about to get.&lt;/p&gt;
&lt;p&gt;You don't need to know how the kitchen works, where the ingredients are stored, or what the chef does behind the scenes. You look at the menu and place your order. That's it.&lt;/p&gt;
&lt;p&gt;In this analogy, the &lt;strong&gt;menu is the API&lt;/strong&gt; (the interface), and your &lt;strong&gt;order is the request&lt;/strong&gt;. It's basically: &quot;I want this. I don't need to know how you do it, but here's how I'll ask for it.&quot;&lt;/p&gt;
&lt;p&gt;A quick caveat, though. The menu doesn't cook anything. In a typical web API, the API defines the interaction, while the server behind it does the actual work. Keep that in mind, because we'll come back to it.&lt;/p&gt;
&lt;h4 id=&quot;apis-aren-t-only-for-the-internet&quot;&gt;APIs aren't only for the internet&lt;/h4&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; An API isn't necessarily a website, a database, or something that runs over the internet. APIs also exist inside programs. For example, a software library has an API that tells you which functions you can call, and an operating system has APIs that let programs open files or draw things on screen.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;how-do-apis-work-the-request-response-cycle&quot;&gt;How Do APIs Work? The Request-Response Cycle&lt;/h3&gt;
&lt;p&gt;Let's put the restaurant to work. You're hungry and you order a burger:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;You place an order (request).&lt;/strong&gt; Your application asks for something, like the current weather in Mutare.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The kitchen gets to work (processing).&lt;/strong&gt; The server receives the request and prepares what was asked for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Your food arrives (response).&lt;/strong&gt; The server sends the result back, and your application displays it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here's how the roles line up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The menu&lt;/strong&gt; is the interface and its rules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The customer&lt;/strong&gt; is the client (your application).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The kitchen&lt;/strong&gt; is the server that processes the request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The meal&lt;/strong&gt; is the response.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a typical web API interaction, the client sends a request to an endpoint (a specific web address) using a defined format and method. The server receives the request, validates it, and performs the required operation, which may involve retrieving data or communicating with another service. It then returns a response, often containing a status code and data formatted as JSON (MDN Web Docs, n.d.).&lt;/p&gt;
&lt;h4 id=&quot;what-happens-when-something-goes-wrong-&quot;&gt;What happens when something goes wrong?&lt;/h4&gt;
&lt;p&gt;Not every order ends with a delicious burger. You might order something that isn't on the menu (an invalid request), the kitchen might run out of ingredients (a server error), or the waiter might never make it to your table (a network problem). If something goes wrong, the server may return an error response instead, and the client should be ready to handle both successes and failures.&lt;/p&gt;
&lt;h3 id=&quot;making-your-first-api-request-in-python&quot;&gt;Making Your First API Request in Python&lt;/h3&gt;
&lt;p&gt;Enough theory. Let's actually use an API!&lt;/p&gt;
&lt;p&gt;We'll use Python and &lt;a rel=&quot;nofollow&quot; href=&quot;https://jsonplaceholder.typicode.com/&quot;&gt;JSONPlaceholder&lt;/a&gt;, a free fake online REST API built for testing and experimentation. It lets us practise a simple request without building our own backend.&lt;/p&gt;
&lt;p&gt;First, install the &lt;code&gt;requests&lt;/code&gt; library:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pip install requests
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, the code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import requests

url = &quot;https://jsonplaceholder.typicode.com/posts/1&quot;

try:
    response = requests.get(url, timeout=10)
    response.raise_for_status()
    post = response.json()
    print(f&quot;User ID: {post['userId']}&quot;)
    print(f&quot;ID: {post['id']}&quot;)
    print(f&quot;Post Title: {post['title']}&quot;)
    print(f&quot;Post Body: {post['body']}&quot;)
except ValueError:
    print(&quot;The response was not valid JSON.&quot;)
except requests.RequestException as error:
    print(&quot;Request failed:&quot;, error)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That's it, we've just made an API request! Here's what's happening, in plain language:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;requests.get(url, timeout=10)&lt;/code&gt; sends an HTTP &lt;strong&gt;GET&lt;/strong&gt; request, which means &quot;please give me this.&quot; It's us placing our order. The &lt;code&gt;timeout=10&lt;/code&gt; tells Python to stop waiting after 10 seconds, so our program doesn't hang forever if the kitchen has vanished.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;response.raise_for_status()&lt;/code&gt; checks whether the request succeeded. If the server answers with an error status code (like 404 for &quot;not found&quot; or 500 for &quot;server problem&quot;), it raises an exception instead of letting the program carry on as if nothing happened (Requests, n.d.).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;response.json()&lt;/code&gt; &lt;strong&gt;parses&lt;/strong&gt; the response body, which means it turns the JSON text into Python data (here, a dictionary) that we can work with. If the body isn't valid JSON, this step fails.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;post['userId']&lt;/code&gt;, &lt;code&gt;post['id']&lt;/code&gt;, &lt;code&gt;post['title']&lt;/code&gt; and &lt;code&gt;post['body']&lt;/code&gt; each read one field from that dictionary: who wrote the post, the post's own number, its title and its text. The f-strings add a label in front of each value so the output is easy to read.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;except&lt;/code&gt; blocks are our safety net. One catches invalid JSON, and the other catches request failures such as timeouts, connection problems and bad status codes. Either way, we print a readable message instead of crashing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here's what I got when I ran the code:&lt;br&gt;
&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=923120795178393657&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The API returns a sample post with a user ID, a post ID, a title and a body, and those are the four values we printed. We don't know how the service stores that data, and we don't need to. We use the interface and work with what comes back.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Run this code yourself and then break it on purpose. Change the URL to &lt;code&gt;/posts/99999&lt;/code&gt; or remove a letter from the address, and watch which error message appears. You'll learn more from the failures than from the success.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;types-of-apis-rest-soap-graphql-and-websockets&quot;&gt;Types of APIs: REST, SOAP, GraphQL and WebSockets&lt;/h3&gt;
&lt;p&gt;Do all APIs work the same way? The short answer is no. Here are four you'll hear about often.&lt;/p&gt;
&lt;h4 id=&quot;rest-apis&quot;&gt;REST APIs&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;REST&lt;/strong&gt; is an architectural style commonly used to build web APIs, often over HTTP. Resources like users, products or blog posts are accessed through addresses. Our JSONPlaceholder example was a REST API.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Use it when:&lt;/em&gt; you're building a standard web or mobile backend. It's a sensible starting point for most beginners.&lt;/p&gt;
&lt;h4 id=&quot;soap-apis&quot;&gt;SOAP APIs&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;SOAP&lt;/strong&gt; is a messaging protocol that exchanges structured messages, usually written in XML, under strict rules. It's more rigid than REST and is often found in older or enterprise systems.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Use it when:&lt;/em&gt; you're integrating with a system that already requires it, such as some banking or enterprise services.&lt;/p&gt;
&lt;h4 id=&quot;graphql-apis&quot;&gt;GraphQL APIs&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;GraphQL&lt;/strong&gt; is a query language and runtime. Clients can request the specific fields they need, within the limits of the server's schema and permissions. An app showing a profile page might ask only for a user's name and email instead of their entire record.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Use it when:&lt;/em&gt; different screens or clients need different slices of the same data.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Further reading:&lt;/strong&gt; The official &lt;a rel=&quot;nofollow&quot; href=&quot;https://graphql.org/learn/&quot;&gt;GraphQL introduction&lt;/a&gt; explains queries and schemas.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;websocket-apis&quot;&gt;WebSocket APIs&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;WebSockets&lt;/strong&gt; provide a persistent, two-way connection, instead of the usual &quot;ask once, answer once&quot; pattern of HTTP. They can support real-time APIs.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Use it when:&lt;/em&gt; you need constant live updates, such as chat, multiplayer games or live dashboards.&lt;/p&gt;
&lt;h4 id=&quot;these-aren-t-all-the-same-kind-of-thing&quot;&gt;These aren't all the same kind of thing&lt;/h4&gt;
&lt;p&gt;Here's the part that confused me at first: these four aren't competing options from the same category. REST is an architectural style, SOAP is a protocol, GraphQL is a query language and runtime, and WebSocket is a communication protocol. They also aren't mutually exclusive. A single application might use REST for normal data, GraphQL for flexible queries and WebSockets for live notifications.&lt;/p&gt;
&lt;p&gt;There's no single API style that fits every situation. The right choice depends on what you're building.&lt;/p&gt;
&lt;h3 id=&quot;why-apis-matter-and-where-they-can-hurt-&quot;&gt;Why APIs Matter (and Where They Can Hurt)&lt;/h3&gt;
&lt;p&gt;APIs let developers build on existing technology, combining services into applications that would be far more complicated to create alone.&lt;/p&gt;
&lt;p&gt;If you're into AI like I am, this matters even more. Picture an AI-powered application that uses a language model, retrieves information from a database and processes payments, all through separate APIs.&lt;/p&gt;
&lt;p&gt;An AI model and an AI API are not the same thing. The model performs the inference, while an API can provide a defined way for an application to send input to a hosted model and receive its output. This means developers can build AI-powered applications without necessarily hosting the model themselves, although they still need to manage the surrounding application logic, security and usage costs.&lt;/p&gt;
&lt;h4 id=&quot;the-trade-offs-of-depending-on-someone-else-s-api&quot;&gt;The trade-offs of depending on someone else's API&lt;/h4&gt;
&lt;p&gt;Although APIs make integration easier, they also introduce considerations such as authentication, rate limits, security and reliability. Some services require API keys, while others restrict the number of requests a client can make or charge based on usage. Requests can also fail because of network issues or server errors. Developers should protect private credentials, follow the provider's usage requirements, and design applications to handle failures gracefully.&lt;/p&gt;
&lt;p&gt;There's also dependency risk. An external API can change, go offline, impose quotas or start charging for something that used to be free. Your app is only as reliable as the services it leans on.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Further reading:&lt;/strong&gt; The &lt;a rel=&quot;nofollow&quot; href=&quot;https://owasp.org/www-project-api-security/&quot;&gt;OWASP API Security Project&lt;/a&gt; lists the most common API security risks and how to reduce them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;5-beginner-api-projects-to-practise-with&quot;&gt;5 Beginner API Projects to Practise With&lt;/h3&gt;
&lt;p&gt;Now let's practise. Each project below has a clear finish line and at least one error case to handle. The difficulty ratings are rough guides, not universal truths, so a project may feel easier or harder for you. Always check each provider's current documentation for key, account and usage requirements, since these can change.&lt;/p&gt;
&lt;h4 id=&quot;1-weather-app-beginner-&quot;&gt;1. Weather app (beginner)&lt;/h4&gt;
&lt;p&gt;Build an app that shows the temperature, humidity and current conditions for a place of your choice. Use &lt;a rel=&quot;nofollow&quot; href=&quot;https://open-meteo.com/en/docs&quot;&gt;Open-Meteo&lt;/a&gt;, which offers weather data as JSON and, at the time of writing, doesn't need an API key for its free, non-commercial use.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You'll practise:&lt;/strong&gt; GET requests, query parameters, JSON responses and displaying data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Success looks like:&lt;/strong&gt; typing a city's coordinates and seeing its current weather on screen.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error case to handle:&lt;/strong&gt; the request times out or the service is unreachable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-random-cat-image-generator-beginner-&quot;&gt;2. Random cat image generator (beginner)&lt;/h4&gt;
&lt;p&gt;A tiny app that shows a new cat picture each time someone clicks a button. Simple, fun and surprisingly good for the basics. Use &lt;a rel=&quot;nofollow&quot; href=&quot;https://developers.thecatapi.com/&quot;&gt;The Cat API&lt;/a&gt;, and check its docs for current authentication and usage requirements.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You'll practise:&lt;/strong&gt; making requests, handling responses, displaying images and responding to clicks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Success looks like:&lt;/strong&gt; a new cat appears on every click.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error case to handle:&lt;/strong&gt; the image fails to load, so show a friendly message instead of a broken picture.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-book-finder-beginner-&quot;&gt;3. Book finder (beginner)&lt;/h4&gt;
&lt;p&gt;Let users search by title or author and show titles, authors, publication dates and cover images with the &lt;a rel=&quot;nofollow&quot; href=&quot;https://developers.google.com/books/docs/v1/using&quot;&gt;Google Books API&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You'll practise:&lt;/strong&gt; search queries, query parameters, looping through multiple results and displaying structured data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Success looks like:&lt;/strong&gt; searching &quot;Things Fall Apart&quot; and seeing a list of matching books.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error case to handle:&lt;/strong&gt; a search that returns no results. Show &quot;No books found&quot; rather than a blank page.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-movie-search-app-beginner-to-intermediate-&quot;&gt;4. Movie search app (beginner to intermediate)&lt;/h4&gt;
&lt;p&gt;Build a movie lookup that shows titles, release dates, ratings and posters using &lt;a rel=&quot;nofollow&quot; href=&quot;https://developer.themoviedb.org/docs/getting-started&quot;&gt;The Movie Database (TMDB) API&lt;/a&gt;. Check the current requirements for accounts, API keys, attribution and usage before you start.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You'll practise:&lt;/strong&gt; authentication, search queries and displaying data in a user interface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Success looks like:&lt;/strong&gt; searching for a film and seeing its poster, rating and release date.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error case to handle:&lt;/strong&gt; an invalid or missing API key.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-ai-chatbot-intermediate-&quot;&gt;5. AI chatbot (intermediate)&lt;/h4&gt;
&lt;p&gt;Build a simple chatbot that sends a user's message to an AI model and displays the reply. Follow the &lt;a rel=&quot;nofollow&quot; href=&quot;https://platform.openai.com/docs/quickstart&quot;&gt;OpenAI API quickstart&lt;/a&gt; to make your first request. Hosted model APIs need a key and may charge for usage, so keep an eye on costs.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You'll practise:&lt;/strong&gt; POST requests, sending data in a request body, authentication and handling AI-generated responses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Success looks like:&lt;/strong&gt; typing a question and getting a model-generated answer back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error case to handle:&lt;/strong&gt; the request fails, the rate limit is hit or the key is invalid.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Never put private API keys in frontend code or commit them to GitHub. For a web app, make the API call from your server and load the key from an environment variable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;where-should-you-start-&quot;&gt;Where Should You Start?&lt;/h3&gt;
&lt;p&gt;If you've never worked with APIs before, start with the cat generator or the weather app. Both let you focus on the fundamentals without much application logic getting in the way.&lt;/p&gt;
&lt;p&gt;Once you're comfortable, move on to the book finder and movie search. Save the chatbot for when you're ready to deal with authentication, POST requests and keeping secrets safe.&lt;/p&gt;
&lt;p&gt;Start small, experiment, break things, and build your way up. The goal isn't only to finish the projects. It's to understand what happens each time your application talks to another service.&lt;/p&gt;
&lt;h3 id=&quot;frequently-asked-questions&quot;&gt;Frequently Asked Questions&lt;/h3&gt;
&lt;h4 id=&quot;do-i-need-to-know-how-a-server-works-to-use-an-api-&quot;&gt;Do I need to know how a server works to use an API?&lt;/h4&gt;
&lt;p&gt;No. That's the whole point of an interface. You need to understand how to ask and what you'll get back, not how the system works internally.&lt;/p&gt;
&lt;h4 id=&quot;what-s-the-difference-between-an-api-and-an-api-key-&quot;&gt;What's the difference between an API and an API key?&lt;/h4&gt;
&lt;p&gt;The API is the interface. The API key is like a membership card that some providers require so they know who is making requests and can apply limits or charges.&lt;/p&gt;
&lt;h4 id=&quot;is-a-free-api-really-free-&quot;&gt;Is a free API really free?&lt;/h4&gt;
&lt;p&gt;Often, but usually with limits. Check the provider's documentation for rate limits, usage rules and whether free access is allowed for your kind of project.&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;An &lt;strong&gt;API&lt;/strong&gt; is a defined interface that lets software components interact without needing to know each other's inner workings, much like ordering from a menu without visiting the kitchen.&lt;/p&gt;
&lt;p&gt;In a typical web API, the &lt;strong&gt;client&lt;/strong&gt; sends a &lt;strong&gt;request&lt;/strong&gt;, the &lt;strong&gt;server&lt;/strong&gt; processes it, and a &lt;strong&gt;response&lt;/strong&gt; comes back, which might be data or an error.&lt;/p&gt;
&lt;p&gt;We saw this in Python with &lt;code&gt;requests&lt;/code&gt;, adding a &lt;strong&gt;timeout&lt;/strong&gt;, &lt;code&gt;raise_for_status()&lt;/code&gt; and &lt;strong&gt;exception handling&lt;/strong&gt; so the code copes with failure.&lt;/p&gt;
&lt;p&gt;REST, SOAP, GraphQL and WebSockets are different tools that can even live in the same app.&lt;/p&gt;
&lt;p&gt;APIs make integration possible, but they bring &lt;strong&gt;authentication&lt;/strong&gt;, &lt;strong&gt;rate limits&lt;/strong&gt;, &lt;strong&gt;costs&lt;/strong&gt; and &lt;strong&gt;dependency risks&lt;/strong&gt;. Start with a small project, break it on purpose, and learn from what happens.&lt;/p&gt;
&lt;p&gt;Now that you know what's going on behind the scenes, the next time you use an app, you might catch yourself wondering which APIs are making it work.&lt;/p&gt;
&lt;p&gt;Happy coding!&lt;/p&gt;
&lt;p&gt;See you next time!&lt;/p&gt;
&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;
&lt;p&gt;Amazon Web Services. (n.d.). &lt;em&gt;What is an API?&lt;/em&gt; Amazon.com. Retrieved October 14, 2026, from &lt;a rel=&quot;nofollow&quot; href=&quot;https://aws.amazon.com/what-is/api/&quot;&gt;https://aws.amazon.com/what-is/api/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;MDN Web Docs. (n.d.). &lt;em&gt;HTTP&lt;/em&gt;. Mozilla. Retrieved October 14, 2026, from &lt;a rel=&quot;nofollow&quot; href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP&quot;&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Requests. (n.d.). &lt;em&gt;Quickstart&lt;/em&gt;. Requests documentation. Retrieved October 14, 2026, from &lt;a rel=&quot;nofollow&quot; href=&quot;https://requests.readthedocs.io/en/latest/user/quickstart/&quot;&gt;https://requests.readthedocs.io/en/latest/user/quickstart/&lt;/a&gt;&lt;/p&gt;
</description>
<category>Tutorials</category>
<guid isPermaLink="true">https://coderlegion.com/31206/what-are-apis-and-how-do-they-work</guid>
<pubDate>Thu, 15 Oct 2026 13:41:10 +0000</pubDate>
</item>
<item>
<title>Jev Model API</title>
<link>https://coderlegion.com/29563/jev-model-api</link>
<description>&lt;p&gt;Jev Model is a System One decision model for developers. It accepts shared state as text, JSON objects, or arrays of text and answers up to eight Choice, Score, or Noul questions in parallel. It returns structured outputs with probabilities for classification, routing, scoring, guardrails, and human-review workflows.&lt;/p&gt;
&lt;p&gt;Try the free unlimited online playground: &lt;a rel=&quot;nofollow&quot; href=&quot;https://jevmodel.net/&quot;&gt;https://jevmodel.net/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The website also provides documentation, API access, and paid access plans for teams. The project’s GitHub organization is &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jev-ai&quot;&gt;https://github.com/jev-ai&lt;/a&gt;&lt;/p&gt;
</description>
<category>Launches</category>
<guid isPermaLink="true">https://coderlegion.com/29563/jev-model-api</guid>
<pubDate>Fri, 02 Oct 2026 20:39:51 +0000</pubDate>
</item>
<item>
<title>From Tutorials to Real Projects: What Building My AI Learning Companion Is Teaching Me.</title>
<link>https://coderlegion.com/26400/from-tutorials-to-real-projects-what-building-my-ai-learning-companion-is-teaching-me</link>
<description>&lt;p&gt;One thing I’m beginning to appreciate about learning software development is that understanding a concept and using it to build something are two different experiences.&lt;/p&gt;
&lt;p&gt;You can understand what a function does, how a class works, or how an API is supposed to work. But when you start putting everything together into a real project, you begin to see how those concepts connect.&lt;/p&gt;
&lt;p&gt;That’s what I’ve been experiencing while building my AI-Powered Learning Companion using Python.&lt;/p&gt;
&lt;p&gt;The idea behind the project is to create a tool that helps learners practice by generating study questions, evaluating answers, and tracking their progress.&lt;/p&gt;
&lt;p&gt;At first, the idea sounded straightforward.&lt;/p&gt;
&lt;p&gt;Then I started building. &lt;/p&gt;
&lt;p&gt;I had to think about how to organize the application, how to structure the data, how different parts of the program would communicate, and how to handle situations when something didn't work as expected.&lt;/p&gt;
&lt;p&gt;And that’s where the learning became much more practical.&lt;/p&gt;
&lt;p&gt;The bugs became part of the lesson&lt;/p&gt;
&lt;p&gt;One thing I’ve learned is that debugging is not just about fixing an error and moving on.&lt;/p&gt;
&lt;p&gt;Sometimes, an error makes you realize that you didn't fully understand how something worked in the first place.&lt;/p&gt;
&lt;p&gt;Other times, you discover that the problem isn't where you thought it was.&lt;/p&gt;
&lt;p&gt;So I’ve been learning to slow down, read the error messages, understand what the code is actually doing, and try to solve the problem instead of just rushing to make it disappear.&lt;/p&gt;
&lt;p&gt;I’m still working on this, but I’m definitely becoming more comfortable with the process.&lt;/p&gt;
&lt;p&gt;🤖 Learning to work with APIs&lt;/p&gt;
&lt;p&gt;Another interesting part has been learning how to connect the application to an AI language model.&lt;/p&gt;
&lt;p&gt;This has introduced me to things like:&lt;/p&gt;
&lt;p&gt;Working with API requests&lt;br&gt;
Handling responses&lt;br&gt;
Managing errors&lt;br&gt;
Understanding API credentials&lt;br&gt;
Thinking about how an external service fits into my application&lt;/p&gt;
&lt;p&gt;It has also reminded me that building an AI application involves more than just calling an AI model.&lt;/p&gt;
&lt;p&gt;You still need to think about the application itself, how users interact with it, and how the information is stored and used.&lt;/p&gt;
&lt;p&gt; Seeing the bigger picture&lt;/p&gt;
&lt;p&gt;One of the things I’m enjoying most is seeing how different concepts come together.&lt;/p&gt;
&lt;p&gt;Python is no longer just something I use to practice individual exercises.&lt;/p&gt;
&lt;p&gt;I’m beginning to see how it can be used to build something that has a purpose.&lt;/p&gt;
&lt;p&gt;And that has been really encouraging.&lt;/p&gt;
&lt;p&gt;I’m also continuing to learn JavaScript, so I’m excited to see how that will expand what I can build in the future.&lt;/p&gt;
&lt;p&gt;I’m still learning, and this project is still a work in progress.&lt;/p&gt;
&lt;p&gt;But I’m starting to understand why people say that building projects is one of the best ways to learn programming.&lt;/p&gt;
&lt;p&gt;You don't just learn how something works.&lt;/p&gt;
&lt;p&gt;You learn how to make it work.&lt;/p&gt;
&lt;p&gt;And sometimes, you learn the most when it doesn't. &lt;/p&gt;
&lt;p&gt;What was the first project that made programming feel practical for you?&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/26400/from-tutorials-to-real-projects-what-building-my-ai-learning-companion-is-teaching-me</guid>
<pubDate>Mon, 07 Sep 2026 12:29:42 +0000</pubDate>
</item>
<item>
<title>Where No-Code Stops Being Code</title>
<link>https://coderlegion.com/25705/where-no-code-stops-being-code</link>
<description>&lt;p&gt;Most of us here have been handed a no-code prototype and asked to make it production ready. This is a look at where that handoff usually breaks, and what changes when the platform emits real server side code instead of a configuration blob.&lt;/p&gt;
&lt;h3 id=&quot;the-ceiling-is-the-component-library&quot;&gt;The Ceiling Is The Component Library&lt;/h3&gt;
&lt;p&gt;A visual builder can only express what its component library supports. Simple CRUD, an internal admin tool, a prototype for a stakeholder, all fine. The wall arrives the first time you need a pricing function that reads inventory levels and seasonal patterns, or an endpoint that accepts a webhook from an obscure vendor and reshapes the payload for your CRM.&lt;/p&gt;
&lt;p&gt;At that point there are two exits, and both are expensive. You invent a workaround nobody can maintain, or you throw the build away and start again in code with the requirements you should have written down in the first place.&lt;/p&gt;
&lt;h3 id=&quot;generated-code-moves-the-ceiling-to-your-api-surface&quot;&gt;Generated Code Moves The Ceiling To Your API Surface&lt;/h3&gt;
&lt;p&gt;When the output is actual server side code rather than a saved configuration, the constraint changes shape. You are no longer bounded by a predefined set of blocks, you are bounded by whatever your APIs and your data will allow. Custom logic, scheduled jobs, storage and your own endpoints are all just code the generator can write.&lt;/p&gt;
&lt;p&gt;The tradeoff is worth stating honestly. Visual builders let you watch the thing take form as you assemble it, which is a real advantage if you think by dragging. Generated apps ask you to describe the requirement clearly before anything exists, which is harder, and which is also why the output tends to be more capable. That is the model behind the platform we build on, where &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.aiappsapi.com/appsoverview/&quot;&gt;custom apps, chained commands and the ML and chatbot layers&lt;/a&gt; all sit on the same generated foundation.&lt;/p&gt;
&lt;h3 id=&quot;the-chain-is-where-the-value-actually-lands&quot;&gt;The Chain Is Where The Value Actually Lands&lt;/h3&gt;
&lt;p&gt;A single generated app is rarely the interesting part. The interesting part is the chain. A form submission fires an enrichment call, the result feeds a scoring step, a condition routes the record, a follow up gets scheduled, and a notification goes out to whoever owns the next decision.&lt;/p&gt;
&lt;p&gt;Every one of those steps is trivial on its own. The complexity lives entirely in the wiring, in the branches, and in what the chain does when one call comes back empty. Compose from simple steps and the hard part becomes composition, which is a much better problem to have than a monolith you cannot inspect.&lt;/p&gt;
&lt;h3 id=&quot;what-to-check-before-you-trust-it&quot;&gt;What To Check Before You Trust It&lt;/h3&gt;
&lt;p&gt;Two things separate a platform you can run a business on from a good demo.&lt;/p&gt;
&lt;p&gt;The first is conditional handling on every step that can legitimately return nothing. The silent stall is the failure mode nobody plans for, and it is the one that gets discovered on Thursday when someone asks why the leads stopped arriving.&lt;/p&gt;
&lt;p&gt;The second is a readable run history. When a chain fails, you need to open that run and see which call returned what, in order, with the data that was in context at the time. Without that, you have not automated a process, you have only moved it somewhere you cannot watch it.&lt;/p&gt;
&lt;p&gt;If a platform gives you real code, real branches and a run log you can read back, the no-code label stops mattering. What you actually have is a code generator with hosting attached, and that is a fair thing to put in front of a business.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/25705/where-no-code-stops-being-code</guid>
<pubDate>Fri, 28 Aug 2026 17:19:28 +0000</pubDate>
</item>
<item>
<title>How Backboard.io Transformed My Multi-Agent AI System</title>
<link>https://coderlegion.com/14786/how-backboard-io-transformed-my-multi-agent-ai-system</link>
<description>&lt;p&gt;I built &lt;strong&gt;Londoolink AI&lt;/strong&gt; to help users stay on top of their day by generating personalized briefings from emails, calendar events, Notion pages, and social media.&lt;/p&gt;
&lt;p&gt;It worked well and pulled together useful insights, but it had one major flaw.&lt;/p&gt;
&lt;p&gt;It forgot everything.&lt;/p&gt;
&lt;p&gt;Every time a user came back, it was like starting over. Preferences were lost, conversations had no context, and the experience felt repetitive. The system was smart, but it didn’t feel intelligent.&lt;/p&gt;
&lt;p&gt;That changed when I integrated &lt;strong&gt;Backboard.io&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can view the project here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://londoolink-ai.vercel.app/&quot;&gt;https://londoolink-ai.vercel.app/&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;1-the-problem-no-memory&quot;&gt;1. The Problem: No Memory&lt;/h3&gt;
&lt;p&gt;Before the integration, users had to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Repeat their preferences every day&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Re-explain what mattered to them&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ask the same follow-up questions again&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though the system could analyze data well, it didn’t learn from users over time.&lt;/p&gt;
&lt;h3 id=&quot;2-the-shift-to-a-stateful-system&quot;&gt;2. The Shift to a Stateful System&lt;/h3&gt;
&lt;p&gt;I first came across &lt;a rel=&quot;nofollow&quot; href=&quot;http://Backboard.io&quot;&gt;&lt;strong&gt;Backboard.io&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;through an email&lt;/strong&gt; after submitting my project to an &lt;strong&gt;Auth0 Hackathon on Devpost&lt;/strong&gt;. The team had reached out, sharing more about the platform and how it enables AI systems to become stateful through persistent memory, threads, and tool-calling.&lt;/p&gt;
&lt;p&gt;That sparked my curiosity, so I explored it further during &lt;strong&gt;MLH Global Hack Week: API&lt;/strong&gt;, where I got to understand more about how it actually works in practice.&lt;/p&gt;
&lt;p&gt;What stood out was simple but powerful:&lt;/p&gt;
&lt;p&gt;Instead of building memory from scratch, Backboard provides it out of the box.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-what-changed&quot;&gt;3. What Changed&lt;/h3&gt;
&lt;h4 id=&quot;persistent-memory&quot;&gt;&lt;em&gt;Persistent Memory&lt;/em&gt;&lt;/h4&gt;
&lt;p&gt;Now, users can store preferences like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Preferring meetings in the morning&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prioritizing certain emails&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And the system remembers them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here’s a simplified version of how I store preferences:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This function saves a new piece of memory (like a user preference) for a specific assistant using Backboard’s API.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;class BackboardService:
    def add_memory(self, assistant_id, content):
        response = requests.post(
            f&quot;{self.base_url}/assistants/{assistant_id}/memories&quot;,
            headers=self.headers,
            json={&quot;content&quot;: content}
        )
        return response.json()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Retrieving preferences:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This function searches stored memories and returns anything related to user preferences so the assistant can personalize responses.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def get_preferences(self, assistant_id):
    response = requests.post(
        f&quot;{self.base_url}/assistants/{assistant_id}/memories/search&quot;,
        headers=self.headers,
        json={&quot;query&quot;: &quot;user preferences&quot;}
    )
    return response.json().get(&quot;memories&quot;, [])
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;better-document-retrieval&quot;&gt;&lt;em&gt;Better Document Retrieval&lt;/em&gt;&lt;/h4&gt;
&lt;p&gt;I moved from a local setup to a cloud-based system.&lt;/p&gt;
&lt;p&gt;This function uploads documents (like notes or data sources) to the cloud so they can be retrieved and used by the AI system later.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def add_document(self, content, metadata):
    return requests.post(
        f&quot;{self.base_url}/documents&quot;,
        headers=self.headers,
        json={
            &quot;content&quot;: content,
            &quot;metadata&quot;: metadata
        }
    )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This improved both scalability and search quality.&lt;/p&gt;
&lt;h4 id=&quot;threaded-conversations&quot;&gt;&lt;em&gt;Threaded Conversations&lt;/em&gt;&lt;/h4&gt;
&lt;p&gt;Now users can ask follow-up questions with full context.&lt;/p&gt;
&lt;p&gt;This function creates a conversation thread tied to a specific user so all messages stay connected.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def create_thread(self, user_id):
    response = requests.post(
        f&quot;{self.base_url}/threads&quot;,
        headers=self.headers,
        json={&quot;metadata&quot;: {&quot;user_id&quot;: user_id}}
    )
    return response.json()[&quot;thread_id&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Adding messages to a thread:&lt;/p&gt;
&lt;p&gt;This appends a new message (from a user or an assistant) to an existing conversation thread to maintain context.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def add_message(self, thread_id, role, content):
    requests.post(
        f&quot;{self.base_url}/threads/{thread_id}/messages&quot;,
        headers=self.headers,
        json={&quot;role&quot;: role, &quot;content&quot;: content}
    )
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;4-how-it-all-comes-together&quot;&gt;4. How It All Comes Together&lt;/h3&gt;
&lt;p&gt;In my main agent:&lt;/p&gt;
&lt;p&gt;This is the full flow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Get or create an assistant&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fetch stored user preferences&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate a personalized briefing&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a conversation thread for follow-ups&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def create_briefing(self, user_id):
    assistant_id = self.get_or_create_assistant(user_id)

    preferences = self.get_preferences(assistant_id)

    briefing = self.generate_briefing(
        data_sources,
        user_preferences=preferences
    )

    thread_id = self.create_thread(user_id)

    return {
        &quot;briefing&quot;: briefing,
        &quot;thread_id&quot;: thread_id
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;5-challenges-along-the-way&quot;&gt;5. Challenges Along the Way&lt;/h3&gt;
&lt;p&gt;One issue I ran into was handling API responses.&lt;/p&gt;
&lt;p&gt;The API sometimes returned &lt;strong&gt;201 instead of 200&lt;/strong&gt;, so I updated my handler:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;if response.status_code in (200, 201):
    return response.json()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also had to handle endpoint inconsistencies like &lt;code&gt;/memory&lt;/code&gt; vs &lt;code&gt;/memories&lt;/code&gt;, and made response parsing more flexible.&lt;/p&gt;
&lt;h3 id=&quot;6-the-impact&quot;&gt;6. The Impact&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Before Backboard &lt;/th&gt;&lt;th&gt;After Backboard&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;No memory &lt;/td&gt;&lt;td&gt;Remembers user preferences&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Generic outputs &lt;/td&gt;&lt;td&gt;Personalized results&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;No conversation continuity &lt;/td&gt;&lt;td&gt;Context-aware conversations&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id=&quot;7-key-takeaways&quot;&gt;7. Key Takeaways&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Memory makes AI feel like an assistant, not just a tool&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A simple service layer keeps integrations clean&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Small API details matter more than you think&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;8-shoutout&quot;&gt;8. Shoutout&lt;/h3&gt;
&lt;p&gt;I learned more about &lt;strong&gt;Backboard.io&lt;/strong&gt; during the ongoing &lt;strong&gt;MLH Global Hack Week: API Week 2026&lt;/strong&gt;, a week-long online hackathon by &lt;strong&gt;Major League Hacking (MLH)&lt;/strong&gt; focused on APIs, building, and learning through live sessions and community challenges.&lt;/p&gt;
&lt;p&gt;Big shoutout to the MLH community and organizers for creating an environment where developers can explore tools like this while building real-world projects and learning by doing.&lt;/p&gt;
&lt;h3 id=&quot;9-final-thoughts&quot;&gt;9. Final Thoughts&lt;/h3&gt;
&lt;p&gt;This integration changed my system from something that generates results into something that understands users over time.&lt;/p&gt;
&lt;p&gt;If you’re building AI applications, adding memory is one of the most impactful upgrades you can make.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/14786/how-backboard-io-transformed-my-multi-agent-ai-system</guid>
<pubDate>Tue, 14 Apr 2026 12:56:36 +0000</pubDate>
</item>
</channel>
</rss>