---
title: localization - Storefront API
description: >
  Returns the shop's localization settings. Use this query to build [country and
  language
  selectors](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/markets)
  for your storefront.


  The
  [`country`](https://shopify.dev/docs/api/storefront/latest/queries/localization#returns-Localization.fields.country)
  and
  [`language`](https://shopify.dev/docs/api/storefront/latest/queries/localization#returns-Localization.fields.language)
  fields reflect the active localized experience. To change the context, use the
  [`@inContext`](https://shopify.dev/docs/api/storefront#directives) directive
  with your desired country or language code.
api_version: 2026-01
api_name: storefront
type: query
api_type: graphql
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/queries/localization'
  md: 'https://shopify.dev/docs/api/storefront/latest/queries/localization.md'
---

# localization

query

Returns the shop's localization settings. Use this query to build [country and language selectors](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/markets) for your storefront.

The [`country`](https://shopify.dev/docs/api/storefront/latest/queries/localization#returns-Localization.fields.country) and [`language`](https://shopify.dev/docs/api/storefront/latest/queries/localization#returns-Localization.fields.language) fields reflect the active localized experience. To change the context, use the [`@inContext`](https://shopify.dev/docs/api/storefront#directives) directive with your desired country or language code.

## Possible returns

* Localization

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

  Information about the shop's configured localized experiences, including available countries and languages. The [`country`](https://shopify.dev/docs/api/storefront/2026-01/objects/Localization#field-Localization.fields.country) and [`language`](https://shopify.dev/docs/api/storefront/2026-01/objects/Localization#field-Localization.fields.language) fields reflect the active localization context, which you can change using the `@inContext` directive on queries.

  Use [`availableCountries`](https://shopify.dev/docs/api/storefront/2026-01/objects/Localization#field-Localization.fields.availableCountries) to list all countries with enabled localized experiences, and [`availableLanguages`](https://shopify.dev/docs/api/storefront/2026-01/objects/Localization#field-Localization.fields.availableLanguages) to get languages available for the currently active country. Each [`Country`](https://shopify.dev/docs/api/storefront/2026-01/objects/Country) includes its own currency, unit system, and available languages.

  * available​Countries

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

    non-null

    The list of countries with enabled localized experiences.

  * available​Languages

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

    non-null

    The list of languages available for the active country.

  * country

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

    non-null

    The country of the active localized experience. Use the `@inContext` directive to change this value.

  * language

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

    non-null

    The language of the active localized experience. Use the `@inContext` directive to change this value.

  * market

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

    non-nullDeprecated

***

## Examples

* ### Load the countries a shop sells to and the supported languages for each

  #### Description

  This example shows how to load the countries a shop sells to and the supported languages for each country. Any option returned by the API can also be passed to the \[\`@inContext\` directive]\(/api/storefront#directives) to load data for that country and language context.

  #### Query

  ```graphql
  query AllLocalizations @inContext(language: EN) {
    localization {
      availableCountries {
        isoCode
        name
        availableLanguages {
          isoCode
          endonymName
        }
      }
    }
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/api/2026-01/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
  -d '{
  "query": "query AllLocalizations @inContext(language: EN) { localization { availableCountries { isoCode name availableLanguages { isoCode endonymName } } } }"
  }'
  ```

  #### React Router

  ```javascript
  import { unauthenticated } from "../shopify.server";

  export const loader = async () => {
    const { storefront } = await unauthenticated.storefront(
      'your-development-store.myshopify.com'
    );
    const response = await storefront.graphql(
      `#graphql
    query AllLocalizations @inContext(language: EN) {
      localization {
        availableCountries {
          isoCode
          name
          availableLanguages {
            isoCode
            endonymName
          }
        }
      }
    }`,
    );
    const json = await response.json();
    return json.data;
  }
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Storefront({
    domain: 'your-development-store.myshopify.com',
    storefrontAccessToken,
  });
  const data = await client.query({
    data: `query AllLocalizations @inContext(language: EN) {
      localization {
        availableCountries {
          isoCode
          name
          availableLanguages {
            isoCode
            endonymName
          }
        }
      }
    }`,
  });
  ```

  #### Response

  ```json
  {
    "localization": {
      "availableCountries": [
        {
          "isoCode": "BE",
          "name": "Belgium",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "ES",
              "endonymName": "Español"
            },
            {
              "isoCode": "FR",
              "endonymName": "Français"
            }
          ]
        },
        {
          "isoCode": "CA",
          "name": "Canada",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "FR",
              "endonymName": "Français"
            }
          ]
        },
        {
          "isoCode": "DE",
          "name": "Germany",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "ES",
              "endonymName": "Español"
            },
            {
              "isoCode": "FR",
              "endonymName": "Français"
            }
          ]
        },
        {
          "isoCode": "ES",
          "name": "Spain",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "ES",
              "endonymName": "Español"
            },
            {
              "isoCode": "FR",
              "endonymName": "Français"
            }
          ]
        },
        {
          "isoCode": "FR",
          "name": "France",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "ES",
              "endonymName": "Español"
            },
            {
              "isoCode": "FR",
              "endonymName": "Français"
            }
          ]
        },
        {
          "isoCode": "GB",
          "name": "United Kingdom",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            }
          ]
        },
        {
          "isoCode": "US",
          "name": "United States",
          "availableLanguages": [
            {
              "isoCode": "EN",
              "endonymName": "English"
            },
            {
              "isoCode": "ES",
              "endonymName": "Español"
            }
          ]
        }
      ]
    }
  }
  ```
