# Lemmy API

按关键词、社区或实例时间线读取 Lemmy 帖子，并按社区展开评论层级；保留实例、原帖和作者出处，不承诺完整联邦范围或讨论树。

- Domain: social · 4 data actions
- Canonical page: https://everyinfra.com/lemmy-api
- Failures and empty results never form a final charge.

## Actions

### search — 关键词搜索
- Mode: sync · Price: 100 credits ($1.39 / 千次)
- Required: keyword

- Optional: instance, sort, top_range
- Allowed values: sort (active/hot/most_comments/new/new_comments/top), top_range (all/day/hour/month/ninemonths/sixhour/sixmonths/threemonths/…)

- Returns fields: id, title, body, url, external_url, community, community_url, instance, author_username, author_url, score, upvote_count, downvote_count, comment_count, thumbnail_url, embed_title, is_nsfw, is_locked, is_featured, posted_at, updated_at, platform

### community — 社区资料
- Mode: sync · Price: 100 credits ($1.39 / 千次)
- Required: community

- Optional: instance, sort, top_range
- Allowed values: sort (active/hot/most_comments/new/new_comments/top), top_range (all/day/hour/month/ninemonths/sixhour/sixmonths/threemonths/…)

- Returns fields: id, title, body, url, external_url, community, community_url, instance, author_username, author_url, score, upvote_count, downvote_count, comment_count, thumbnail_url, embed_title, is_nsfw, is_locked, is_featured, posted_at, updated_at, platform

### feed — 信息流
- Mode: sync · Price: 100 credits ($1.39 / 千次)
- Required: —

- Optional: instance, sort, top_range
- Allowed values: sort (active/hot/most_comments/new/new_comments/top), top_range (all/day/hour/month/ninemonths/sixhour/sixmonths/threemonths/…)

- Returns fields: id, title, body, url, external_url, community, community_url, instance, author_username, author_url, score, upvote_count, downvote_count, comment_count, thumbnail_url, embed_title, is_nsfw, is_locked, is_featured, posted_at, updated_at, platform

### comments — 评论
- Mode: sync · Price: 100 credits ($1.39 / 千次)
- Required: community

- Optional: instance, max_comments, sort, top_range
- Allowed values: sort (active/hot/most_comments/new/new_comments/top), top_range (all/day/hour/month/ninemonths/sixhour/sixmonths/threemonths/…)

- Returns fields: id, text, author_username, author_url, score, upvote_count, downvote_count, depth, parent_comment_id, is_deleted, post_url, post_title, community, posted_at, platform

## Also

- Machine catalog (no key): https://everyinfra.com/openapi.json · GET /api/v1/social/catalog
- Agents guide: https://everyinfra.com/agents.md
