--- title: productByIdentifier - GraphQL Admin description: Return a product by an identifier. api_version: 2026-01 api_name: admin type: query api_type: graphql source_url: html: >- https://shopify.dev/docs/api/admin-graphql/latest/queries/productByIdentifier md: >- https://shopify.dev/docs/api/admin-graphql/latest/queries/productByIdentifier.md --- # product​By​Identifier query Requires `read_products` access scope. Return a product by an identifier. ## Arguments * identifier *** ## Possible returns * Product *** ## Examples * ### Find a product by custom id #### Query ```graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } ``` #### Variables ```json { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } ``` #### 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }", "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } }' ``` #### 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, ); 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } QUERY variables = { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, }); ``` #### Response ```json { "product": { "id": "gid://shopify/Product/20995642", "handle": "element", "title": "Element" } } ``` * ### Find a product by handle #### Query ```graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } ``` #### Variables ```json { "identifier": { "handle": "boots" } } ``` #### 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }", "variables": { "identifier": { "handle": "boots" } } }' ``` #### 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "handle": "boots" } }, }, ); 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } QUERY variables = { "identifier": { "handle": "boots" } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, "variables": { "identifier": { "handle": "boots" } }, }, }); ``` #### Response ```json { "product": { "id": "gid://shopify/Product/121709582", "handle": "boots", "title": "Boots" } } ```