What is API & How to learn API fundamentals ; which is a must for DL practitioners and ML engineers?

Hii , I am a beginner in programming and ML engineering.
I want to understand API ( relevant to ML engineering / deep learning / software engineering)

  • What is API and its fundamentals ?
  • What are the best ways to understand API , so its easier to use them and also write APIs (relevant to ML engineering, DL practitioner) ?
  • What are the best resources (for the above) ?

additional context ::
Proff. Zach Mueller once shared an API design course syllabus here (Discord).

Hi Saurav
An Application Programming Interface is a computer program written by somebody else. You pass it information and it returns information as described by the creater. In computer sciences we have functions, subroutines and API but they are all the same. Nowadays API normally cross the Internet to retrieve the information. They are not specific to ML or DL. To write an API you need to define what is passed to the API, how the data is process and what is returned. A good example might be a web request such as URL + GET which return some information. So you could send GET 1 2 and it returns 3 because you used the ADD API. You can add complexity but essence it is a magic box with a description and specification for the input and the output.
So for example you might have an API with security.
1 Get the API public key. Encrypt with the public key your user and password. Send a API bearer request.
2 Using the bearer request issue a request for information and then process the returned information.

The information in and out is often presented as JSON formatted data.

So the one-line is a magic box with specifed inputs and outputs.

A good example is retrieving data from your google drive or google translate speech to text.

Regards Conwyn

1 Like

APIs are everywhere in software development - when you interact with services, even SDKs, libraries, other components locally, you use the interface provided by the creators’ of that software.

An API in Python, like fast.ai’s, provides a simplified way to access complex functionalities, enabling developers to use advanced features with minimal code.

Web APIs allow applications to communicate over the internet using standard protocols like HTTP, which occurs with nearly every interaction on websites.

1 Like

Hi Saurav,
Pardon me if I am wrong, but I am making some assumptions about what you are likely to (not/) know.
I’d strongly recommend you to get at least an introduction to web application development.

Go through Django Getting Started

Learn some Django, just as an example, and also because you already know Python, I assume. You will learn about a bunch of useful things. One of which would be about APIs. Trust me, it would be time well spent.

1 Like

Thankyou for the recommendation.
I have a doubt -

  • Is web api the only way to understand APIs ?
  • Is there a way+tips to understand APIs (fundamentally+practically) solely using libraries like fastai, pytorch and doing DL and projects ?

Well, it sure is possible to understand APIs without learning web application development in depth. Think of it as a function call across the internet. You send a request with some parameters and you get a response back with the answer. If I remember right, Video 2 of the current fast.ai course explains how to convert your DL model into an API using a tool called gradio.

However like I said, I strongly recommend that you at least quickly go through that suggested tutorial. You will learn several very useful fundamental concepts, which include APIs.

1 Like

Hi Saurav
API stands for Application Program Interface. It allows application programs (the ones ordinary people write) to request information by passing information in a specified way and returns information in a specified way. The processing of the API can be on your own computer, a near by server or a server connected over the Internet. Often Internet based solutions use http protocols. The only tip is to read the documentation for the API so you know how to pass the information and what you will receive.

API is a word used as if they are magical but it is just a chunk of code written by somebody but used by many people to save them writing the code themselves.

Regards Conwyn

1 Like