Pulling external data onto a shopify custom created page

9 0 0


I tried looking or a direct solution on this and couldn't find.   Thought I'll post here.  We have some external data we want to pull in on a new custom page in shopify instead of customers jumping from site to site.    This database resides externally on a sql server database.     I understand we can use APIs to pull information out of shopify.   But, can we take advantage of shopify scripting /ruby script or javascript on  a new html page, so it can connect to an external database and run a query and get that info to a new shopify page?

Shopify Partner
25 0 24

We have the exact question.  Did you ever get this worked out?

85 4 14

I also have that same question and would love to have some feedback from anyone if this is possible. I can see that WooCommerce does have this functionality and it would be good to know how to do it in Shopify as well. Here is the link to how this is done in WooCommerce.


85 4 14

This is an accepted solution.

It turns out this is very easy to do within Shopify. You can use fetch to reach out to an external API and this returns data to inside the Shopify app.

Here is an example that I have working inside my server.js file which reaches out to the external API on github that returns users. The user data is returned to Shopify and printed out in the console in this example. 

//call the fetch function
async function getData()
        //await the response of the fetch call
               let response = await fetch('https://api.github.com/users');
        //proceed once the first promise is resolved.
       let data = await response.json()
        //proceed only when the second promise is resolved
        return data;
//call getData function
.then(data => console.log(data));//log the data