Skip to main content
Fetch Many Entities
Requires the entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.
Returns a paginated list of entities for the project. Supports rich filtering by source, space, user, keywords, metadata, title, content, location, and time. Excludes drafts — use Fetch Drafts for those.

Query Parameters

Acting user

string
Service key only: the user to list as. The page is exactly what that user’s own access token would get — followedOnly and blockedFilter for them, their own removed entities when userId names them, saved, their own reactions and the top comments they may see — and the reads count as their views. Leave it out for the anonymous view (no follow or block filtering; the reads don’t count as views). This is the viewer, not the author filter: that is userId. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 entity/acting-user-not-allowed).

Pagination

number
default:"1"
Page number (1-indexed). A whole number of at least 1 — 0, a negative number or a non-integer value returns 400 entity/invalid-query.
number
default:"10"
Number of entities per page. A whole number of at least 1 — 0, a negative number or a non-integer value returns 400 entity/invalid-query. Maximum 100 — larger values are treated as 100.

Sorting

string
default:"createdAt"
Sort algorithm. One of:
  • createdAt — chronological by creation time (honors sortDir; newest first by default)
  • top — by reaction count (use sortByReaction to specify which type)
  • hot — by computed engagement score (decays over time)
  • controversial — high total votes with a close up/down split (entities with no votes sort last)
  • metadata.<property> — sort by a metadata field (e.g. metadata.memberCount)
string
default:"desc"
Sort direction, "asc" or "desc" (either case). Not accepted with "hot" or "controversial", which rank one way only (most first): sending it returns 400 entity/invalid-query.
string
default:"auto"
When using sortBy=metadata.*, the type of the metadata field. One of auto, numeric, text, boolean, timestamp. auto infers the type at query time.
string
default:"upvote"
When sortBy=top, which reaction type to rank by. One of upvote, downvote, like, love, wow, sad, angry, funny. Only accepted with sortBy=top; sending it with any other sort returns 400 entity/invalid-query.

Filtering

string
Restrict to entities created within the last period. One of hour, day, week, month, year.
string
Only entities with this exact sourceId. none returns entities with no source. Left out, or sent empty, entities from any source (or none) are returned. null and undefined are refused with 400 entity/unsupported-param (see Saying “no value”).
string
Only entities in this space. none returns entities in no space. Left out, or sent empty, entities in any space or in none are returned. null and undefined are refused with 400 entity/unsupported-param (see Saying “no value”).
string
Filter by author: returns only entities whose userId is this user. Not the viewer: a service key names the viewer in actingUserId. When this matches the viewer (the signed-in user, or the user named in actingUserId), moderation-removed entities are also included (an author can see their own removed entities).
string
When "true", only returns entities from users the viewer follows. Needs a viewer: the signed-in user, or the user a service key names in actingUserId; without one it has no effect.
string
default:"exclude"
Controls how entities authored by users the viewer is block-edged with are treated. "exclude" (default) hides those entities. "include-outbound-blocked" re-includes entities authored only by users the viewer themselves blocked (their own “view anyway” choice); it never surfaces content from users who blocked the viewer. Counts reflect what the viewer sees (computed post-filter). Has no effect when the moderation bundle is not installed.
object
Filter by keywords. Pass as a JSON string or bracket-notation query params:
object
Filter by title content:
  • hasTitle: "true" or "false" — filter for presence/absence of a title
  • includes: substring(s) to match (case-insensitive)
  • doesNotInclude: substring(s) to exclude
object
Filter by content text. Same structure as titleFilters (hasContent, includes, doesNotInclude).
object
Filter by attachment presence:
object
Filter to entities within a radius of a point:
radius is in meters: a number greater than 0 and at most 20000000 (20,000 km, about half the Earth’s circumference, which reaches any point). A value outside that range, or one that isn’t a finite number (Infinity, 1e999), returns 400 entity/invalid-query.
object
Filter by metadata values. Supports complex conditions:
  • includes — all key/value pairs must match (AND)
  • includesAny — at least one object must match (OR)
  • doesNotInclude — none of these key/value pairs may match
  • exists — keys that must be present
  • doesNotExist — keys that must be absent
Keys and values can’t contain a NUL character (\u0000), which metadata can never hold; one anywhere in metadataFilters returns 400 entity/invalid-query.

Optional Associations

string
Associations to include in each entity. Pass it as one comma-separated value (include=user,space) or as repeated params (include=user&include=space). Values:
  • user — the author’s user profile
  • space — the space the entity belongs to (null when the viewer can’t see that space; see Space visibility)
  • topComments — the entity’s best top-level comments, as full Comment objects (see Top comments)
  • saved — whether the authenticated user has saved this entity
  • files — uploaded file/image attachments
  • grants — the reputation-grant summary for the entity
number
default:"1"
With include=topComments: how many top comments per entity. A whole number of at least 1 — 0, a negative number or a non-integer value returns 400 entity/invalid-query. Maximum 5 — larger values are treated as 5.
string
default:"upvote"
With include=topComments: the reaction whose raw count ranks the top comments (ties newest first). One of upvote, downvote, like, love, wow, sad, angry, funny.
include values are case-insensitive. An unknown value returns 400 entity/invalid-query, as does sending topCommentsLimit or topCommentsSortByReaction without include=topComments. topComments lists real content only — deleted, removed and block-edged comments are left out — and is [] when nothing qualifies.

Space-scoped reputation

This endpoint has a space in context, so it accepts the opt-in reputation params. They add a spaceReputation field to each populated author user, alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model for the full contract.

Response

Returns a paginated response object:
Each item in data is an Entity object. File URLs are signed and ready to use.
Viewing scores (hot sort) are updated asynchronously after each fetch. Scores decay at a rate set per project (feed decay). Entities with equal scores are ordered newest first.

Error Responses

sortBy=new is rejected with a pointer to its replacement, sortBy=createdAt.
null or undefined as the value of sourceId, spaceId or spaceReputationId. The error names the spelling to use instead; for spaceId it reads Use `spaceId=none` for entities in no space, or leave it out for any space.
Returned when page or limit is below 1 or not a whole number, when locationFilters.radius isn’t a number greater than 0 and at most 20000000, or when metadataFilters contains a NUL character. error starts with the field name.
Returned with code entity/invalid-query for an unknown include value, when topCommentsLimit is below 1 or not a whole number, or when topCommentsLimit / topCommentsSortByReaction is sent without include=topComments.
include=topComment is rejected with a pointer to its replacement.
A user token, or a request with no credentials, sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.

See Also