The API docs on join-lemmy.org are actually JavaScript SDK docs, not API docs. I want to build an API client in a different language, not write a JavaScript thing using the SDK, and would prefer not to plumb the JS SDK code to understand the API.

Is there somewhere that has a language-agnostic description of Lemmy’s APIs?

  • DessalinesA
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    3 years ago

    The HTTP docs are what you want: https://join-lemmy.org/api/classes/LemmyHttp.html#getPost

    It tells you the full input and output types, and if you click the defined in link, it shows you the endpoint you can use for curl.

    Example from above:

    return this.wrapper(HttpType.Get, '/post', form);

    We do it this way because the lemmy-js-client exactly matches what you need to build a client, and is completely auto-generated. Before we used to manually maintain other API docs, and it was a huge hassle to keep them updated.