productsCount
Requires access scope.
Count of products.
Arguments
- Anchor to limitlimit•
The upper bound on count value before returning a result.
- Anchor to queryquery•
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to default•string
Filter by a case-insensitive search of multiple fields in a document.
query=Bob Norman
query=title:green hoodie
- Anchor to bundles•boolean
Filter by a product bundle. A product bundle is a set of two or more related products, which are commonly offered at a discount.
bundles:true
- Anchor to error_feedback•string
Filter by products with publishing errors.
- Anchor to handle•string
Filter by a comma-separated list of product handles.
handle:the-minimal-snowboard
- Anchor to 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.
- Anchor to has_variant_with_components•boolean
Filter by products that have variants with associated components.
- Anchor to out_of_stock_somewhere•boolean
Filter by products that are out of stock in at least one location.
- Anchor to 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 (Channel.app.id
) and one of the valid values.- Anchor to 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 (Channel.app.id
) or channelname
and one of the valid values.- Anchor to published_status•string
Filter by the published status of the resource on a channel, such as the online store.
- Anchor to status•string
Filter by a comma-separated list of statuses. You can use statuses to manage inventory. Shopify only displays products with an
status in online stores, sales channels, and apps.
- Anchor to vendor•string
Filter by the origin or source of the product. Learn more about vendors and managing vendor information.
vendor:Snowdevil
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
- Anchor to savedSearchIdsaved•
Search Id
Anchor to Possible returnsPossible returns
- Anchor to CountCount•
Details for count of elements.
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 query {6 productsCount(query: "id:>=1000") {7 count8 }9 }`,10);1112const data = await response.json();13
query {
productsCount(query: "id:>=1000") {
count
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { productsCount(query: \"id:>=1000\") { count } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
productsCount(query: "id:>=1000") {
count
}
}`,
);
const data = await response.json();
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 {
productsCount(query: "id:>=1000") {
count
}
}
QUERY
response = client.query(query: query)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
productsCount(query: "id:>=1000") {
count
}
}`,
});
Response
JSON1{2 "productsCount": {3 "count": 74 }5}