• Home
  • How to find Shopify product IDs, Article IDs & Page IDs

    If you are a Shopify web store owner, developer, Technical SEO or marketer. There will be times when you may need to retrieve a list of product IDs, Article IDs and Page IDs. Oddly enough Shopify only allows you this data via an API. Not everyone is familiar with the Shopify API.

    In this post, I will show you how to retrieve those IDs without the need of going through the API. I have used a popular spidering and scraping tool called Screaming Frog. Screaming Frog has a custom extraction tool built-in to allow you to scrape anything from the HTML within a webpage including the JS scripts.

    The product IDs, Article IDs and Page IDs for Shopify are listed within scripts on each of the page template types. Look closely and will spot them if you know what to look for. Using the custom extraction tool I was able to Regex extract those IDs.

    Below are the regular expressions to text match the Shopify product IDs, Article IDs and Page IDs.

    shopify-page-id.PNG

    Regex for Shopify Article ID (article.id)

    Code:
     ("articles-.*?")


    You can find the blog article ID embedded within the script shown in the Shopify analytic's image below.

    articles.PNG




    Regex for Shopify Page ID (page.id)

    Code:
     ("pages-.*?")


    You can find the page ID embedded within the script shown in the Shopify analytic's image below.

    pages.PNG




    Regex for Shopify Product ID (product.id)


    Code:
     ("productId\":.*?")


    The product ID is listed 3 times on the product pages. You only need to extract it once, if you do extract all 3 instances. Simply deleted the duplicate instances. You can find the product ID embedded within the script shown in the Shopify analytic's image below.

    product-is-shopify.PNG



    Need Help?
    If you need help extracting the ID's data from the web store you are working on or with. Let me know, I might be able to help you out. I could crawl, extract and send the data to you.
     

    New Posts