---
title: locations - Storefront API
description: >-
  Returns shop locations that support in-store pickup. Use the `near` argument
  with
  [`GeoCoordinateInput`](/docs/api/storefront/2026-10/input-objects/GeoCoordinateInput)

  to sort results by proximity to the customer's location.


  When sorting by distance, set `sortKey` to
  [`DISTANCE`](/docs/api/storefront/2026-10/queries/locations#arguments-sortKey.enums.DISTANCE)

  and provide coordinates using the
  [`near`](/docs/api/storefront/2026-10/queries/locations#arguments-near)
  argument.


  Learn more about [supporting local pickup on
  storefronts](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/products-collections/local-pickup).
api_version: 2026-10
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/queries/locations'
  md: 'https://shopify.dev/docs/api/storefront/latest/queries/locations.md'
api_name: storefront
api_type: graphql
type: query
---

# locations

query

Requires `unauthenticated_read_product_pickup_locations` access scope.

Returns shop locations that support in-store pickup. Use the `near` argument with [`GeoCoordinateInput`](https://shopify.dev/docs/api/storefront/2026-10/input-objects/GeoCoordinateInput) to sort results by proximity to the customer's location.

When sorting by distance, set `sortKey` to [`DISTANCE`](https://shopify.dev/docs/api/storefront/2026-10/queries/locations#arguments-sortKey.enums.DISTANCE) and provide coordinates using the [`near`](https://shopify.dev/docs/api/storefront/2026-10/queries/locations#arguments-near) argument.

Learn more about [supporting local pickup on storefronts](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/products-collections/local-pickup).

## LocationConnection arguments

[LocationConnection!](https://shopify.dev/docs/api/storefront/latest/connections/LocationConnection)

* after

  [String](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  Returns the elements that come after the specified cursor.

* before

  [String](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  Returns the elements that come before the specified cursor.

* first

  [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int)

  Returns up to the first `n` elements from the list.

* last

  [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int)

  Returns up to the last `n` elements from the list.

* near

  [Geo​Coordinate​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/GeoCoordinateInput)

  Used to sort results based on proximity to the provided location.

* reverse

  [Boolean](https://shopify.dev/docs/api/storefront/latest/scalars/Boolean)

  Default:false

  Reverse the order of the underlying list.

* sort​Key

  [Location​Sort​Keys](https://shopify.dev/docs/api/storefront/latest/enums/LocationSortKeys)

  Default:ID

  Sort the underlying list by the given key.

***

## Possible returns

* edges

  [\[Location​Edge!\]!](https://shopify.dev/docs/api/storefront/latest/objects/LocationEdge)

  non-null

  A list of edges.

* nodes

  [\[Location!\]!](https://shopify.dev/docs/api/storefront/latest/objects/Location)

  non-null

  A list of the nodes contained in LocationEdge.

* page​Info

  [Page​Info!](https://shopify.dev/docs/api/storefront/latest/objects/PageInfo)

  non-null

  Information to aid in pagination.

***

## Examples

* ### locations reference
