An API (Application Programming Interface) is an interface; a set of methods you use to interact with an object or set of objects to do something. Example: OpenGL, for 3D graphics.
A Framework is a step up; it's not only a set of APIs, but a way to think about and solve problems. Example: SFML, for media. It gives you graphics but also input handling and other auxiliary APIs.
A Game Engine is more specialized than a framework; it's a framework very specifically targeted to make games, and usually only games of some kind. It usually includes a lot of authoring tools around it, like model editors or importers, etc. Example: Unreal Engine. Lets you make 3D shooters. While you can use SFML to make a 3D shooter, you can also use it to make a video player. With Unreal Engine you make 3D shooters.
An IDE is unrelated to all these. It means Integrated Development Environment, and it's a step up from a plain text editor. It produces source code files which are text files, but in general it has some sort of integration with the compiler, offers wizards to automate parts of writing the code, and so on. Example: Visual Studio, Eclipse.
About "coding your game", unless you're experienced, I'd start with a Game Engine. You can write code to customize how it works and what it does, but it will save you a lot of work towards "your first game". Later you may want try writing your own Game Engine, maybe building on top of a Framework. And if you really like it, you can build your own Framework based on system-level APIs (OpenGL, Direct3D). It can be incredibly rewarding and a great learning experience. FWIW, I was quite experienced as a programmer when I started my Game Engine, but I built it on top of SDL; later I replaced the SDL layer with my own Framework.