Software Framework:It is a re-usable design for a software system (or subsystem). A software framework may include programs, code libraries, a scripting language, other software to help develop and glue together the different components of a software project. Various parts of the framework maybe exposed through an API.
Microsoft's .Net framework is a very good example of a software framework. It contains compilers, class libraries, an IDE(Visual Studio), and a runtime. Another example is OpenCog: A Software Framework for Integrative Artificial General Intelligence.
API (Application Programming Interface):It is a set of routines( AKA methods or functions), data structures, object classes, and/or protocols provided by libraries and/or operating system services in order to support the building of applications.
Good examples of API are Microsoft TAPI(Telephony API), or MySQL connectivity API, or Google MAPS API.
In Microsoft's .Net Framework, only the Base Class Library or BCL are the API. The framework is a bigger thing. API is a part, framework is a whole. Although, API can exist on its own, without a framework as well.
Well, I think this much is enough to illustrate the difference between Software Framework and API, or Software Framework vs API.
Another example of software platform is pictured below, Google's Android Mobile Platform,
You see this platform contains many things, a kernel for low level tasks, certain libraries for OS level chores, Delvik Virtual Machine (an enriched clone of Java Virtual Machine), and the "Application Framework" on on the "third story". Any software we write for Android smart phones will reside on 4th floor, which is labelled "Applications" here.
Some might search this topic as API vs framework, this blog entry will be equally helpful for those friends as well.