└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Shopify URL parameters and endpoints 2 | 3 | When working with Shopify URLs, you can use various query parameters and JSON endpoints to control the page behavior and interact with Shopify's storefront data. Below are some commonly used parameters and a list of useful (JSON) endpoints. 4 | 5 | ### Common Shopify URL Parameters 6 | 7 | - `?_fd=0`: Prevents domain forwarding, ensuring the URL remains unchanged when navigating between Shopify and your custom domain. 8 | - `?pb=0`: Hides the Shopify preview bar, providing a cleaner view of the page, useful for screenshots or sharing the page without the preview tools visible. 9 | - `?view=`: Allows you to load a specific alternate template view for a page, useful for testing or displaying custom views (e.g., ?view=wholesale). 10 | - `?sort_by=`: Applies a filter for the collection page, allowing users to sort or display items based on certain parameters (e.g., ?sort_by=price-ascending). 11 | - `?customer_posted=`: Used after submitting forms related to customer data (e.g., after submitting a contact form) 12 | - `?q=`: Performs a search on the store based on the query entered (e.g., ?q=shoes). 13 | - `?ab=`: Used for ? 14 | - `?sc=`: Used for ? 15 | - `?variant=`: Automatically selects a specific variant on the product page when loading (e.g., ?variant=123456789). 16 | - `?checkout[shipping_address][country]=`: Prefills checkout fields, in this case, the shipping country. 17 | - `?preview_theme_id=`: Allows you to preview a specific theme on your store without publishing it. 18 | - `?preview_privacy_banner=1`: Allows you to preview the cookie privacy banner. 19 | - `?page=`: Used for pagination on collection pages, allowing users to navigate between multiple pages of products. 20 | - `?type=`: Collection type query to filter products by specific types. 21 | - `?filter=`: Applies filtering options to collections, such as price or tag filters. 22 | - `?limit=`: Applies custom pagination limit. Useful for querying products on a store in bulk, or retrieving a small subset of products for a specific collection. 23 | - `?accelerated-checkout-preview=`: Toggle the accelerated checkout preview by setting it to true to enable or false to disable. 24 | 25 | ### Shopify (JSON) Endpoints: 26 | 27 | - `/cart/counts.json`: Retrieves the current number of items in the cart in JSON format. 28 | - `/cart.js`: Retrieves the full cart contents in JSON format, including items, quantities, and total price. 29 | - `/products/.js`: Retrieves product details in JSON format, including variants, price, and availability. 30 | - `/collections//products.json`: Retrieves a list of products within a specific collection. 31 | - `/search/suggest.json?q=&resources[type]=product`: Provides product search suggestions in JSON format based on the query. 32 | - `/pages/.json`: Retrieves details for a specific page in JSON format. 33 | - `/challenge`: Redirects to a challenge page, which Shopify uses for security purposes, like verifying the user is human when suspicious behavior is detected. 34 | - `/variants/`: Redirects to product page with variant preselected. 35 | - `/meta.json`: Retrieves store metadata. 36 | - `/browsing_context_suggestions.json`: Retrieves geolocation data. 37 | - `/products.json`: Retrieves all products on the store (paginated). 38 | 39 |
40 | 41 | **If you have any suggestions or improvements for this repository, feel free to open a pull request on GitHub!** 42 | --------------------------------------------------------------------------------