Library
The term "Library" refers to a specific way functionality can be packaged for use by the application programmer.
Specifically, in a compiled language like C++, a set of functionality is compiled to object code (i.e., "link-able" .obj files), and made available in an "archive" or "library", which on windows is a .lib file (.lib files essentially contain a bunch of .obj files). The application programmer generally "includes" provided header files which declare functions and types implemented in the library, uses them in code, and links the library into the executable.
The term "library" says nothing about what type of functionality is provided, or what it might be used for.
API
As mentioned, API means "Application Programming Interface". "API" generally refers to a library, but is named for the interface (i.e., the contents of accompanying header files) to which the application code will be written, rather than the implementation in the library.
The phrase, "Application Programming" implies that the functionality provided is specific for creating some certain type of application. The Windows API is used for making Windows applications; The OpenGL ("Open Graphics Library") API is used for making graphical applications; Etc. APIs often deal with how the application interacts with the outside world - how it gets input and/or generates output.
In general, an API is a library but a library is not necessarily an API. The C++ standard library, for example, is mostly functionality for a program's internal processing. It's not designed for giving an application access to, or control over, any specific platform/environment.
Engine
A game engine is a unified set of run-time software technology designed to provide a good portion of the core functionality of a game. The thing that makes it an engine, is its frame-based multi-tasking nature. The thing that makes it a game engine is all the basic functionality it delivers that makes it useful for building games. (OpenGL and Direct 3D are not engines, for example. They provide nothing but a way to get graphics on screen.)
While not technically part of the engine itself, most engines would be useless without a set of accompanying tools for generating content specific to that engine, so a tool-set is sometimes thought of as part of the engine.
The term "engine" says nothing about how the functionality is delivered. It could, for example, be delivered as a set of libraries, or as source code for a sample game "stub". If it's a set of libraries, they could be considered an API for developing applications on that engine.
OpenGL
The "Open Graphics Library" is a cross-platform API for putting graphics on-screen.
Providers of all sorts of different platforms, that have graphics rendering ablilty, can implement the library for their platform. All implementations of the library work with the published OpenGL interface. That way, applications programmers can write applications using that interface, and they'll build and work on various different platforms, without alteration.
Direct X
Direct X is a Microsoft API for developing "multi-media" applications on Microsoft platforms. In addition to Direct 3D (their graphics API), it includes other components like Direct Sound and Direct Input.
SDL & SFML
SDL & SFML are video games APIs.
They provide facilities for such things as audio output, input acquisition, networking, threading, timing, etc. They work with, or along-side, OpenGL.
Unity
I don't really know much about Unity, but in general, any robust game engine will include all of the functionality provided by the graphics and video games APIs, and more (e.g., physics, collision, AI, game objects/entities, message passing, asset handling, load/save, GUI/menus, etc.).