Anchor to locationsCountlocations
locationsCount
query
Returns the count of locations for the given shop. Limited to a maximum of 10000.
Anchor to Arguments
Arguments
- 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 active•string
- Anchor to address1•string
- Anchor to address2•string
- Anchor to city•string
- Anchor to country•string
- Anchor to created_at•time
- Anchor to geolocated•boolean
- Anchor to legacy•boolean
- Anchor to location_id•id
- Anchor to name•string
- Anchor to pickup_in_store•string
enabled
disabled
- Anchor to province•string
- Anchor to zip•string
Example:
Valid values:
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to CountCount•
Details for count of elements.
Was this section helpful?
Retrieve a count of locations
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 query {6 locationsCount {7 count8 }9 }`,10);1112const data = await response.json();13
query {
locationsCount {
count
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { locationsCount { count } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
locationsCount {
count
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
locationsCount {
count
}
}`,
});
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 {
locationsCount {
count
}
}
QUERY
response = client.query(query: query)
Response
JSON1{2 "locationsCount": {3 "count": 104 }5}