# Topic covered
* Accessing Shopify Backend Data via API
* Admin API
* Storefront API
* REST Admin API
* GraphQL Admin API
* General Steps to Access Shopify Store Data via API
* Custom App (formerly Private App)
* Public App
Accessing Shopify Backend Data via API
Accessing Shopify store data using its API is a fundamental skill for anyone building apps, integrations, or custom tools for Shopify merchants.
Shopify provides two primary APIs for this purpose:
1. Admin API
Used for managing a Shopify store’s backend data (products, orders, customers, inventory, etc.). This is what most apps interact with.
It comes in two flavors:
- REST Admin API
- GraphQL Admin API
# Requirements:
A Shopify Partner account or store admin access
Create a custom app in the Shopify admin
Get API credentials (API key + secret, or an access token for private/custom apps)
2. Storefront API (GraphQL only)
Designed for building custom storefronts or experiences (e.g., mobile apps, headless commerce) where you need to display product information, manage carts, and enable checkouts directly to customers. It does not require authentication from the buyer’s perspective.
Limited to public-facing data (no order details, no payments).
REST VS GraphQL in Shopify
REST Admin API
A traditional RESTful API with distinct endpoints for each resource
The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide
GraphQL Admin API
A more modern, flexible API that allows you to request exactly the data you need in a single query. Shopify is increasingly pushing developers towards GraphQL.
GraphQL is Shopify’s technology of choice for building APIs. GraphQL addresses several problems that might sound familiar to anyone who’s worked with a REST API.
- Benefits of GraphQL
- Work with multiple resources in a single query or mutation
- Request only the data that you need
Rate Limits:
Shopify enforces API call limits to protect its infrastructure:
- REST: Bucket system (e.g., 40 calls per app per store per second)
- GraphQL: Cost-based system (1000 cost points per minute)
General Steps to Access Shopify Store Data via API
All API usage happens through Shopify applications, created by either shop owners for their own shops, or by Shopify Partners for use by other shop owners:
- Custom App (formerly Private App)
- Shop owners can create applications for themselves through their own admin
- http://docs.shopify.com/api/tutorials/creating-a-private-app
- Public App
- Shopify Partners create applications through their admin
- http://app.shopify.com/services/partners
Custom App (formerly Private App)
Directly using Store Account
For a single store, or for development/testing.
These are created directly within a Shopify store's admin.
Must have - Shopify Store
This comes with some limitation - Cannot access Protected customer data in Basic Plan
- To access Custom Level 2 PII apps, your store must be on the
Grow plan or higher
Get API Credentials (Access Token, API Key, Shared Secret)
- Log in to your Shopify store admin
- Go to Settings > Apps and sales channels > Developers App
- Click Create an app. Give it a name (e.g., “My API Test App”)
- Go to the Configuration tab
- Under “Admin API integration,” click Configure.
- Select the necessary API access scopes (permissions). This is crucial. For example, to read products, you’d select read_products. To read orders, read_orders. Be as specific as possible.
- Click Save.
- Go to the API credentials tab.
- Click Install app.
- Crucially, click “Reveal token once” under “Admin API access token.” Copy this token immediately and save it securely. Shopify will only show it to you once. This is your Admin API Access Token (sometimes called an API password for custom apps). You’ll also see your API Key and API Secret Key (which is also the webhook shared secret).
Congrats - Now you can use shopify API to access store data
https://shopify.dev/docs/api/admin-graphql
# Get the ID and title of the three most recently added products
curl -X POST https://{store_name}.myshopify.com/admin/api/2025-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "{
products(first: 3) {
edges {
node {
id
title
}
}
}