Lemmy Search API searches a Lemmy instance as JSON and returns a single envelope with posts, communities, users and comments arrays. Filter by type_ to narrow the result. A valid empty result (no matches) is a successful response.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
1 required parameter needed before sending a request.
5 optional filters available.
string
Required
Search query. Example: technology.
coffee shops
string
Optional
Result type filter. One of: All, Posts, Communities, Users, Comments. Defaults to All.
example
string
Optional
Sort order. One of: Active, Hot, New, Old, TopDay, TopWeek, TopMonth, TopYear, TopAll, MostComments, NewComments, TopHour, TopSixHour, TopTwelveHour, TopThreeMonths, TopSixMonths, TopNineMonths, Controversial, Scaled. Defaults to TopMonth.
relevance
integer
Optional
Results per page. Server caps at 50. Defaults to 20.
10
integer
Optional
1-based page number. Defaults to 1.
1
string
Optional
Lemmy instance hostname. Defaults to lemmy.world. The hostname must resolve to a public address; private, loopback and unresolvable hosts are rejected without charge.
example
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"type": "Posts",
"posts": [
{
"id": 53070436,
"score": 42,
"title": "A technology post title",
"creator": {
"id": 3100864,
"name": "EatingPies"
},
"community": {
"id": 2478,
"name": "technology",
"title": "Technology"
},
"published": "2026-10-10T14:30:00.000000Z",
"comments_count": 167
}
],
"users": [],
"comments": [],
"has_more": true,
"communities": []
},
"meta": {
"billable": true,
"endpoint_family": "search"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
The q parameter is missing or a parameter value is invalid. This response is not billable.
{
"errors": {
"q": [
"The q field is required."
]
},
"message": "The request validation failed"
}Invalid Parameter
Lemmy rejected one or more parameter values (for example an unknown sort). This response is not billable.
{
"error": {
"code": "INVALID_PARAMETER",
"message": "The Lemmy API is temporarily unavailable. Please retry."
},
"success": false
}Upstream Unavailable
The Lemmy API is temporarily unavailable. This response is not billable.
{
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "The Lemmy API is temporarily unavailable. Please retry."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.