What is API? How it is useful in Web Development ?
Last Updated :
20 Sep, 2019
API stands for Application Programming Interface (main participant of all the interactivity)
It is like a messenger that takes our requests to a system and returns a response back to us via seamless connectivity.
We use APIs in many cases like to get data for a web application or to connect to a remote server that has data like weather that keeps changing or to enable two applications to exchange data among each other.
API not only provide reusability of code but also uses the concept of Abstraction (showing functionality by hiding complexity).
Most common real life use of API concepts include:
- Waiter in a restaurant taking your order request to the chef and bringing back the requested dish
- Switchboard turning off the tubelight just on a single press
- Booking a flight online from sites like MMT(web based)
- Signing up in a shopping site from Facebook Account(web based)
Different APIs will communicate in different ways:
- XML-RCP/SOAP: Both uses XML
- JavaScript: Focused around JavaScript
- RESTful APIs: HTTP protocol (HyperText Transfer Protocol) used (best for web APIs)
APIs' major features in Web Development
APIs can be used for mashups that is information from one site can be mixed with that of another. Authentication is one of the important things to be noted as all APIs are not public. API keys are required in case of authentication for safe use. For example, please refer to
Gmail API Authentication
There are some APIs which do not require any access token.
Example: Github API
https://api.github.com
Output:
{
"current_user_url": "https://api.github.com/user",
"current_user_authorizations_html_url": "https://github.com/settings/connections/applications{/client_id}",
"authorizations_url": "https://api.github.com/authorizations",
"code_search_url": "https://api.github.com/search/code?q={query}{&page, per_page, sort, order}",
"commit_search_url": "https://api.github.com/search/commits?q={query}{&page, per_page, sort, order}",
"emails_url": "https://api.github.com/user/emails",
"emojis_url": "https://api.github.com/emojis",
"events_url": "https://api.github.com/events",
"feeds_url": "https://api.github.com/feeds",
"followers_url": "https://api.github.com/user/followers",
"following_url": "https://api.github.com/user/following{/target}",
"gists_url": "https://api.github.com/gists{/gist_id}",
"hub_url": "https://api.github.com/hub",
"issue_search_url": "https://api.github.com/search/issues?q={query}{&page, per_page, sort, order}",
"issues_url": "https://api.github.com/issues",
"keys_url": "https://api.github.com/user/keys",
"notifications_url": "https://api.github.com/notifications",
"organization_repositories_url": "https://api.github.com/orgs/{org}/repos{?type, page, per_page, sort}",
"organization_url": "https://api.github.com/orgs/{org}",
"public_gists_url": "https://api.github.com/gists/public",
"rate_limit_url": "https://api.github.com/rate_limit",
"repository_url": "https://api.github.com/repos/{owner}/{repo}",
"repository_search_url": "https://api.github.com/search/repositories?q={query}{&page, per_page, sort, order}",
"current_user_repositories_url": "https://api.github.com/user/repos{?type, page, per_page, sort}",
"starred_url": "https://api.github.com/user/starred{/owner}{/repo}",
"starred_gists_url": "https://api.github.com/gists/starred",
"team_url": "https://api.github.com/teams",
"user_url": "https://api.github.com/users/{user}",
"user_organizations_url": "https://api.github.com/user/orgs",
"user_repositories_url": "https://api.github.com/users/{user}/repos{?type, page, per_page, sort}",
"user_search_url": "https://api.github.com/search/users?q={query}{&page, per_page, sort, order}"
}
List in JSON format
- https://api.github.com/feeds
Output:
{
"timeline_url": "https://github.com/timeline",
"user_url": "https://github.com/{user}",
"security_advisories_url": "https://github.com/security-advisories",
"_links": {
"timeline": {
"href": "https://github.com/timeline",
"type": "application/atom+xml"
},
"user": {
"href": "https://github.com/{user}",
"type": "application/atom+xml"
},
"security_advisories": {
"href": "https://github.com/security-advisories",
"type": "application/atom+xml"
}
}
}
- https://api.github.com/rate_limit
{
"resources": {
"core": {
"limit": 60,
"remaining": 56,
"reset": 1567928119
},
"search": {
"limit": 10,
"remaining": 10,
"reset": 1567924666
},
"graphql": {
"limit": 0,
"remaining": 0,
"reset": 1567928206
},
"integration_manifest": {
"limit": 5000,
"remaining": 5000,
"reset": 1567928206
}
},
"rate": {
"limit": 60,
"remaining": 56,
"reset": 1567928119
}
}
Similar Reads
Why Express is used in Web Development?
Express JS is a small web application framework. It become very popular Node JS framework for building robust and scalable application. In this article we will dive into the topic of ExpressJ S. Table of Content What is Express JS?Why Express is used in web development?Steps to create an Express app
3 min read
Top 8 Ways to Use AI in Web Development
Almost 32% of organizations have started using AI, and this proves, that very soon AI will be everywhere. It plays a vital role in almost every possible domain. One of the most prominent uses of AI is in the web development domain. Developers are learning different ways of using AI for web developme
7 min read
AI in Web Development
The web development landscape is undergoing a seismic shift driven by the transformative power of Artificial Intelligence (AI). No longer relegated to science fiction, AI is becoming an indispensable tool, streamlining processes, enhancing user experiences, and pushing the boundaries of what's possi
7 min read
What is Full Stack Development ?
Full Stack Development refers to the development of both front end (client side) and back end (server side) portions of web applications. If you want to learn in full structure form then you should enrol in our Full stack devloper course! You'll learn to create powerful web applications from scratch
6 min read
What is Google Sheets API and How to Use it?
We all are familiar with spreadsheets and worked with them since we first learned about computers. We are used to arranging our data in a tabular manner in the form of rows and columns. When we are working on a project and wish to save our data in a tabular form, we think of relational databases. In
8 min read
Why Express Is Used For Enterprise App Development ?
While building a web application the most important thing is to decide which frameworks and libraries to use for the project that will support for long term and be able to handle all the requests efficiently. In this article, we will see why Express will be one of the best choices for you if you wan
6 min read
What are AJAX applications in web development ?
Web development refers to building, creating, testing, and maintaining websites. It includes aspects such as web design, web publishing, web programming, and database management. It is the creation of an application that works over the internet i.e. websites. A website has two basic systems that are
6 min read
Role of Postman in the API development lifecycle.
Postman is an API(application programming interface) development tool which helps to build, test, and modify APIs. Almost any functionality that could be needed by any developer is provided by this tool. It can make various types of HTTP requests(GET, POST, PUT, PATCH). In this article, we will expl
4 min read
Design First API Development with Swagger
API development plays a crucial role in modern software architecture, enabling different services to communicate with each other seamlessly. One popular approach to API development is the "Design-First" methodology, where the API's design is specified before the actual implementation. Swagger, now k
4 min read
What is Web API and why we use it ?
API stands for Application Programming Interface. API is actually some kind of interface which is having a set of functions. These set of functions will allow programmers to acquire some specific features or the data of an application. Web API is an API as the name suggests, it can be accessed over
5 min read