{
  "openapi": "3.0.1",
  "info": {
    "title": "App Store Top Charts & Search",
    "description": "App Store top charts scraper for storefront and genre research. Export chart rows, catalog search matches and Apple ID lookups as JSON with source links.",
    "version": "1.0",
    "x-build-id": "5Os0ys4lx46piRiSE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~apple-top-charts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-apple-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/grit-77~apple-top-charts/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-apple-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/grit-77~apple-top-charts/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-apple-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",
        "properties": {
          "mode": {
            "title": "Operation",
            "enum": [
              "charts",
              "search",
              "lookup"
            ],
            "type": "string",
            "description": "Choose country charts, catalog keyword search, or lookup by Apple ID.",
            "default": "charts"
          },
          "countries": {
            "title": "Storefront countries",
            "type": "array",
            "description": "Two-letter storefront codes. Requests are repeated for each country. Examples: us, gb, de, tr. At most 10.",
            "items": {
              "type": "string"
            },
            "default": [
              "us"
            ]
          },
          "charts": {
            "title": "Charts",
            "type": "array",
            "description": "Used in charts mode; repeated for each country and genre.",
            "items": {
              "type": "string",
              "enum": [
                "top_free_apps",
                "top_paid_apps",
                "top_podcasts",
                "top_free_books",
                "top_paid_books"
              ],
              "enumTitles": [
                "Top free apps",
                "Top paid apps",
                "Top podcasts",
                "Top free books",
                "Top paid books"
              ]
            },
            "default": [
              "top_free_apps"
            ]
          },
          "genreIds": {
            "title": "Genre IDs (charts only)",
            "type": "array",
            "description": "Optional numeric Apple genre IDs, at most 10. Uses legacy official RSS. IDs depend on media: apps 6007 = Productivity; podcasts 1318 = Technology; books 9003 = Romance. Leave empty for overall marketing charts.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "terms": {
            "title": "Search terms",
            "type": "array",
            "description": "Required in search mode. At most 50 non-empty terms, each at most 300 characters. Exact duplicates are removed.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "ids": {
            "title": "Apple IDs",
            "type": "array",
            "description": "Required in lookup mode. Up to 100 numeric Apple IDs as strings, e.g. 284882215. Each ID produces an independent lookup for each country.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "media": {
            "title": "Search media",
            "enum": [
              "software",
              "podcast",
              "ebook"
            ],
            "type": "string",
            "description": "Used in search mode; lookup returns the kind of the requested ID.",
            "default": "software"
          },
          "resultsPerQuery": {
            "title": "Results per chart or search",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "At most 100 in charts mode, 200 in search mode. Apple may return fewer; no search pagination. Lookup retrieves one requested record.",
            "default": 100
          },
          "maxItems": {
            "title": "Maximum dataset rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Global cap including diagnostics. Input order determines which requests fit. Maximum 10,000.",
            "default": 1000
          },
          "concurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum in-flight jobs. iTunes request starts, including retries, are paced at least 3.1 seconds apart within this run.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries network failures, 429, 5xx and invalid JSON with exponential backoff and bounded Retry-After. Permanent 4xx becomes a diagnostic.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each Apple HTTP attempt.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}