POST

Query Data Items


Retrieves a list of items, on the basis of the filtering, sorting, and paging preferences you provide.

For more details on using queries, see API Query Language.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage All Data Resources
Manage Data Items
Read Data Items
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/wix-data/v2/items/query

Body Params
dataCollectionIdstringRequiredmaxLength 256

ID of the collection to query.


queryQuery

Query preferences. For more details on using queries, see API Query Language.


returnTotalCountboolean

Whether to return the total count in the response for a query with offset paging. When true, the pagingMetadata object in the response contains a total field.

Default: false


includeReferencedItemsArray <string>deprecated - use referencedItemOptions insteadmaxItems 50maxLength 1000

Properties for which to include referenced items in the query's results. Up to 50 referenced items can be included for each item that matches the query.


consistentReadboolean

Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up to date even immediately after an update. Learn more about Wix Data and eventual consistency.

Default: false


languagestringformat LANGUAGE_TAG

Language to translate result text into, in IETF BCP 47 language tag format. If provided, the result text is returned in the specified language. Note: Translation for the specified language must be enabled for the collection in Wix Multilingual.

If not provided, result text is not translated.


appOptionsstruct

Additional parameters specific to the Wix app collection you are querying.

When querying the Wix Stores Products collection, pass the following optional parameters:

  • includeHiddenProducts: Whether to include hidden products in the response. Default: false.
  • includeVariants: Whether to include product variants in the query. Default: false.

publishPluginOptionsPublishPluginOptions

Options for the Publish plugin. This plugin allows items in a data collection to be marked as draft or published. Published items are visible to site visitors, while draft items are not.


referencedItemOptionsArray <ReferencedItemOptions>maxItems 100

Options for retrieving referenced items.

Response Object
dataItemsArray <DataItem>

Retrieved items.


pagingMetadataPagingMetadata

Paging information.

Request
cURL
Response
JSON
Errors

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

Did this help?