--- title: collectionsCount - GraphQL Admin description: Count of collections. Limited to a maximum of 10000 by default. api_version: 2026-01 api_name: admin type: query api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/collectionsCount' md: >- https://shopify.dev/docs/api/admin-graphql/latest/queries/collectionsCount.md --- # collections​Count query Requires `read_products` access scope. Count of collections. Limited to a maximum of 10000 by default. ## Arguments * limit * query * savedSearchId *** ## Possible returns * Count *** ## Examples * ### Retrieves a count of custom collections #### Query ```graphql query CollectionsCount { collectionsCount(query: "collection_type:custom") { count } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query CollectionsCount { collectionsCount(query: \"collection_type:custom\") { count } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query CollectionsCount { collectionsCount(query: "collection_type:custom") { count } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query CollectionsCount { collectionsCount(query: "collection_type:custom") { count } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query CollectionsCount { collectionsCount(query: "collection_type:custom") { count } }`, }); ``` #### Response ```json { "collectionsCount": { "count": 8 } } ``` * ### Retrieves a count of smart collections #### Query ```graphql query CollectionsCount { collectionsCount(query: "collection_type:smart") { count } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query CollectionsCount { collectionsCount(query: \"collection_type:smart\") { count } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query CollectionsCount { collectionsCount(query: "collection_type:smart") { count } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query CollectionsCount { collectionsCount(query: "collection_type:smart") { count } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query CollectionsCount { collectionsCount(query: "collection_type:smart") { count } }`, }); ``` #### Response ```json { "collectionsCount": { "count": 10 } } ```