Each local MLS market is different. I'm in Houston, and HAR only offers direct API access for broker accounts. Otherwise you have to use an iframe or simply link to their website. I believe other local MLS policies are more lax. What you're looking for is IDX - that is the standard API among MLS services.
Here are some related links:
As a follow-on to dlynton's post, the actual standard in play here is called RETS (Real Estate Transaction Standard), which can be found at: http://www.rets.org/ There are open source libraries in C++, PHP, Java and others that can help you write applications to integrate with RETS servers. But as noted, you are at the mercy of the regional MLS owner, which is different in every area.
I've seen some services that offer MLS aggregation services so that you can create a nationwide MLS software application, and these typically run about $30-$100 per month for access.
Probably not for your purposes. The data is owned by the REALTORs and is not made public in the form of an API. If you became a REALTOR or were contracted by a REALTOR, you might be able to access the MLS through an API.
If you're still interested, perhaps the best thing to do is contact the local Board of REALTORs in your area. Alternatively, find the most tech-savvy REALTOR in your area and contact them directly. They may know more about the details.