# productsCount - admin-graphql - QUERY Version: 2024-10 ## Description Count of products. Limited to a maximum of 10000. ### Access Scopes `read_products` access scope. ## Arguments * [limit](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The upper bound on count value before returning a result. * [query](/docs/api/admin-graphql/2024-10/scalars/String): String - A filter made up of terms, connectives, modifiers, and comparators. | name | type | description | acceptable_values | default_value | example_use | | ---- | ---- | ---- | ---- | ---- | ---- | | default | string | Filter by a case-insensitive search of multiple fields in a document. | | | - `query=Bob Norman`
- `query=title:green hoodie` | | barcode | string | Filter by the product variant [`barcode`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-barcode) field. | | | - `barcode:ABC-abc-1234` | | bundles | boolean | Filter by a [product bundle](https://shopify.dev/docs/apps/build/product-merchandising/bundles). A product bundle is a set of two or more related products, which are commonly offered at a discount. | | | - `bundles:true` | | category_id | string | Filter by the product [category ID](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-category) (`product.category.id`). A product category is the category of a product from [Shopify's Standard Product Taxonomy](https://shopify.github.io/product-taxonomy/releases/unstable/?categoryId=sg-4-17-2-17). | | | - `category_id:gid://shopify/TaxonomyCategory/aa` | | combined_listing_role | string | Filter by the role of the product in a [combined listing](https://shopify.dev/apps/build/product-merchandising/combined-listings). | - `parent`
- `child` | | - `combined_listing_role:parent` | | created_at | time | Filter by the date and time when the product was created. | | | - `created_at:>'2020-10-21T23:39:20Z'`
- `created_at: - `created_at:<='2024'` | | delivery_profile_id | id | Filter by the delivery profile [`id`](https://shopify.dev/api/admin-graphql/latest/objects/DeliveryProfile#field-id) field. | | | - `delivery_profile_id:108179161409` | | error_feedback | string | Filter by products with publishing errors. | | gift_card | boolean | Filter by the product [`isGiftCard`](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-isgiftcard) field. | | | - `gift_card:true` | | handle | string | Filter by a comma-separated list of product [handles](https://shopify.dev/api/admin-graphql/latest/queries/products#argument-query-filter-handle). | | | - `handle:the-minimal-snowboard` | | has_only_composites | boolean | Filter by products that have only composite variants. | | | - `has_only_composites:true` | | has_only_default_variant | boolean | Filter by products that have only a default variant. A default variant is the only variant if no other variants are specified. | | | - `has_only_default_variant:true` | | has_variant_with_components | boolean | Filter by products that have variants with associated components. | | | - `has_variant_with_components:true` | | id | id | Filter by `id` range. | | | - `id:1234`
- `id:>=1234`
- `id:<=1234` | | inventory_total | integer | Filter by inventory count. | | | - `inventory_total:0`
- `inventory_total:>150`
- `inventory_total:>=200` | | is_price_reduced | boolean | Filter by products that have a reduced price. For more information, refer to the [`CollectionRule`](https://shopify.dev/api/admin-graphql/latest/objects/CollectionRule) object. | | | - `is_price_reduced:true` | | out_of_stock_somewhere | boolean | Filter by products that are out of stock in at least one location. | | | - `out_of_stock_somewhere:true` | | price | bigdecimal | Filter by the product variant [`price`](https://shopify.dev/api/admin-graphql/latest/objects/Productvariant#field-price) field. | | | - `price:100.57` | | product_configuration_owner | string | Filter by the app [`id`](https://shopify.dev/api/admin-graphql/latest/objects/App#field-id) field. | | | - `product_configuration_owner:10001` | | product_publication_status | string | Filter by the publishable status of the resource on a channel, such as the online store. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) and one of the valid values. | - `approved`
- `rejected`
- `needs_action`
- `awaiting_review`
- `published`
- `demoted`
- `scheduled`
- `provisionally_published` | | - `publishable_status:189769876-approved` | | product_type | string | Filter by a comma-separated list of [product types](https://help.shopify.com/manual/products/details/product-type). | | | - `product_type:snowboard` | | publication_ids | string | Filter by a comma-separated list of publication IDs that are associated with the product. | | | - `publication_ids:184111530305,184111694145` | | publishable_status | string | Filter by the publishable status of the resource on a channel, such as the online store. The value is a composite of either the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) or [channel `name`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Channel#field-name) and one of the valid values. | - `online_store_channel`
- `published`
- `unpublished`
- `visible`
- `unavailable`
- `hidden`
- `intended`
- `visible` | | - `publishable_status:published`
- `publishable_status:189769876:visible`
- `publishable_status:pos:hidden` | | published_at | time | Filter by the date and time when the product was published to the online store and other sales channels. | | | - `published_at:>2020-10-21T23:39:20Z`
- `published_at: - `published_at:<=2024` | | published_status | string | Filter by the published status of the resource on a channel, such as the online store. | - `unset`
- `pending`
- `approved`
- `not approved` | | - `published_status:approved` | | sku | string | Filter by the product variant [`sku`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-sku) field. [Learn more about SKUs](https://help.shopify.com/manual/products/details/sku). | | | - `sku:XYZ-12345` | | status | string | Filter by a comma-separated list of statuses. You can use statuses to manage inventory. Shopify only displays products with an `ACTIVE` status in online stores, sales channels, and apps. | - `ACTIVE`
- `ARCHIVED`
- `DRAFT` | `ACTIVE` | - `status:ACTIVE,DRAFT` | | tag | string | Filter objects by the `tag` field. | | | - `tag:my_tag` | | tag_not | string | Filter by objects that don’t have the specified tag. | | | - `tag_not:my_tag` | | title | string | Filter by the product [`title`](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-title) field. | | | - `title:The Minimal Snowboard` | | updated_at | time | Filter by the date and time when the product was last updated. | | | - `updated_at:>'2020-10-21T23:39:20Z'`
- `updated_at: - `updated_at:<='2024'` | | variant_id | id | Filter by the product variant [`id`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-id) field. | | | - `variant_id:45779434701121` | | variant_title | string | Filter by the product variant [`title`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-title) field. | | | - `variant_title:Special ski wax` | | vendor | string | Filter by the origin or source of the product. Learn more about [vendors and managing vendor information](https://help.shopify.com/manual/products/managing-vendor-info). | | | - `vendor:Snowdevil`
- `vendor:Snowdevil OR vendor:Icedevil` | You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). * [savedSearchId](/docs/api/admin-graphql/2024-10/scalars/ID): ID - The ID of an existing saved search. The search’s query string is used as the query argument. Refer to the [`SavedSearch`](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch) object. ## Returns * [count](/docs/api/admin-graphql/2024-10/scalars/Int): Int! The count of elements. * [precision](/docs/api/admin-graphql/2024-10/enums/CountPrecision): CountPrecision! The count's precision, or the exactness of the value. ## Examples ### Retrieve a count of products Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { productsCount(query: \\\"id:>=1000\\\") { count } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n productsCount(query: \"id:>=1000\") {\n count\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n productsCount(query: \"id:>=1000\") {\n count\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n productsCount(query: \"id:>=1000\") {\n count\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n productsCount(query: \"id:>=1000\") {\n count\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "productsCount": { "count": 7 } } }