Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript jQuery Basics (2014) Introduction to jQuery jQuery Documentation: What Does it Mean?

What is an API?

Andrew introduces jQuery API, and I'm not clear what an API is. Can someone elaborate?

1 Answer

Adam Duffield
Adam Duffield
30,494 Points

API or Application Programming Interface are generally referred to as 3rd party, normally open source libraries than can be used by programmers to apply features or data.

e.g. Google has a Google Maps API that allows developers to use the awesome complexity of google maps and embed a map into a website by including a link to their Javascript files and initializing the map on an element with a few parameters such as your latitude and longitude.

Other API's could include a weather API that allows you to get the weather for a set location, the PayPal API which allows you to authenticate bank details and pass payments through to paypal and many many more.

Hope this helps,

Adam

Christoph Van Hees
Christoph Van Hees
6,094 Points

this is all true. Maybe an addition i would make is : An api lets you communicate with a chunk of code without knowing the abstract level of the code. So for example you don't need to know how Google maps works to interact with it. The api provides a set of helper functions/elements so you can communicate with it without having to learn that.

For JQuery that means you can do things like $(".warning").hide() without having to know everything that is required to make this work.