products
Returns a list of products.
ProductConnection arguments
- Anchor to afterafter•
The elements that come after the specified cursor.
- Anchor to beforebefore•
The elements that come before the specified cursor.
- Anchor to firstfirst•
The first
n
elements from the paginated list.- Anchor to lastlast•
The last
n
elements from the paginated list.- 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 category_id•string
Filter by the product category ID (
product.category.id
). A product category is the category of a product from Shopify's Standard Product Taxonomy.category_id:sg-4-17-2-17
- Anchor to combined_listing_role•string
Filter by the role of the product in a combined listing.
parent
child
no_role
combined_listing_role:parent
- Anchor to created_at•time
Filter by the date and time when the product was created.
created_at:>'2020-10-21T23:39:20Z'
created_at:<now
created_at:<='2024'
- Anchor to delivery_profile_id•id
Filter by the delivery profile
id
field.delivery_profile_id:108179161409
- 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_composites•boolean
Filter by products that have only composite variants.
has_only_composites:true
- 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.
has_only_default_variant:true
- Anchor to has_variant_with_components•boolean
Filter by products that have variants with associated components.
has_variant_with_components:true
- Anchor to inventory_total•integer
Filter by inventory count.
inventory_total:0
inventory_total:>150
inventory_total:>=200
- Anchor to out_of_stock_somewhere•boolean
Filter by products that are out of stock in at least one location.
out_of_stock_somewhere:true
- Anchor to product_configuration_owner•string
Filter by the app
id
field.product_configuration_owner:10001
- 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.approved
rejected
needs_action
awaiting_review
published
demoted
scheduled
provisionally_published
publishable_status:189769876-approved
- Anchor to product_type•string
Filter by a comma-separated list of product types.
product_type:snowboard
- Anchor to publication_ids•string
Filter by a comma-separated list of publication IDs that are associated with the product.
publication_ids:184111530305,184111694145
- 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.online_store_channel
published
unpublished
visible
unavailable
hidden
intended
visible
publishable_status:published
publishable_status:189769876:visible
publishable_status:pos:hidden
- Anchor to 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:<now
published_at:<=2024
- Anchor to 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
- Anchor to sku•string
Filter by the product variant
sku
field. Learn more about SKUs.sku:XYZ-12345
- 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.
ACTIVE
DefaultARCHIVED
DRAFT
status:ACTIVE,DRAFT
- Anchor to updated_at•time
Filter by the date and time when the product was last updated.
updated_at:>'2020-10-21T23:39:20Z'
updated_at:<now
updated_at:<='2024'
- Anchor to variant_title•string
Filter by the product variant
title
field.variant_title:'Special ski wax'
- Anchor to vendor•string
Filter by the origin or source of the product. Learn more about vendors and managing vendor information.
vendor:Snowdevil
vendor:Snowdevil OR vendor:Icedevil
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
Valid values:
Example:
Example:
Valid values:
Example:
Example:
Valid values:
Example:
Example:
Example:
Example:
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to savedSearchIdsaved•
Search Id The ID of a saved search. The search’s query string is used as the query argument.
- Anchor to sortKeysort•
Key ProductSort Default:IDKeys Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Anchor to Possible returnsPossible returns
- Anchor to edgesedges•[Product
Edge!]! non-null The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
- Anchor to nodesnodes•[Product!]!non-null
A list of nodes that are contained in ProductEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve.
- Anchor to pageInfopage•
Info PageInfo! non-null An object that’s used to retrieve cursor information about the current page.
- Get 10 products after a given cursor and whether or not there is a subsequent page of results
- Get multiple sets of products with a single query using aliases to name the results
- Get the 10 most recently created products
- Get the first 10 products of a specific product type
- Get the first 10 products updated after the specified date
- Get the total inventory and price range of three products using a fragment
- Get two specific products by their ID using aliases
- Retrieve product_ids that are published to your app
- Retrieve a list of products
- Retrieve product listings that are published to your app
Examples
query {
products(first: 10, after: "eyJsYXN0X2lkIjoyMDk5NTY0MiwibGFzdF92YWx1ZSI6IjIwOTk1NjQyIn0=") {
edges {
node {
id
title
handle
}
cursor
}
pageInfo {
hasNextPage
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { products(first: 10, after: \"eyJsYXN0X2lkIjoyMDk5NTY0MiwibGFzdF92YWx1ZSI6IjIwOTk1NjQyIn0=\") { edges { node { id title handle } cursor } pageInfo { hasNextPage } } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
products(first: 10, after: "eyJsYXN0X2lkIjoyMDk5NTY0MiwibGFzdF92YWx1ZSI6IjIwOTk1NjQyIn0=") {
edges {
node {
id
title
handle
}
cursor
}
pageInfo {
hasNextPage
}
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
products(first: 10, after: "eyJsYXN0X2lkIjoyMDk5NTY0MiwibGFzdF92YWx1ZSI6IjIwOTk1NjQyIn0=") {
edges {
node {
id
title
handle
}
cursor
}
pageInfo {
hasNextPage
}
}
}`,
});
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 {
products(first: 10, after: "eyJsYXN0X2lkIjoyMDk5NTY0MiwibGFzdF92YWx1ZSI6IjIwOTk1NjQyIn0=") {
edges {
node {
id
title
handle
}
cursor
}
pageInfo {
hasNextPage
}
}
}
QUERY
response = client.query(query: query)