agentsclimarketplace

Shopify rate limits

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/shopify-pack/skills/shopify-rate-limits

'Handle Shopify API rate limits for both REST (leaky bucket) and GraphQL (calculated query cost).From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill shopify-rate-limits

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.4 KB, 950 tokens by cl100k_base, as published. Nobody here has run it

Shopify Rate Limits

Overview

Shopify uses two distinct rate limiting systems: leaky bucket for REST and calculated query cost for GraphQL. This skill covers both with real header values and response shapes.

Prerequisites

  • Understanding of Shopify's REST and GraphQL Admin APIs
  • Familiarity with the @shopify/shopify-api library

Instructions

Step 1: Understand the Two Rate Limit Systems

REST Admin API -- Leaky Bucket:

PlanBucket SizeLeak Rate
Standard40 requests2/second
Shopify Plus80 requests4/second

The X-Shopify-Shop-Api-Call-Limit header shows your bucket state (e.g., 32/40 means 32 of 40 slots used). When full, you get HTTP 429 with Retry-After header.

GraphQL Admin API -- Calculated Query Cost:

PlanMax AvailableRestore Rate
Standard1,000 points50 points/second
Shopify Plus2,000 points100 points/second

Every GraphQL response includes cost info in extensions.cost with requestedQueryCost (worst-case estimate), actualQueryCost (real cost, often much lower), and throttleStatus (available points and restore rate). When currentlyAvailable drops to 0, you get THROTTLED.

Step 2: Implement GraphQL Cost-Aware Throttling

Client-side rate limiter that tracks the query cost bucket and pre-emptively waits before sending requests that would be throttled. Updates available points from each response's throttleStatus.

See Cost-Aware Rate Limiter for the complete ShopifyRateLimiter class.

Step 3: Implement Retry with Backoff for 429s

Generic retry wrapper handling both REST 429 responses and GraphQL THROTTLED errors. Uses Retry-After header when available, otherwise exponential backoff with jitter (max 30s).

See Retry with Backoff for the complete implementation.

Step 4: Reduce Query Cost

Prune unused fields and lower first: page sizes to reduce requestedQueryCost. A query dropping from first: 250 to first: 50 with fewer nested fields can go from ~5,500 to ~112 cost.

See Query Cost Reduction for before/after examples and the debug curl command.

Output

  • Rate limit-aware client that prevents 429 errors
  • Retry logic with proper backoff for both REST and GraphQL
  • Optimized queries with lower calculated cost
  • Debug headers for cost analysis

Error Handling

ScenarioREST IndicatorGraphQL Indicator
Approaching limitX-Shopify-Shop-Api-Call-Limit: 38/40currentlyAvailable < 100
At limitHTTP 429 + Retry-After: 2.0errors[0].extensions.code: "THROTTLED"
RecoveringWait for Retry-After secondsWait for restoreRate to refill

Examples

Queue-Based Bulk Operations

For large data exports, use Shopify's bulk query API which bypasses rate limits entirely:

import PQueue from "p-queue";

const BULK_QUERY = `
  mutation bulkOperationRunQuery($query: String!) {
    bulkOperationRunQuery(query: $query) {
      bulkOperation { id status url }
      userErrors { field message }
    }
  }
`;

await client.request(BULK_QUERY, {
  variables: {
    query: `{
      products {
        edges {
          node {
            id title
            variants { edges { node { id sku price } } }
          }
        }
      }
    }`,
  },
});

Resources

What ships with it: 3 files

4.4 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.