{
  "openapi": "3.0.1",
  "info": {
    "title": "Maps Reviews Issue Matrix by Location",
    "description": "Compare issue-topic prevalence across store locations from review datasets you already hold. Aggregate output only.",
    "version": "0.2",
    "x-build-id": "fbZaw6NYGRBLQTCOn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/practical_ai_lab_jp~pal-maps-reviews-issue-matrix/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-practical_ai_lab_jp-pal-maps-reviews-issue-matrix",
        "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-maps-reviews-issue-matrix/runs": {
      "post": {
        "operationId": "runs-sync-practical_ai_lab_jp-pal-maps-reviews-issue-matrix",
        "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-maps-reviews-issue-matrix/run-sync": {
      "post": {
        "operationId": "run-sync-practical_ai_lab_jp-pal-maps-reviews-issue-matrix",
        "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": {
          "reviews": {
            "title": "Inline review rows",
            "type": "array",
            "description": "Array of objects, each with a location name, review text and optionally a star rating. Reviewer names and any other fields are ignored and never stored."
          },
          "datasetIds": {
            "title": "Your Apify dataset IDs (optional)",
            "type": "array",
            "description": "IDs of datasets in your own Apify account that already contain review rows. Up to 10 datasets.",
            "items": {
              "type": "string"
            }
          },
          "locationField": {
            "title": "Location field name (optional)",
            "type": "string",
            "description": "Field holding the store or branch name. Common names such as location, placeName, title and name are tried automatically."
          },
          "textField": {
            "title": "Review text field name (optional)",
            "type": "string",
            "description": "Field holding the review text. Common names such as text, reviewText and snippet are tried automatically."
          },
          "ratingField": {
            "title": "Star rating field name (optional)",
            "type": "string",
            "description": "Field holding a 0-5 star rating. Only needed when you set a maximum rating filter."
          },
          "topics": {
            "title": "Built-in issue topics",
            "type": "array",
            "description": "Subset of built-in topics: wait_time, staff_attitude, cleanliness, price_value, product_quality, order_accuracy, noise_crowding, parking_access, safety_hygiene, billing_issues. Leave empty to use all.",
            "items": {
              "type": "string"
            }
          },
          "customTopics": {
            "title": "Custom topics (optional)",
            "type": "object",
            "description": "Object mapping a topic name (lowercase letters, digits, underscore) to a list of keywords or phrases. A trailing * matches any word ending, e.g. \"refund*\"."
          },
          "maxRating": {
            "title": "Only reviews up to this star rating (optional)",
            "minimum": 1,
            "maximum": 5,
            "type": "number",
            "description": "When set, only reviews with a rating at or below this value are analyzed. Reviews without a rating are skipped."
          },
          "minReviewsPerLocation": {
            "title": "Minimum reviews per location",
            "minimum": 5,
            "maximum": 100000,
            "type": "integer",
            "description": "For real comparison use at least 30 reviews per location (100+ recommended); sample preview uses 5 per location and will be flagged small_sample.",
            "default": 30
          },
          "minCellCount": {
            "title": "Minimum mentions shown per cell",
            "minimum": 2,
            "maximum": 1000,
            "type": "integer",
            "description": "Cells with between 1 and this value minus 1 mentions are suppressed to avoid exposing single reviews.",
            "default": 5
          },
          "minDifferencePoints": {
            "title": "Minimum difference in percentage points",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "A difference is flagged only if it is statistically clear and at least this many percentage points.",
            "default": 5
          },
          "fdrAlpha": {
            "title": "False discovery rate level",
            "minimum": 0.001,
            "maximum": 0.5,
            "type": "number",
            "description": "Benjamini-Hochberg threshold applied across all tested location-topic cells.",
            "default": 0.05
          },
          "maxReviews": {
            "title": "Maximum review rows to read",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Safety cap on rows read across all sources.",
            "default": 50000
          },
          "maxLocations": {
            "title": "Maximum distinct locations",
            "minimum": 2,
            "maximum": 1000,
            "type": "integer",
            "description": "Rows of further new locations beyond this cap are skipped and counted.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}