Web API

Before focus on web API, First we need to understand API. API is standards for Application Programing Interface. In technical terms an Application Programming Interface (API) is a set of subroutine definitions, protocols, and tools for building software and applications.

To put it in simple terms, API is some kind of interface which has a set of functions that allow programmers to access specific features or data of an application, operating system or other services.

Web API as the name suggests, is an API over the web which can be accessed using HTTP protocol. It is a concept and not a technology. It is a framework that helps you to create and develop HTTP based RESTFUL services. We can build Web API using different technologies such as Java, .NET etc. A Web API is an application programming interface for either a web server or a web browser.

It is limited to Web Application’s client-side and also it does not include a web server or web browser details. If an application is to be used on a distributed system and to provide services on different devices like laptops, mobiles, etc. Then web API services are used. Web API is the enhanced form of the web application.

2. Why we use web APIs?

Nowadays, a web-based application is not enough to reach the customers. People are very smart and they are using smart phones, tablets, laptops etc. These devices also consist a lot of applications for making their life easy. Now, we are moving from the web towards apps world. So, if you like to expose your service data to the browsers and as well as all these modern devices apps in fast and simple way, you should have an API which is compatible with browsers and all these devices.

Web API is the great framework for exposing your data and service to different types of devices. Moreover Web API is open source an ideal platform for building REST-ful services. Unlike WCF Rest service, it use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats) and you don’t need to define any extra config settings for different devices unlike WCF Rest service.

Following are some points of Web APIs

  1. Used to build simple, non-SOAP-based HTTP Services on top of existing WCF message pipeline.
  2. A Web API services are preferable over other services to use with a native application that does not support SOAP but require web services
  3. Responses have an Accept header and HTTP status code.
  4. Easy configuration unlike WCF REST service.
  5. For creating resource-oriented services, the web API services are the best to choose. By using HTTP or restful service, these services are established.
  6. Supports multiple text formats like XML, JSON etc. or you can use your custom Media Type Formatter.
  7. Simple service creation with Web API. With WCF REST Services, service creation is difficult.
  8. If you want good performance and fast development of services, the web API services are very helpful.
  9. May accepts and generates the content which may not be object oriented like images, PDF files etc.
  10. Based on HTTP and so easy to define, expose and consume in a REST-ful way.
  11. For developing light weighted and maintainable web services, web API services are really helpful to develop that service. It supports any text pattern like JSON, XML etc.
  12. Automatic support for OData. Hence by placing the new [Queryable] attribute on a controller method that returns IQueryable, clients can use the method for OData query composition.
  13. Supports Self-hosting or IIS Hosting.
  14. If you need a Web Service and don’t need SOAP, then ASP.NET Web API is best choice.
  15. Based on light weight RESTful architecture and good for devices which have limited bandwidth like smart phones.
  16. The devices that have tight bandwidth or having a limitation in bandwidth, then the Web API services are the best for those devices.
  17. Open Source.

3. Examples for web APIs.

  1. YouTube API’s: Google’s API lets developers integrate YouTube and functionality into websites or applications. YouTube APIs include the YouTube analytics API, YouTube Data API, YouTube live streaming API, YouTube Player APIs and others.
  2. Weather APIs: Access current weather data for any location including over 200,000 cities
  3. Cricket Score APIs: Cricket Live Scores API provides invaluable data to develop cricket related apps. The API accepts GET calls and returns JSON formatted content. Cricket Live Scores API is able to deliver a list of available matches as well as cricket scores, cricket scorecards, Test scores, ODI scores, T20 scores, BBL scores, IPL scores, World Cup scores.
  4. The Flickr APIs: It is used by developers to access the Flick photo sharing community data.
  5. Twitter APIs: Twitter offers two APIs, the REST API allows developers to access core Twitter data and the search API provides methods for developers to interact with twitter search and trends data.

4. Limitations of web APIs.

REST, as a system in itself, is very predictable regarding endpoints and the content of the requests, being just an HTTP request. It is supposed that end-users can easily guess how to fulfill their aim as long as the URL structure of the site is familiar to them, which can be interpreted as a breach within the security system. This is considered one of the first drawbacks/limitations of RESTful APIs, but we will get to this in a minute.

Regarding performance, it is considered that SOAP is more advanced in this regard, making good use of event-based parsing, which adds to the scalability of SOAP stacks that use normal HTTP processing along the XML parsing, while REST uses the HTTP processing method alone.

There are a few limitations when working with APIs in Shortcuts:

  • Various endpoints: APIs often have a variety of endpoints that you can use to request different types of data. Working with some APIs may require a series of API calls, first to retrieve current existing data, and then later to add, update, or delete more data.
  • Rate limiting: Many APIs have limitations on how often you can make requests. These restrictions are aimed at limiting abuse of an API service in case someone makes thousands or millions of requests programmatically. API services can be limited by hour, day, or month, or may require you to pay for API access after exceeding these limits.

Hope you now get the basic idea of web APIs. See you in another topic. Bye..!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

My Journey To HackerU’s Master Certificate in Red Team.

Git & Version Control

No fuss, no ego: Code Reviews done right

Welcome to SQL 3: Building Relations and Combining Data

The Best Security Practices with Hybrid Cloud — Part 1

How Does Garbage Collection Work in Java?

How to create a local airflow pipeline with PySpark, LocalStack S3

How to install MSSQL in Mac

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Paul issack minoltan

Paul issack minoltan

More from Medium

GitHub: Contributing to Someone Else’s Project

A Beginner’s guide to learn about The Git and The GitHub

GIT COMMANDS #part1

Setting Up Git Environment

Git logo with the word git next to it.