What exactly is the meaning of an API?
Searches should include Wikipedia, which is surprisingly good for a number of programming concepts/terms such as Application Programming Interface:
What is an API?
An application programming interface (API) is a particular set of rules ('code') and specifications that software programs can follow to communicate with each other. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers.
How is it used?
The same way any set of rules are used.
When and where is it used?
Depends upon realm and API, naturally. Consider these:
- The x86 (IA-32) Instruction Set (very useful ;-)
- A BIOS interrupt call
- OpenGL which is often exposed as a C library
- Core Windows system calls: WinAPI
- The Classes and Methods in Ruby's core library
- The Document Object Model exposed by browsers to JavaScript
- Web services, such as those provided by Facebook's Graph API
- An implementation of a protocol such as JNI in Java
Happy coding.
1) What is an API?
API is a contract. A promise to perform described services when asked in specific ways.
2) How is it used?
According to the rules specified in the contract. The whole point of an API is to define how it's used.
3) When and where is it used?
It's used when 2 or more separate systems need to work together to achieve something they can't do alone.
Well, in addition to all the answers, I am just adding an example.
As others said API stands for Application Programming Interface
through which softwares can interact with each other
. Note, not a human interaction.
Where it is used
An example: You are buying an item online through your credit card. You will provide credit card details and press 'continue' button. It will tell you whether your information is correct or not. To provide these results, there are lot of things in the background.
The application will send your credit card details to a remote application which will validate your information and send the result back to your application. API is used in this scenario.
I hope it helps for the beginners who don't understand really what API is.
ANOTHER EXAMPLE
Weather application
Without API - Weather application must open weather.com site and read the details as a human does.
With API - Weather application will send a message to weather.com and receive the result and then display it.
SOURCE - Various online resources
An API is the interface through which you access someone elses code or through which someone else's code accesses yours. In effect the public methods and properties.