f you're involved in running, developing, or marketing a Shopify web store - whether as an owner, developer, or technical SEO specialist - you'll likely find occasions where retrieving a list of product ID's, article ID's, and page ID's becomes necessary. However, it can be puzzling that Shopify only makes this data accessible through an API. While this can be a stumbling block for those unfamiliar with the Shopify API, there are alternatives.
In this blog post, I'll guide you through a method of procuring these ID's without the need to navigate through the API. The strategy involves using a widely recognised tool called Screaming Frog. It's a powerful spidering and scraping tool that features a custom extraction function, allowing you to scrape practically anything from the HTML within a webpage, including JavaScript scripts.
The vital information - product ID's, article ID's, and page ID's - for Shopify can typically be found within scripts on each respective page template. With a discerning eye and a little familiarity, you can quickly identify them. Using Screaming Frog's custom extraction tool and regular expressions (regex), I was able to extract these IDs successfully.
Here are the specific regular expressions I used to match and extract the Shopify product ID's, article ID's, collection ID's and page ID's:
Shopify Article ID (article.id) Regex
Shopify Page ID (page.id) Regex
Shopify Collections ID (collectionId) Regex
Shopify Product ID (product.id) Regex
The product ID is listed thrice on the product pages, but you only need to extract it once. If you inadvertently extract all three instances, simply delete the duplicates.
Should you require any assistance in extracting these ID's from the web store you're currently working on, please feel free to reach out. I would be more than happy to lend a hand. I can perform the crawl, extract the data, and send it your way if needed. If you need Shopify SEO support, reach out to me.
In this blog post, I'll guide you through a method of procuring these ID's without the need to navigate through the API. The strategy involves using a widely recognised tool called Screaming Frog. It's a powerful spidering and scraping tool that features a custom extraction function, allowing you to scrape practically anything from the HTML within a webpage, including JavaScript scripts.
The vital information - product ID's, article ID's, and page ID's - for Shopify can typically be found within scripts on each respective page template. With a discerning eye and a little familiarity, you can quickly identify them. Using Screaming Frog's custom extraction tool and regular expressions (regex), I was able to extract these IDs successfully.
Here are the specific regular expressions I used to match and extract the Shopify product ID's, article ID's, collection ID's and page ID's:
Shopify Article ID (article.id) Regex
Code:
("articles-.*?")
Shopify Page ID (page.id) Regex
Code:
("pages-.*?")
Shopify Collections ID (collectionId) Regex
Code:
"collectionId":(\d+)
Shopify Product ID (product.id) Regex
Code:
("productId\":.*?")
The product ID is listed thrice on the product pages, but you only need to extract it once. If you inadvertently extract all three instances, simply delete the duplicates.
Should you require any assistance in extracting these ID's from the web store you're currently working on, please feel free to reach out. I would be more than happy to lend a hand. I can perform the crawl, extract the data, and send it your way if needed. If you need Shopify SEO support, reach out to me.
Last edited: