How to fetch collection data and display as section on the store - Need Help

Shogun28
Visitor
1 0 0

I'm just starting with Shopify and I'm a little overwhelmed with all the information.

What I need is to fetch the data for a certain collection from the endpoint:

https://admin.shopify.com/store/{store-name}/collections/{collection-id}/products.json

 

Then I need to display a few of the products in a section on one of my store's pages. The problem I encounter is that this endpoint obviously needs some sort of authentication and I don't know how to authenticate my request.

So far, I've been reading the docs and I believe I need to make a theme app extension maybe, but I'm still not exactly sure how to fetch the data properly. Do I fetch it from the App itself and pass it to the extension somehow or am I completely missing the point?

Any help would be appreciated, thanks!

Reply 1 (1)

PageFly-Theodor
Globetrotter
503 68 75

Hi @Shogun28 ,
This is Theodore from PageFly - Shopify Page Builder App.

 

- To fetch data from Shopify, you need to authenticate using your API key and password.

- Use a theme app extension to access data within the theme without exposing your API key.
- Fetch data in the app's controller using Shopify's built-in API client or a library like shopify_api.
- Pass data to the extension using Liquid variables or JSON.
- Consider security, caching, using libraries, and referring to Shopify documentation.

 

Best regards,
Theodore | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.