Some Shopify storefronts expose a Shopify.country value in their HTML. You can extract that two-letter code from a list of store URLs with Datablist's Bulk Scraper. It describes the storefront context served in the page, not necessarily the merchant's registered country or headquarters.
In this article, you will learn:
How to find the storefront country code manually
Open a store page, view its HTML source, and search for Shopify.country. If you find a value such as Shopify.country = "US", US is the code you can extract. If it is absent, this method will not return a code; do not infer one from the store's domain alone.
How to extract country codes from Shopify stores in bulk
Now, to extract country codes in bulk, you need to automate this process.
Use Datablist's Bulk Scraper to search each store's HTML with a regular expression.
First, import your list of Shopify stores in Datablist CSV Editor.
Then, click on the "Enrich" button in the header.
Select the Bulk Scraper enrichment. The Bulk Scraper will open each store using the Shopify URL and extract the country code from the HTML source code.
In the scraper configuration, enable regular expression extraction and enter this pattern in Regex #1:
Shopify\.country\s*=\s*["']([A-Za-z]{2})["']The capture group returns the two-letter code, rather than the entire assignment. Check the page source first: storefronts that use another variable or render the value only after JavaScript runs will need a different extraction method.
Then, continue to configure the outputs. Create new properties to store the Regex Text #1.
You can also add the URL Scraping Status output to know when a store is no longer online.
Run the Bulk Scraper on a small sample first. Compare a few codes with the source HTML and review the scraping status for missing or inaccessible pages before processing the whole list.
If you need the company's legal location for lead qualification, verify it from a reliable company source. The storefront code alone is not that evidence.






