Load the countries a shop sells to and the supported languages for each
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"query AllLocalizations @inContext(language: EN) { localization { availableCountries { isoCode name availableLanguages { isoCode endonymName } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Storefront({\n domain: 'your-development-store.myshopify.com',\n storefrontAccessToken,\n});\nconst data = await client.query({\n data: `query AllLocalizations @inContext(language: EN) {\n localization {\n availableCountries {\n isoCode\n name\n availableLanguages {\n isoCode\n endonymName\n }\n }\n }\n }`,\n});\n"
Ruby example: null
PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new ShopifyClientsStorefront(\"your-development-store.myshopify.com\", $storefrontAccessToken);\n$query = <<<QUERY\n query AllLocalizations @inContext(language: EN) {\n localization {\n availableCountries {\n isoCode\n name\n availableLanguages {\n isoCode\n endonymName\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n"
Remix example: "const { storefront } = await unauthenticated.storefront(\n 'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n `#graphql\n query AllLocalizations @inContext(language: EN) {\n localization {\n availableCountries {\n isoCode\n name\n availableLanguages {\n isoCode\n endonymName\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query AllLocalizations @inContext(language: EN) {\n localization {\n availableCountries {\n isoCode\n name\n availableLanguages {\n isoCode\n endonymName\n }\n }\n }\n}"
input: null
response: {
"data": {
"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": "US",
"name": "United States",
"availableLanguages": [
{
"isoCode": "EN",
"endonymName": "English"
},
{
"isoCode": "ES",
"endonymName": "Español"
}
]
}
]
}
},
"extensions": {
"context": {
"country": "US",
"language": "EN"
}
}
}