Skip to content

Post List

  • Endpoint Path: /api/v2/post/list
  • Method: GET
  • Request: Query

Headers Optional Parameter

Parameter NamePublic Mode (Required)Private Mode (Required)
X-Fresns-Aidoptionalrequired
X-Fresns-Aid-Tokenoptionalrequired
X-Fresns-Uidoptionalrequired
X-Fresns-Uid-Tokenoptionalrequired

Query Params

Parameter NameTypeRequiredDescription
mapIdNumberoptionalMap Service Provider
mapLngStringoptionalMap Longitude (For distance calculation)
mapLatStringoptionalMap Latitude (For distance calculation)
uidOrUsernameNumber / StringoptionalSpecify scope: User
hidStringoptionalSpecify scope: Topic
gidStringoptionalSpecify scope: Group
includeSubgroupsBooleanoptionalUsed with gid configuration to include or exclude sublevel groups.
Default is false
allDigestBooleanoptionalSpecify scope: All digest, general and premium digest
When passed, the digestState parameter will be ignored
digestStateNumberoptionalSpecify scope: Digest (leave empty to output all)
digest_state field 1 No 2 general digest 3 premium digest
stickyStateNumberoptionalSpecify scope: Sticky (leave empty to output all)
sticky_state field 1 No 2 group sticky 3 global sticky
contentTypeStringoptionalFilter content by type
createdDaysNumberoptionalPublish days: Content created in the specified number of days
createdDateStringoptionalPublish date: today,yesterday,week,lastWeek,month,lastMonth,year,lastYear
createdDateGtStringoptionalPublish date greater than Y-m-d
createdDateLtStringoptionalPublish date less than Y-m-d
likeCountGtNumberoptionalLikes count greater than
likeCountLtNumberoptionalLikes count less than
dislikeCountGtNumberoptionalDislikes count greater than
dislikeCountLtNumberoptionalDislikes count less than
followCountGtNumberoptionalFollows count greater than
followCountLtNumberoptionalFollows count less than
blockCountGtNumberoptionalBlock count greater than
blockCountLtNumberoptionalBlock count less than
commentCountGtNumberoptionalTotal number of comments greater than
commentCountLtNumberoptionalTotal number of comments less than
orderTypeStringoptionalSort by type: createdTime,random,view,like,dislike,follow,block,comment
Default createdTime
orderDirectionStringoptionalSort by direction, default desc
asc,desc
blockGroupsStringoptionalFilter groups, gid multiple separated by commas
blockHashtagsStringoptionalFilter hashtags, hid multiple separated by commas
whitelistKeysStringoptionalWhitelist key names, only returns key-value pairs for the given key names
Multiple separated by English commas, supports "dot notation" for multi-dimensional arrays
blacklistKeysStringoptionalBlacklist key names, removes specified key-value pairs from the returned data
Multiple separated by English commas, supports "dot notation" for multi-dimensional arrays
pluginRatingIdNumberoptionalSort number (plug-in specific)
pageSizeNumberoptionalNumber of items per page (default 15 items)
pageNumberoptionalPage number (default 1)

Request Description

  • If in private mode, when expired at users->expired_at, you need to determine the status after expiration.
    • When the key value of the configuration table site_private_end_after is 1, this interface cannot be requested;
    • When the key value is 2, further judge the posting time. If posts->created_at posting time is greater than the expiration time users->expired_at, it will not be output; if the posting time is less than the expiration time, it means the content was posted before expiration and can be output.
  • The uidOrUsername parameter value represents obtaining posts from a specified user, and whether to output is determined by Operations > Interaction > View user content settings.
    • it_posts configuration, whether to output users who liked my posts
  • If uidOrUsername is the logged-in user themselves, the above configuration is invalid, and data is directly output, indicating that the switch is ignored when viewing their own content.
  • If it is a non-public group post and not a member of the group (not following the group), it will not be output.
  • Posts of blocked objects (users, groups, topics, posts) will not be output.
contentType parameter (PascalCase)Description
Output all content
AllOutput all content
TextOutput plain text posts
ImageOutput posts with images
VideoOutput posts with videos
AudioOutput posts with audio
DocumentOutput posts with documents
Output posts with plugin fskey AbcName extended content

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        "pagination": {
            "total": "Number / How much data in total",
            "pageSize": "Number / How much data on each page",
            "currentPage": "Number / Current page number",
            "lastPage": "Number / Last page number"
        },
        "list": [
            {
                // Common Data Structure -> Post Info
            }
        ]
    }
}

Released under the Apache-2.0 License