# Lemmy API

> Returns Lemmy communities, posts, comments and server feeds with counts and sort options.

Category: Social & Video. Region: global. 14 endpoints at `https://api.hoshime.com/v1/lemmy/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/lemmy
## GET /v1/lemmy/community

A community by its name, name@server or community URL, with its counts.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `community` | string | yes | Community name such as asklemmy, name@server, or a URL such as https://lemmy.world/c/asklemmy. (e.g. technology) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `actorId` (string), `banner` (string), `comments` (integer (int64)), `createdAt` (string), `description` (string), `icon` (string), `id` (string), `name` (string), `nsfw` (boolean), `posts` (integer (int64)), `subscribers` (integer (int64)), `title` (string), `usersActiveMonth` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/community?community=technology" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/communities

Communities a server knows, or only its own, in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `type` | string | no | All for every community the server knows, Local for its own. (one of All, Local; default All) |
| `sort` | string | no | Sort order of the communities. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default TopMonth) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `actorId` (string), `banner` (string), `comments` (integer (int64)), `createdAt` (string), `description` (string), `icon` (string), `id` (string), `name` (string), `nsfw` (boolean), `posts` (integer (int64)), `subscribers` (integer (int64)), `title` (string), `usersActiveMonth` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/communities" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/posts

Posts of a community in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `community` | string | yes | Community name, name@server, or a community URL such as https://lemmy.world/c/asklemmy. (e.g. technology) |
| `sort` | string | no | Sort order of the posts. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default Hot) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `apId` (string), `author` (string), `body` (string), `commentCount` (integer (int64)), `community` (string), `createdAt` (string), `downvotes` (integer (int64)), `id` (string), `locked` (boolean), `nsfw` (boolean), `score` (integer (int64)), `title` (string), `upvotes` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/posts?community=technology" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/feed

Posts across a server: all communities it knows, or only its own, in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `type` | string | no | All for every community the server knows, Local for its own communities. (one of All, Local; default All) |
| `sort` | string | no | Sort order of the posts. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default Hot) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `apId` (string), `author` (string), `body` (string), `commentCount` (integer (int64)), `community` (string), `createdAt` (string), `downvotes` (integer (int64)), `id` (string), `locked` (boolean), `nsfw` (boolean), `score` (integer (int64)), `title` (string), `upvotes` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/feed" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/post

A post by its id or URL, with its top comments.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id or post URL, such as https://lemmy.world/post/54055841. (e.g. 1) |
| `comments` | integer | no | Top comments to return, 0 to 50. (default 10) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `apId` (string), `author` (string), `body` (string), `commentCount` (integer (int64)), `comments` (Comment[]), `comments[].author` (string), `comments[].content` (string), `comments[].createdAt` (string), `comments[].id` (string), `comments[].parentId` (string), `comments[].postId` (string), `comments[].score` (integer (int64)), `community` (string), `createdAt` (string), `downvotes` (integer (int64)), `id` (string), `locked` (boolean), `nsfw` (boolean), `score` (integer (int64)), `title` (string), `upvotes` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/post?id=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/comments

Recent comments on a server, or in one community, in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 2 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `community` | string | no | Community name, name@server, or a community URL. Omit it for comments in every community. |
| `type` | string | no | All for every community the server knows, Local for its own. (one of All, Local; default All) |
| `sort` | string | no | Sort order of the comments. (one of Hot, Top, New, Old, Controversial; default New) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `content` (string), `createdAt` (string), `id` (string), `parentId` (string), `postId` (string), `score` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/comments?instance=lemmy.world" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/comment

One comment by its id, or comment URL, with the post it belongs to.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Comment id or comment URL, such as https://lemmy.world/comment/26725501. (e.g. 1) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.world) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `content` (string), `createdAt` (string), `id` (string), `parentId` (string), `postId` (string), `score` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/comment?id=1&instance=lemmy.world" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/user

Profile and post and comment counts of one account on a server.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, name@server, or a profile URL such as https://lemmy.ml/u/nutomic. (e.g. Nutomic) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.ml) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `actorId` (string), `avatar` (string), `banned` (boolean), `bio` (string), `bot` (boolean), `commentCount` (integer (int64)), `createdAt` (string), `displayName` (string), `id` (string), `name` (string), `postCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/user?username=Nutomic&instance=lemmy.ml" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/userPosts

Posts one Lemmy account has written on a server, in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, name@server, or a profile URL such as https://lemmy.ml/u/nutomic. (e.g. Nutomic) |
| `sort` | string | no | Sort order of the posts. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default New) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.ml) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `apId` (string), `author` (string), `body` (string), `commentCount` (integer (int64)), `community` (string), `createdAt` (string), `downvotes` (integer (int64)), `id` (string), `locked` (boolean), `nsfw` (boolean), `score` (integer (int64)), `title` (string), `upvotes` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/userPosts?username=Nutomic&instance=lemmy.ml" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/userComments

Comments one Lemmy account has written on a server, in one sort order, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, name@server, or a profile URL such as https://lemmy.ml/u/nutomic. (e.g. Nutomic) |
| `sort` | string | no | Sort order of the comments. (one of Hot, Top, New, Old, Controversial; default New) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.ml) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `content` (string), `createdAt` (string), `id` (string), `parentId` (string), `postId` (string), `score` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/userComments?username=Nutomic&instance=lemmy.ml" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/postComments

The comments of one post, in one sort order, 20 per page, flat with each reply's parent id.

Scope: `social:read` · Units: 1 · Cached: 2 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id or post URL, such as https://lemmy.world/post/54055841. (e.g. 54055841) |
| `sort` | string | no | Sort order of the comments. (one of Hot, Top, New, Old, Controversial; default Top) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `content` (string), `createdAt` (string), `id` (string), `parentId` (string), `postId` (string), `score` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/postComments?id=54055841&instance=lemmy.world" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/instance

A Lemmy server's own profile: its name and description, software version, user, post, comment and community counts, and its admins.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world; e.g. lemmy.ml) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `activeUsersMonth` (integer (int64)), `admins` (string[]), `comments` (integer (int64)), `communities` (integer (int64)), `createdAt` (string), `description` (string), `name` (string), `posts` (integer (int64)), `users` (integer (int64)), `version` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/instance?instance=lemmy.ml" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/searchPosts

Posts that match a search, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms. (e.g. linux) |
| `sort` | string | no | Sort order of the results. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default TopAll) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `apId` (string), `author` (string), `body` (string), `commentCount` (integer (int64)), `community` (string), `createdAt` (string), `downvotes` (integer (int64)), `id` (string), `locked` (boolean), `nsfw` (boolean), `score` (integer (int64)), `title` (string), `upvotes` (integer (int64)), `url` (string)

```bash
curl "https://api.hoshime.com/v1/lemmy/searchPosts?query=linux" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/lemmy/searchCommunities

Communities that match a search, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms. (e.g. linux) |
| `sort` | string | no | Sort order of the results. (one of Active, Hot, New, Old, TopHour, TopSixHour, TopTwelveHour, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, Controversial, Scaled; default TopAll) |
| `instance` | string | no | Server hostname, such as lemmy.world. An argument given as a URL names its own server instead. (default lemmy.world) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `actorId` (string), `banner` (string), `comments` (integer (int64)), `createdAt` (string), `description` (string), `icon` (string), `id` (string), `name` (string), `nsfw` (boolean), `posts` (integer (int64)), `subscribers` (integer (int64)), `title` (string), `usersActiveMonth` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/lemmy/searchCommunities?query=linux" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
