API – Definition
An API (Application Programming Interface) is a set of rules and protocols that enable communication between different computer programs or components of a computer system. An API defines how different pieces of software can interact with each other, allowing one application to use the features or services provided by another application or system.
In short, an API acts as a communication interface that allows programs to exchange data and requests, enabling integration between different systems, applications, or services. An API can be public or private, depending on whether it is publicly available to all users or restricted and available only to specific applications or users.
What is the API for?
Application integration
APIs enable the integration of different applications, enabling them to exchange data and communicate. This allows applications to collaborate and leverage features or services provided by other applications, leading to increased efficiency and functionality.
Extending functionality
APIs allow developers to extend the functionality of their applications by leveraging services and features provided by other platforms or services. For example, an e-commerce application might leverage a payment API to allow customers to pay by credit card.
Creating cross-platform software
APIs enable the creation of software that runs across platforms and operating systems. This allows developers to create applications that are compatible with various devices and environments.
Task automation
APIs allow for the automation of many tasks through programmatic interaction between applications. For example, social media APIs enable automatic content publishing across various social media platforms or the analysis of user engagement data.
Creating web services
APIs enable the creation of web services that are accessible to other applications over the network. For example, online payment services, mapping services, data processing services, and so on.
Mobile application development
APIs are also widely used to create mobile applications that take advantage of features and services available in the cloud or on remote servers. For example, mobile applications can use APIs for geolocation, mobile payments, or communication with social media.
Types of API
There are many different types of APIs, which can be classified in various ways. Here are some of the most common categories:
1. By architectural style:
- REST API (Representational State Transfer): A popular type of API that uses JSON or XML to transfer data and relies on stateless resources. Communication occurs using standard HTTP methods (GET, POST, PUT, DELETE).
- SOAP API (Simple Object Access Protocol): This is an older type of API that uses XML to transfer data and relies on the exchange of SOAP messages. Communication is more complex than with REST APIs.
- RPC (Remote Procedure Call) API: A type of API that allows remote procedures to be called on another server. Communication is typically performed using a binary protocol.
2. Due to the method of sharing:
- Public APIs: Available to any developer who wants to use them. They are usually free and only require account registration.
- Private APIs: Available only to authorized users, such as company employees or business partners. May be paid or provided through licensing.
- Internal APIs: Used within an organization to connect different systems and applications. They are not accessible to external users.
3. Due to the application:
- Business APIs: Provide access to data and functions related to running a business, e.g. customer management, orders, payments.
- Social APIs: Enable integration with social platforms such as Facebook, Twitter, LinkedIn.
- Maps and Navigation APIs: Provide access to maps, traffic data, and navigation features.
- Payment APIs: Enable integration with payment gateways and billing systems.
- Weather APIs: Allow access to weather data from various sources.
4. Other types of API:
- RESTful API: A subtype of REST API that strictly follows REST principles.
- Microservice API: Used in a microservice architecture to communicate between small, independent services.
- Cloud-based APIs: Accessible through a cloud platform such as Amazon Web Services (AWS) or Microsoft Azure.
Examples of API use in eCommerce
- Online stores: APIs enable the integration of stores with payment systems, warehouses, couriers, price comparison sites and social media platforms.
- Marketplace Platforms: APIs enable sellers to offer their products on multiple platforms simultaneously, and enable buyers to easily compare prices and offers.
- Product Recommendation Systems: APIs enable stores to integrate with product recommendation systems that use purchase and browsing data to suggest products that may be of interest to users.
API in Shopify and Shopify Plus
Types of Shopify APIs:
-
Admin API:
- It is used to manage store data such as products, customers, orders and financial data.
- Available in Shopify REST API and GraphQL versions.
- Requires authentication via store access.
-
Storefront API:
- Allows you to build custom store interfaces (headless commerce).
- Available in GraphQL version.
- Public – no authentication required, but some features require appropriate store permissions.
-
Order Discount API, Product Discount API, Shipping Discount API:
- Newer API for managing discounts and promotions in the store.
- Available in GraphQL version.
- Requires authentication via store access.
-
API Partner:
- Allows Shopify Partners to access data from their customers using the platform.
- Requires authentication with your partner account.