{
  "openapi": "3.0.1",
  "info": {
    "title": "App Store Top Charts & Rank Tracker",
    "description": "Apple App Store top charts for any country and category with rank history, movers and app details.",
    "version": "0.1",
    "x-build-id": "VtNpgCzVYO5UsH9fj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datawright-labs~app-store-top-charts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datawright-labs-app-store-top-charts",
        "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/datawright-labs~app-store-top-charts/runs": {
      "post": {
        "operationId": "runs-sync-datawright-labs-app-store-top-charts",
        "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/datawright-labs~app-store-top-charts/run-sync": {
      "post": {
        "operationId": "run-sync-datawright-labs-app-store-top-charts",
        "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": [
          "countries",
          "charts"
        ],
        "properties": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter App Store country codes (ISO 3166), e.g. us, gb, de, fr, jp, br, in, ca, au. Each country has its own charts.",
            "default": [
              "us"
            ],
            "items": {
              "type": "string"
            }
          },
          "charts": {
            "title": "Charts",
            "type": "array",
            "description": "Which App Store charts to collect. Top grossing ranks apps by revenue (in-app purchases and subscriptions included).",
            "items": {
              "type": "string",
              "enum": [
                "top-free",
                "top-paid",
                "top-grossing",
                "top-free-ipad",
                "top-paid-ipad",
                "top-grossing-ipad"
              ],
              "enumTitles": [
                "Top Free (iPhone)",
                "Top Paid (iPhone)",
                "Top Grossing (iPhone)",
                "Top Free (iPad)",
                "Top Paid (iPad)",
                "Top Grossing (iPad)"
              ]
            },
            "default": [
              "top-free",
              "top-paid",
              "top-grossing"
            ]
          },
          "genres": {
            "title": "Categories",
            "type": "array",
            "description": "Optional App Store categories (genres). Each selected category is collected as its own chart in addition to the overall 'All apps' chart. Leave empty for the overall charts only.",
            "items": {
              "type": "string",
              "enum": [
                "6000",
                "6001",
                "6002",
                "6003",
                "6004",
                "6005",
                "6006",
                "6007",
                "6008",
                "6009",
                "6010",
                "6011",
                "6012",
                "6013",
                "6014",
                "6015",
                "6016",
                "6017",
                "6018",
                "6020",
                "6023",
                "6024",
                "6026",
                "6027",
                "7001",
                "7002",
                "7003",
                "7004",
                "7005",
                "7006",
                "7009",
                "7011",
                "7012",
                "7013",
                "7014",
                "7015",
                "7016",
                "7017",
                "7018",
                "7019"
              ],
              "enumTitles": [
                "Business (6000)",
                "Weather (6001)",
                "Utilities (6002)",
                "Travel (6003)",
                "Sports (6004)",
                "Social Networking (6005)",
                "Reference (6006)",
                "Productivity (6007)",
                "Photo & Video (6008)",
                "News (6009)",
                "Navigation (6010)",
                "Music (6011)",
                "Lifestyle (6012)",
                "Health & Fitness (6013)",
                "Games (6014)",
                "Finance (6015)",
                "Entertainment (6016)",
                "Education (6017)",
                "Books (6018)",
                "Medical (6020)",
                "Food & Drink (6023)",
                "Shopping (6024)",
                "Developer Tools (6026)",
                "Graphics & Design (6027)",
                "Games: Action (7001)",
                "Games: Adventure (7002)",
                "Games: Casual (7003)",
                "Games: Board (7004)",
                "Games: Card (7005)",
                "Games: Casino (7006)",
                "Games: Family (7009)",
                "Games: Music (7011)",
                "Games: Puzzle (7012)",
                "Games: Racing (7013)",
                "Games: Role Playing (7014)",
                "Games: Simulation (7015)",
                "Games: Sports (7016)",
                "Games: Strategy (7017)",
                "Games: Trivia (7018)",
                "Games: Word (7019)"
              ]
            },
            "default": []
          },
          "includeOverall": {
            "title": "Include overall (all apps) chart",
            "type": "boolean",
            "description": "Also collect the overall chart when categories are selected. Turn off to get only the category charts.",
            "default": true
          },
          "limit": {
            "title": "Ranks per chart",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many top positions to save per chart (1-100; Apple publishes the top 100).",
            "default": 100
          },
          "enrich": {
            "title": "Add app details (rating, reviews, version...)",
            "type": "boolean",
            "description": "Look up every charted app in Apple's iTunes Lookup API: average rating, rating count, current version and its release date, formatted price, content rating, size, languages, seller. Batched (100 apps per request), adds only seconds.",
            "default": true
          },
          "trackRankChanges": {
            "title": "Track rank changes between runs",
            "type": "boolean",
            "description": "Save each chart snapshot in a named key-value store in your account ('app-store-top-charts-history') and compare with the previous run: previous rank, rank change, up/down/new/re-entry, best rank, rank history. Schedule the Actor (e.g. daily) to build a rank history.",
            "default": true
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "all",
              "changes"
            ],
            "type": "string",
            "description": "'All entries' saves every chart position. 'Only changes' saves just movers: new entries, re-entries, dropped apps and rank changes of at least the minimum below (you pay only for those rows). The first run in 'Only changes' mode saves a baseline and returns no rows.",
            "default": "all"
          },
          "minRankChange": {
            "title": "Minimum rank change (Only changes mode)",
            "minimum": 1,
            "maximum": 99,
            "type": "integer",
            "description": "In 'Only changes' mode, report an app that stayed on the chart only if it moved at least this many positions.",
            "default": 1
          },
          "includeDropped": {
            "title": "Include apps that dropped out",
            "type": "boolean",
            "description": "Add a row (movement = 'dropped') for each app that was in the previous snapshot's top N but isn't any more. Its current rank is filled in if it's still in the top 100.",
            "default": false
          },
          "historyKey": {
            "title": "History name",
            "type": "string",
            "description": "Separate rank histories, e.g. one per client or schedule. Runs with the same name compare with each other.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed normally: Apple's public feeds work without a proxy. Use it only if you see repeated HTTP 403/429 errors.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}