Lecture 05 What Are APIs
Lecture 05 What Are APIs
Function Function
Endpoint Subscription Key Endpoint
Subscription Key
Purpose of API Call
• API allows different software applications to communicate and share
data, enabling them to work together.
Endpoint:
An endpoint is a dedicated Uniform Resource Locator (URL) that points to the location of a
resource on a server.
API key:
A unique passcode containing letters and numbers that grants access to an API. These keys
often authenticate an application or identify an authorized user.
API request:
API request is a message sent to an application asking a server for information or a service.
API Call -- Format
HTTP Method
GET
https://socialmedia.com/v1beta/GetComments?User=UserId&apikey=AIzaSyB14KbVfFYxUwoF0U6
OpcenAJY-i5JVOKE
POST
https://sociamedia.com/v1beta/SubmitComment?User=UserId&apikey=AIzaSyB14KbVfFYxUwoF0U
6OpcenAJY-i5JVOKE
{“Comment”:”This looks excellent.”, Request Body
“rating” : “5/5”
}
Client - API Server communication
3
API Key with Request
4 Resource granted
Web Application & API
Web Application:
An online shopping website where users browse, select, and
purchase products. For example, Amazon
Advantages:
• Reduced Development Time: Instead of building AI models from the ground up,
developers can leverage pre-trained models and algorithms through APIs, significantly
reducing development time and effort.
• Reduced costs: By leveraging pre-built models and algorithms, developers can reduce
development costs.
Difference between web application & API
Examples of AI APIs
•OpenAI API:
Provides access to powerful language models for tasks like text generation, translation, and
code generation.
•IBM Watson: An AI platform that helps developers create intelligent apps with natural
language understanding and big data analysis capabilities.