Copyright

Application Programming Interface (API): Definition & Example

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: APIs in Java

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:00 Application…
  • 1:21 API Examples
  • 2:01 Mobile/Web Applications
  • 2:48 Lesson Summary
Add to Add to Add to

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Login or Sign up

Timeline
Autoplay
Autoplay

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Martin Gibbs

Martin has 16 years experience in Human Resources Information Systems and has a PhD in Information Technology Management. He is an adjunct professor of computer science and computer programming.

How often have we tried to reinvent the wheel? It is counterproductive to rebuild something that works. APIs (Application Programming Interfaces) are programming tools that we can use without having to reinvent fire. We will define the term and provide a working example.

Application Programming Interface

An Application Programming Interface (API) is a tool set that programmers can use in helping them create software. A good API will have clear and concise commands that a programmer can use and reuse, so they don't have to build everything over again.

Even Windows has a huge set of APIs that you can use in order to work with the user interface. There's no need to completely rebuild forms, commands, or even scroll bars. All of these actions are accessible within various APIs, and can be brought into your program. This also ensures a consistent look and feel among applications, but still allows for unique functionality.

You can find APIs for both standard desktop computers and mobile devices. With the explosion in mobile device usage, like iPhones and Androids, the number of mobile-ready APIs has grown exponentially. Many may seem basic, but are huge for developers who need to quickly develop apps. An example is the Apple (iOS) API that's used to detect touchscreen interactions.

APIs are tools. They allow you as a programmer to deliver solid solutions fairly rapidly. If you have to rebuild everything from scratch every time, your solutions will be cumbersome. And they probably won't work! If there's an API for your particular need, use it!

API Examples

As you continue learning programming, and specific languages in particular, you'll interact frequently with APIs. The Java programming language is loaded with APIs that you can use. In fact, many functions are nested within APIs and it's up to you to import them into your code.

For example, if you're dealing with dates, you'll need to import the Java API for dates, like the kind you can see below.


API Java date Util


You'll notice we used the keyword import, followed by the name of the API. Java uses the import.

Now we can create a new date object and perform some action with that. Without having imported the API, the following code wouldn't work.


APIs java date object


To unlock this lesson you must be a Study.com Member.
Create your account

Register for a free trial

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Free 5-day trial

Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Create an account to start this course today
Try it free for 5 days!
Create An Account
Support