API = Application Program Interface
That describes any documented way to use or control a program, system, library, service, framework, etc. from an application program. A web service might have an API, but the API part is just how you go about using that service from programs you write. The service might also have a user interface (UI), which is how a human would use that service directly, without writing code.
An API normally involves some sort of code, in the form of a library of classes, functions, macros, includable source code definitions, etc. to help develop application programs; but not always. Small computer operating systems like CP/M and PC/MS-DOS had assembly language APIs that were strictly documentation on how to code system calls and interpret the results.
(Yes, once upon a time programmers did write application programs in assembly!)