> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryCategories

# Package: blog

# Namespace: CategoryService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/blog/category/query-categories?apiView=SDK.md

## Permission Scopes:
Read Blog : SCOPE.DC-BLOG.READ-BLOGS

## Introduction

Retrieves a list of up to 100 categories, given the provided paging, filtering, and sorting.
Query Categories runs with these defaults, which you can override.
- `displayPosition` is sorted in `DESC` order.
- `paging.limit` is `50`.
- `paging.offset` is `0`.

To learn about working with _Query_ endpoints, see
[API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
[Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and
[Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).

---

## REST API

### Schema

```
 Method: queryCategories
 Description: Retrieves a list of up to 100 categories, given the provided paging, filtering, and sorting. Query Categories runs with these defaults, which you can override. - `displayPosition` is sorted in `DESC` order. - `paging.limit` is `50`. - `paging.offset` is `0`.  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
 URL: https://www.wixapis.com/blog/v3/categories/query
 Method: POST
 Method parameters:
   param name: fieldsets | type: array<fieldsets> | description: List of additional category fields to include in the response. By default only the category’s base fields are returned. Base fields are all category fields that don't appear in the fieldset enum.  To retrieve a field, pass the relevant fieldset in the enum in the `fieldsets` array. For example, add the `URL` fieldset to `fieldsets` to retrieve the url field in the response in addition to the category’s base fields.  | validation: maxItems 10
                 - enum:
                 -     UNKNOWN: 
                 -     URL: Includes category URL.
                 -     SEO: Includes SEO data.
   param name: query | type: PlatformQuery    
     - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 3
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  | validation: format double
              - name: longitude | type: number | description: Address longitude.  | validation: format double
 Query fields:
   - field: id | operators: $eq, $ne, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: title | operators: $eq, $ne, $startsWith, $lt, $lte, $gt, $gte, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: label | operators: $eq, $ne, $startsWith, $lt, $lte, $gt, $gte, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: postCount | operators: $eq, $ne, $lt, $lte, $gt, $gte, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: displayPosition | operators: $eq, $ne, $lt, $lte, $gt, $gte, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: translationId | operators: $eq, $ne, $exists, $in | sort: none | aggregatable: undefined | searchable: undefined
   - field: language | operators: $eq, $ne, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: slug | operators: $eq, $ne, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryCategoriesResponse
  - name: categories | type: array<Category> | description: List of categories.  
     - name: id | type: string | description: Category GUID.  | validation: maxLength 38, immutable
     - name: label | type: string | description: Category label. Displayed in the Category Menu.  | validation: maxLength 35
     - name: postCount | type: integer | description: Number of posts in the category.  | read-only: true 
     - name: url | type: PageUrl | description: The `url` of the page that lists every post with the specified category.  | read-only: true 
        - name: base | type: string | description: The base URL. For premium sites, this is the domain. For free sites, this is the site URL. For example, `mysite.wixsite.com/mysite`.  
        - name: path | type: string | description: The relative path for the page within the site. For example, `/product-page/a-product`.  
     - name: description | type: string | description: Category description.  | validation: maxLength 500
     - name: displayPosition | type: integer | description: Position of the category in the [Category Menu](https://support.wix.com/en/article/wix-blog-adding-and-customizing-a-category-menu). Categories are displayed in ascending order. Categories with a position of `-1` appear at the end of the sequence.  Default: `-1`  | validation: minimum 0, format int32
     - name: translationId | type: string | description: GUID of the category's translations. All translations of a single category share the same `translationId`.  | validation: format GUID
     - name: language | type: string | description: Category language.  2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.  | validation: immutable
     - name: slug | type: string | description: Part of a category's URL that refers to a specific category. For example, the slug of `https:/example.com/blog/category/famous-cats` is `famous-cats`.  | validation: maxLength 100
     - name: seoData | type: SeoSchema | description: SEO data.  
        - name: tags | type: array<Tag> | description: The tags rendered into <head>, in no particular order. Render order is decided by the renderer, not by position in this list.  No maxSize: this list is already populated by data written years ago, and a bound added now could reject a page that is already stored.  
           - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
           - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
           - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
           - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
           - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
        - name: settings | type: Settings | description: Page-level SEO settings that are not themselves tags.  
           - name: preventAutoRedirect | type: boolean | description: Whether to suppress the automatic redirect from this page's previous URL to its current one after a slug change.  Default false, meaning the redirect IS created. The field is named for the exception rather than the rule, which reads backwards; kept as-is because renaming a stored boolean is not worth the migration.  
           - name: keywords | type: array<Keyword> | description: Keyword terms the user is targeting for this page. Used by the SEO assistant and checklist; never rendered into <head>.  20 is a sanity bound, not the product limit. v1 declared 5 — the number the panel happens to allow today — which is exactly the mistake we are fixing for structured data. A product decision to allow 8 should not need a proto release, so the panel owns that number and the proto only stops something absurd.  | validation: maxItems 20
              - name: term | type: string | description: The term itself, e.g. "trail running shoes".  No maxLength, for the same reason as the legacy tag fields: keywords are already stored, and a bound added now could reject a record written before the bound existed. The flynt `missing-string-validations` warning on this field is accepted deliberately.  
              - name: isMain | type: boolean | description: Whether this is the page's primary focus keyword. At most one per page.  
              - name: origin | type: string | description: Which surface added the term, e.g. a panel or a suggestion flow. Used for attribution in BI. Opaque to the renderer.  | validation: maxLength 1000
     - name: coverImage | type: Image | description: Category cover image.  
        - name: id | type: string | description: WixMedia image GUID.  
        - name: url | type: string | description: Image URL.  
        - name: height | type: integer | description: Original image height.  | read-only: true 
        - name: width | type: integer | description: Original image width.  | read-only: true 
        - name: altText | type: string | description: Image alt text.  
        - name: filename | type: string | description: Image filename.  | read-only: true 
     - name: updatedDate | type: string | description: Date and time the Category was last updated.  | read-only: true | validation: format date-time
  - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of results returned.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 2000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 2000


```

### Examples

### QueryCategories
```curl
~~~cURL
curl \
  'https://www.wixapis.com/blog/v3/categories/query' \
   --data-binary '{
                    "fieldsets": ["URL"],
                    "filter": {
                      "title": {
                        "$startsWith": "Summer"
                      }
                    }
                  }' \
   }
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.blog.categories.queryCategories(query, options)
 Description: Retrieves a list of up to 100 categories, given the provided paging, filtering, and sorting. Query Categories runs with these defaults, which you can override. - `displayPosition` is sorted in `DESC` order. - `paging.limit` is `50`. - `paging.offset` is `0`.  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: CategoryQuery   | required: true 
     - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 3
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
           - name: origin | type: AddressLocation | description: Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).  
              - name: latitude | type: number | description: Address latitude.  
              - name: longitude | type: number | description: Address longitude.  
   param name: options | type: QueryCategoriesOptions  none  
        - name: fieldsets | type: array<Field> | description: List of additional category fields to include in the response. By default only the category’s base fields are returned. Base fields are all category fields that don't appear in the fieldset enum.  To retrieve a field, pass the relevant fieldset in the enum in the `fieldsets` array. For example, add the `URL` fieldset to `fieldsets` to retrieve the url field in the response in addition to the category’s base fields.  | validation: maxItems 10
             - enum:
             -     UNKNOWN: 
             -     URL: Includes category URL.
             -     SEO: Includes SEO data.
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $nin | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: title | operators: $eq, $ne, $startsWith, $lt, $lte, $gt, $gte, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: label | operators: $eq, $ne, $startsWith, $lt, $lte, $gt, $gte, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: postCount | operators: $eq, $ne, $lt, $lte, $gt, $gte, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: displayPosition | operators: $eq, $ne, $lt, $lte, $gt, $gte, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: translationId | operators: $eq, $ne, $exists, $in | sort: none | aggregatable: undefined | searchable: undefined
   - field: language | operators: $eq, $ne, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: slug | operators: $eq, $ne, $exists, $in | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryCategoriesResponse>
  - name: categories | type: array<Category> | description: List of categories.  
     - name: _id | type: string | description: Category GUID.  | validation: maxLength 38, immutable
     - name: label | type: string | description: Category label. Displayed in the Category Menu.  | validation: maxLength 35
     - name: postCount | type: integer | description: Number of posts in the category.  | read-only: true 
     - name: url | type: string | description: The `url` of the page that lists every post with the specified category.  | read-only: true 
     - name: description | type: string | description: Category description.  | validation: maxLength 500
     - name: displayPosition | type: integer | description: Position of the category in the [Category Menu](https://support.wix.com/en/article/wix-blog-adding-and-customizing-a-category-menu). Categories are displayed in ascending order. Categories with a position of `-1` appear at the end of the sequence.  Default: `-1`  | validation: minimum 0, format int32
     - name: translationId | type: string | description: GUID of the category's translations. All translations of a single category share the same `translationId`.  | validation: format GUID
     - name: language | type: string | description: Category language.  2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.  | validation: immutable
     - name: slug | type: string | description: Part of a category's URL that refers to a specific category. For example, the slug of `https:/example.com/blog/category/famous-cats` is `famous-cats`.  | validation: maxLength 100
     - name: seoData | type: SeoSchema | description: SEO data.  
        - name: tags | type: array<Tag> | description: The tags rendered into <head>, in no particular order. Render order is decided by the renderer, not by position in this list.  No maxSize: this list is already populated by data written years ago, and a bound added now could reject a page that is already stored.  
           - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
           - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
           - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
           - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
           - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
        - name: settings | type: Settings | description: Page-level SEO settings that are not themselves tags.  
           - name: preventAutoRedirect | type: boolean | description: Whether to suppress the automatic redirect from this page's previous URL to its current one after a slug change.  Default false, meaning the redirect IS created. The field is named for the exception rather than the rule, which reads backwards; kept as-is because renaming a stored boolean is not worth the migration.  
           - name: keywords | type: array<Keyword> | description: Keyword terms the user is targeting for this page. Used by the SEO assistant and checklist; never rendered into <head>.  20 is a sanity bound, not the product limit. v1 declared 5 — the number the panel happens to allow today — which is exactly the mistake we are fixing for structured data. A product decision to allow 8 should not need a proto release, so the panel owns that number and the proto only stops something absurd.  | validation: maxItems 20
              - name: term | type: string | description: The term itself, e.g. "trail running shoes".  No maxLength, for the same reason as the legacy tag fields: keywords are already stored, and a bound added now could reject a record written before the bound existed. The flynt `missing-string-validations` warning on this field is accepted deliberately.  
              - name: isMain | type: boolean | description: Whether this is the page's primary focus keyword. At most one per page.  
              - name: origin | type: string | description: Which surface added the term, e.g. a panel or a suggestion flow. Used for attribution in BI. Opaque to the renderer.  | validation: maxLength 1000
     - name: coverImage | type: string | description: Category cover image.  
     - name: _updatedDate | type: Date | description: Date and time the Category was last updated.  | read-only: true 
  - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of results returned.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 2000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 2000


```

### Examples

### Query for a category with filters
This example uses the `queryCategories()` function to search for categories in descending order that have a `displayPosition` less than or equal to 2.

```javascript
import { categories } from '@wix/blog';

export async function queryCategoriesFunction() {
  try {
    const result = await categories
      .queryCategories({ fieldsets: ['URL'] })
      .lt('displayPosition', 3)
      .descending('label')
      .find();
    console.log('Retrieved result:', result.items);
    return result.items;
  } catch (error) {
    console.log(error);
  }
}

/* Returns:
 * [
 *   {
 *     "_id": "1ea22fce-bc3c-4b78-9422-f0f367f8628e",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245",
 *     "description": "Posts about my summer",
 *     "displayPosition": 2,
 *     "label": "Summer",
 *     "language": "en",
 *     "postCount": 6,
 *     "slug": "summer-slug"
 *     "title": "Summer",
 *     "translationId": "973369ad-0d4b-41f5-a820-1eed7986e0de",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/my-blog/categories/summer-slug"
 *   },
 *   {
 *     "_id": "f489bf39-3297-4854-8429-e19dbefdca0e",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245"
 *     "description": "my category description",
 *     "displayPosition": 0,
 *     "label": "My Category",
 *     "language": "en",
 *     "postCount": 1,
 *     "slug": "my-category",
 *     "title": "My Category",
 *     "translationId": "dfc5b1a7-df04-4596-b311-9724f0477c3e",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/my-blog/categories/my-category"
 *   },
 *   {
 *     "_id": "686d5dd8-317a-4e3a-96b5-fe25f107aafd",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245"
 *     "description": "my category description",
 *     "displayPosition": 1,
 *     "label": "My Category 2",
 *     "language": "lt",
 *     "postCount": 0,
 *     "slug": "my-category-2",
 *     "title": "My Category 2",
 *     "translationId": "dfc5b1a7-df04-4596-b311-9724f0477c3e",
 *     "url": "http://https://tadasz7.wixsite.com/blog-velo-events/my-blog/categories/my-category-2"
 *   }
 * ]
 */

```

### Retrieve a list of all categories
This example uses the `queryCategories()` function to retrieve a list of all categories.

```javascript
import { categories } from '@wix/blog';

export async function queryCategoriesFunction() {
  try {
    const results = await categories.queryCategories().find();
    const items = results.items;
    return items;
  } catch (error) {
    console.error(error);
  }
}

/* Returns:
 * [
 *   {
 *     "_id": "f489bf39-3297-4854-8429-e19dbefdca0e",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245",
 *     "description": "my category description",
 *     "displayPosition": 0,
 *     "label": "My Category",
 *     "language": "en",
 *     "postCount": 1,
 *     "slug": "my-category",
 *     "title": "My Category",
 *     "translationId": "dfc5b1a7-df04-4596-b311-9724f0477c3e"
 *   },
 *   {
 *     "_id": "686d5dd8-317a-4e3a-96b5-fe25f107aafd",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245",
 *     "description": "my category description",
 *     "displayPosition": 1,
 *     "label": "My Category 2",
 *     "language": "lt",
 *     "postCount": 0,
 *     "slug": "my-category-2",
 *     "title": "My Category 2",
 *     "translationId": "dfc5b1a7-df04-4596-b311-9724f0477c3e"
 *   },
 *   {
 *     "_id": "1ea22fce-bc3c-4b78-9422-f0f367f8628e",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245",
 *     "description": "Posts about my summer",
 *     "displayPosition": 2,
 *     "label": "Summer",
 *     "language": "en",
 *     "postCount": 6,
 *     "slug": "summer-slug",
 *     "title": "Summer",
 *     "translationId": "973369ad-0d4b-41f5-a820-1eed7986e0de"
 *   },
 *   {
 *     "_id": "8bb208d0-bc3d-4caa-bbbf-775e52851d8f",
 *     "coverImage": "wix:image://v1/162e66_f6bffd1cd6144ddf87325b82fe8f42ed~mv2.jpg#originWidth=385&originHeight=245",
 *     "description": "Posts about my holidays",
 *     "displayPosition": 3,
 *     "label": "holidays",
 *     "language": "en",
 *     "postCount": 0,
 *     "slug": "holidays",
 *     "title": "Holidays",
 *     "translationId": ""
 *   }
 * ]
 */

```

### queryCategories (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { categories } from '@wix/blog';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { categories },
  // Include the auth strategy and host as relevant
});


async function queryCategories(query,options) {
  const response = await myWixClient.categories.queryCategories(query,options);
};
```

---