For Harlowe 1.x and 2.x:
For SugarCube 1.x or 2.x:
You probably shouldn't use v1.x anymore, but the documentation is still around. Here's the v2.x documentation, which details most of the APIs (the second large list of links). The Wikifier API, for whatever reason, is undocumented, but here's its source code. There's a few other parts of SugarCube that are also undocumented.
Why on earth are features undocumented???
I'm not a developer, but here's my guess.
Providing documentation for a given API implies that the developer wants you to use it. They certainly don't care if you use it, but if it's not in the documentation, that gives them greater flexibility in updating their code, since you shouldn't necessarily expect undocumented features to be as well supported in new versions as the documented features. A lot of the undocumented features are also lower-level (meaning they handle more engine-y things, like parsing, in the case of the Wikifier), and at some point there has to be some cutoff for documentation. Besides, in this case, the jQuery wiki() methods are documented, and you should usually be using them in any place you might be considering use the Wikifier.
In the case of Harlowe, it seems to draw this line in the sand as soon as TwineScript stops, hiding and locking down most of its JS to the point that it requires hack-y workarounds to use it's JS APIs.
About that inventory code from the wiki.
That example you found on the wiki should be deleted, in my opinion, as it's not a great example of how to use the SugarCube APIs it uses (no offense to the original author) and we see a lot of poorly written code here that's modeled off it. On top of that, while it will probably work in v2 thanks to a number of compatibility shims present in 2, you're better off using 2's APIs.
If you have specific questions about SugarCube 2's APIs, or want to know more about its undocumented or under-documented features, this Q&A is probably the best place to ask.