POST

Query Posts


Retrieves a list of up to 100 posts, given the provided paging, filtering, and sorting.

Query Posts runs with these defaults, which you can override:

  • firstPublishedDate is sorted in descending order, with pinned posts first.
  • paging.limit is 50.
  • paging.offset is 0.

For field support for filters and sorting, see Field Support for Filtering and Sorting.

To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection. For a detailed list of supported filters and sortable fields, see Field Support for Filtering and Sorting.

Permissions
Manage Blog
Read Blog
Read Draft Blog Posts
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/blog/v3/posts/query

Body Params
pagingPagingdeprecated - use query instead

Deprecated. Use query instead. This parameter will be removed on June 30, 2023.

Pagination options.


filterstructdeprecated - use query instead

Deprecated. Use query instead. This parameter will be removed on June 30, 2023.

Filter object.


sortArray <Sorting>deprecated - use query insteadmaxItems 3

Deprecated. Use query instead. This parameter will be removed on June 30, 2023.

Sorting options. For a list of sortable fields, see Field Support for Filtering and Sorting.


fieldsToIncludeArray <string>deprecated - use fieldsets insteadmaxItems 20

Deprecated. Use fieldsets instead. This parameter will be removed on June 30, 2023.

List of post fields to be included in the response.


queryQuery

Query options.


fieldsetsArray <string>maxItems 20

List of additional post fields to include in the response. For example, use the URL fieldset to retrieve the url field in the response in addition to the post’s base fields. Base fields don’t include any of the supported fieldset values. By default only the post’s base fields are returned.

Response Object
postsArray <Post>

List of posts.


metaDataMetaDatadeprecated - use pagingMetadata instead

Deprecated. Use pagingMetadata instead. This property will be removed on June 30, 2023.

Details on the paged set of results returned.


pagingMetadataPagingMetadata

Details on the paged set of results returned.

Query Posts Example 1
Request
cURL
curl \ 'https://www.wixapis.com/blog/v3/posts/query' \ --data-binary '{ "fieldsets": ["URL", "METRICS", "CONTENT_TEXT"], "filter": { "title": { "$startsWith": "My vacation" } } }' \ } -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "posts": [ { "id": "894a58a2-dc75-422d-9ca6-00a489750dfd", "title": "My vacation", "slug": "my-vacation", "firstPublishedDate": "2020-08-06T09:18:07.839Z", "lastPublishedDate": "2020-08-06T09:18:07.839Z", "url": { "base": "https://some-user.wixsite.com/my-site", "path": "/blog/posts/my-vacation" }, "featured": true, "pinned": false, "categoryIds": ["5f2bcaa0879ad500173577f3", "5f2bcaa5940a02003488af3e"], "memberId": "5ee77ebfffeab500188f496b", "hashtags": ["sea", "sun"], "commentingEnabled": true, "minutesToRead": 1, "tagIds": ["5f2bcaa0879a4400173577f1", "5f2bc445940a02003488af3a"], "pricingPlanIds": ["5f2bc445940a02003498af3e"], "relatedPostIds": [ "111a58a2-dc75-422d-0015-00a489750dfd", "211a58a2-dc75-422d-1512-00a489750dfd" ], "language": "en", "translationId": "111a58a2-dc75-422d-9ca6-00a489750dfd" } ], "metaData": { "count": 1, "offset": 0, "total": 1 } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?