{
  "openapi": "3.0.1",
  "info": {
    "title": "Shopify Best-Seller Rank Movement Tracker",
    "description": "Enter one Shopify store URL. The first run saves a best-selling rank baseline; every later run reports rank climbers, fallers, new entrants and drop-offs with severity, plus a CSV rank history.",
    "version": "0.1",
    "x-build-id": "qbsSodKrUFFnjyFTT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/practical_ai_lab_jp~pal-shopify-bestseller-rank-movement-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-practical_ai_lab_jp-pal-shopify-bestseller-rank-movement-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/practical_ai_lab_jp~pal-shopify-bestseller-rank-movement-tracker/runs": {
      "post": {
        "operationId": "runs-sync-practical_ai_lab_jp-pal-shopify-bestseller-rank-movement-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/practical_ai_lab_jp~pal-shopify-bestseller-rank-movement-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-practical_ai_lab_jp-pal-shopify-bestseller-rank-movement-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "storeUrl"
        ],
        "properties": {
          "storeUrl": {
            "title": "Shopify store URL",
            "type": "string",
            "description": "One public HTTPS storefront URL, for example the rival brand you want to watch. Only the host name is used; paths and query strings are ignored. Plain http://, IP addresses, ports and credentials in the URL are rejected."
          },
          "collectionHandles": {
            "title": "Collection handles (optional)",
            "type": "array",
            "description": "Track specific collections, for example <code>all</code> or <code>new-arrivals</code>. Leave empty to track the store-wide <code>all</code> collection plus the largest collections found in the public collection list.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxCollections": {
            "title": "Maximum collections",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Upper bound on collections tracked per run, including the store-wide collection.",
            "default": 5
          },
          "maxProductsPerCollection": {
            "title": "Products ranked per collection",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "How many top positions of each collection are ranked and compared. Larger windows cost more requests and storage.",
            "default": 100
          },
          "maxRequests": {
            "title": "Maximum HTTP requests per run",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "Hard cap on requests to the store, including robots.txt. The run stops cleanly when it is reached.",
            "default": 30
          },
          "minRankChange": {
            "title": "Minimum rank change to report",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Smaller position changes are treated as noise and not reported.",
            "default": 3
          },
          "topTierSize": {
            "title": "Top-tier size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Positions 1 to this value count as the top tier. Entering or leaving the top tier raises severity.",
            "default": 10
          },
          "rankBasisPolicy": {
            "title": "Rank source policy",
            "enum": [
              "auto",
              "best_selling_only",
              "default_order_only"
            ],
            "type": "string",
            "description": "<b>auto</b> uses the best-selling sort when the store's robots.txt allows it and otherwise falls back to the collection's default order (clearly labelled in the output). <b>best_selling_only</b> never falls back. <b>default_order_only</b> tracks merchant-controlled placement only.",
            "default": "auto"
          },
          "historySnapshots": {
            "title": "Snapshots kept in history",
            "minimum": 2,
            "maximum": 12,
            "type": "integer",
            "description": "How many snapshots per store are kept in persisted state and in the CSV rank history.",
            "default": 8
          },
          "requestDelaySeconds": {
            "title": "Delay between requests (seconds)",
            "minimum": 0.5,
            "maximum": 10,
            "type": "number",
            "description": "Minimum pause between requests to the store.",
            "default": 1
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that keeps one baseline per store domain so later runs can compare against it. Use the same name on every scheduled run. Deleting the store resets all baselines.",
            "default": "pal-shopify-rank-tracker-state"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}