A collection of scripts to quickly fetch and inspect various data points from a Shopify store using the browser's console. These scripts utilize the AJAX API provided by Shopify to retrieve real-time data from the storefront.
- Navigate to your Shopify store in a web browser.
- Open the browser's developer console. (Usually
Ctrl + Shift + IorCmd + Option + I) - Copy and paste the desired script from this repository into the console.
- Hit
Enterto execute the script and view the results.
This script fetches all collections available in the store by paginating through the results to ensure complete retrieval.
Fetches the current cart data, which includes details about items added to the cart, cart attributes, and more.
Retrieves data for a specific collection using its handle. This can be useful for inspecting products within a particular collection.
Fetches data for a specific product by its handle. This provides detailed information about product variants, pricing, and other related attributes.
Gathers general data about the Shopify store, such as the shop's name, currency, email, and other metadata.
By extracting the cart's unique token, troubleshooting cart-related issues becomes more efficient, allowing for direct examination of user-reported cart anomalies by recreating the exact cart state in any browser or device. This snippet is great for diagnosing and addressing cart-specific challenges in real-time.
- This is an unauthenticated API. It doesn鈥檛 require access tokens or a client ID to access.
- There are no hard rate limits on the Ajax API. It鈥檚 still subject to Shopify鈥檚 standard API abuse-prevention measures.
- All API responses return JSON-formatted data.
- The Ajax API can鈥檛 be used to read any customer or order data, or update any store data. If you need more extensive access, check the Admin API.
Contributions are welcome! If you have additional scripts or improvements to share, please make a pull request or open an issue to discuss the changes.
This project is open source and available under the MIT License. Use these scripts responsibly and ethically.
