I want to write a simple Lemmy Command line client that posts to a community.
There is https://join-lemmy.org/api/interfaces/CreatePost.html but it expects a community ID community_id
, I would have expected that I can get the community ID by community name / or URL but GetCommunity
does not seem to offer this https://join-lemmy.org/api/interfaces/GetCommunity.html#id
Any ideas?
You must log in or register to comment.
I haven’t tried any of the API stuff, but I just took a look through the source for this Python library: https://github.com/db0/pythorhead/
It looks like they’re getting the community ID in the
discover_community
function by hitting this endpoint:/api/v3/community?name=<community_name>
And then getting
["community_view"]["community"]["id"]
from the returned JSON.