This is a good analogy but the description is really one of a REST API. An API in general can take a form other than one or more endpoints. An API is a means of consuming a program that is not a GUI or CLI but that needs to be accessed through code. Basic front-end development is wrapping code that consumes an API in a GUI. There are dozens of Javascript APIs built into browsers for code that runs locally.<p><a href="https://developer.mozilla.org/en-US/docs/Web/API" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API</a>
I usually start with saying that an Application <i>User</i> Interface describes how a user (i.e. person) uses the website to get information while an Application <i>Programming</i> Interface describes how another program get information from an application.
If you want to make APIs simpler, a project we have on the backburner is to start getting adoption for folks to offer Tree Notation apis.<p>In the 2000's APIs were in XML/SOAP/WSDL and were a total pain. JSON changed all that.<p>In the 2020's Tree Notation is going to do something similar.<p>Here's the idea from 2014: <a href="https://www.youtube.com/watch?v=DV4Nv23bBwQ" rel="nofollow">https://www.youtube.com/watch?v=DV4Nv23bBwQ</a> (Tree Notation was called "Space" back then)<p>Here's the current Tree Notation project: <a href="http://treenotation.org/" rel="nofollow">http://treenotation.org/</a>
With the same analogy, UI is probably the dog trainer who knows all the commands that the dog understands. You tell the trainer what you want the dog to do and trainer issues the right command.