Skip to main content

Search

Description

Searches DayKeeper content for posts, users, events, or tasks. The backend normalizes the requested type, applies optional filters, and returns paginated results.

Request Parameters

Requires Authentication: true

Send a valid bearer token in the Authorization header.

QUERY PARAMS

NameTypeRequiredDescription
qstringNoSearch text. If omitted, the endpoint still runs and returns paginated results from the chosen type.
typestringNoPost, User, Event, or Task. Default is Post.
orderstringNorelevant or recent. Default is relevant.
followingstringNoFor Post and User searches only. Use following or friends.
filterstringNoFor Event: upcoming, past, ongoing. For Task: upcoming or past.
pagenumberNoPage number. Defaults to 1.
maxPageSizenumberNoNumber of results returned per page. Maximum is 20.

Usage Example

JavaScript with axios:

const response = await axios.get("https://api.daykeeper.app/search", {
headers: {
Authorization: `Bearer ${accessToken}`,
},
params: {
q: "luciano",
type: "User",
order: "relevant",
page: 1,
},
})

Search Behavior

  • type=Post searches post date, post content, and the post author's username.
  • type=User searches username and displayName.
  • type=Event and type=Task support the filter query param for time-based filtering.
  • following=following returns only accounts or posts from users the authenticated user follows.
  • following=friends returns only mutual follow relationships.

Success Response

NameTypeDescription
dataarraySearch results for the current page
pagenumberCurrent page number
pageSizenumberNumber of results returned in the current page
maxPageSizenumberMaximum number of results allowed per page
totalPagesnumberTotal available pages
totalCountnumberTotal number of records that match the current request

Example

{
"data": [
{
"_id": "6632d8575e64a71b55427a8d",
"username": "Luciano655",
"displayName": "Luciano",
"bio": "my bio here",
"private": false,
"followers": 12,
"following": 8
},
{
"_id": "65cbaab84b9d1cce41e98b60",
"username": "Luciano",
"displayName": "Luciano Menezes",
"bio": "Essa é a minha bio",
"private": false,
"followers": 4,
"following": 6
}
],
"page": 1,
"pageSize": 2,
"maxPageSize": 20,
"totalPages": 1,
"totalCount": 2
}

Error Response

CodeDescription
401Missing, invalid, or expired token
500Server error

Example

{
"message": "Missing access token"
}