An example let us say there was a website that had an API to find anyone.
You would connect to the server with your program and send
Code: Select all
GET /search.php?First_Name=John&Last_Name=Doe
you would receive in return
Code: Select all
<xml>
<person>
<name>Doe, John</name>
<street>555 Overlake Hwy</street>
<city_state_zip>Somewhere, ZZ 55555</city_state_zip>
</person>
</xml>
This allows 3rd party applications that can access the web to use the website as their database and since XML is a very strict, it is a lot easier for a computer to parse.
An API for a program is a set of public functions that can interact with the program. Example your calendar program most likely has an API which gives access to a method "post_event" so
Code: Select all
CalendarAPI = new Calendar.APIInterface;
CalendarAPI.post_event("1/22/2007", "8:00pm", "10:00pm", "Tech Talk", "Provo Stake Center");
This would add an event to your calendar on 1/22/2007 from 8 to 10pm that is the techtalk at the Provo Stake Center.
So in short an API is a set of methods that connect to an Application and read/modify it's internal data.