API for Web-development

I have a generic question about web-development. I have learnt the basics of Flask (Python) to build back-end; React (JavaScript), CSS, HTML to build front-end; SQLite for database. I feel comfortable using this toolbox. However, I came across this article about APIs:

My question is: When or where do I need to use an API? I know that APIs have been built as tools to help developers deliver projects at a faster pace. However, the concept of API is fairly new to me and I am not comfortable with using it yet. Should I invest my time learning it, or it does not add that much functuonality?

Any suggestions would be very much appreciated!

2 Likes

First and foremost, what is an API? API means: application programming interface.

This means someone wrote an interface that we can access programmatically.

Take Twitter (one of the APIs mentioned in your article). Twitter sits on a lot of data (tweets). And say you want to build a website for a company. And this company (let’s call this company XYZ) also has a Twitter account, and XYZ also wants their tweets to show on the website you are making.

You could use something called a scraper, which literally goes to the Twitter website and scrapes the information from the website. In which case, you use the web interface. This is not very efficient.

Thankfully, Twitter also offers an API. We can make a request directly to the API (using python for example), and then display this on our website.

Utilizing an API is a lot more efficient than scraping. Scraping means shifting through all the bloated data (including HTML & CSS which we don’t need).

Hope this clarifies a bit what an API is, and when or where you would need one.

Just learn an API when you need one, maybe you get a project where you want something with maps. A good time to learn the google maps API.

Maybe someday you will write your own API :slight_smile: You make a service other people want to integrate into their website/program. Then writing an API is a good idea. Reduces server loads and more.

Hope this helps :slight_smile:

5 Likes

Thank you very much! Your answer did clarify a lot!