this post was submitted on 28 Nov 2021
24 points (100.0% liked)

Lemmy

12468 readers
1 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] masterofballs@wolfballs.com 1 points 2 years ago (5 children)

Docs are pretty bad, let me give you a start,

To get the first page of post of a community,


curl "https://lemmy.ml/api/v3/post/list?community_name=lemmy&limit=2&page=1"

You can paste that json object in a formater somewhere to get an idea of the shape of the data.

To find the other endpoints ignore the javascript docs. They are to hard to read.

Look at, the api_routes file. https://github.com/LemmyNet/lemmy/blob/main/src/api_routes.rs

Now you should be able to put two and two together to get the whole picture.

[–] dessalines@lemmy.ml 1 points 2 years ago (4 children)

How are the docs bad? They exactly match what we are using.

[–] masterofballs@wolfballs.com 1 points 2 years ago

Forgive me for being to dumb; it just doesn’t seem as clear as something like swagger

You link to some Java script instead of full path ways.

Listing a few curl examples would go a long way to making the api more understandable IMO.

But maybe I’m just to dumb to understand.

load more comments (3 replies)
load more comments (3 replies)