{
  "openapi": "3.0.1",
  "info": {
    "title": "Review Radar",
    "description": "Turn Google Maps reviews into an actionable intelligence report — ranked complaints with fixes, praises, trend alerts and a reputation score.",
    "version": "0.0",
    "x-build-id": "H54Uus7qYpFU6foA1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alijosecruz~review-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alijosecruz-review-radar",
        "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/alijosecruz~review-radar/runs": {
      "post": {
        "operationId": "runs-sync-alijosecruz-review-radar",
        "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/alijosecruz~review-radar/run-sync": {
      "post": {
        "operationId": "run-sync-alijosecruz-review-radar",
        "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": [
          "openaiApiKey"
        ],
        "properties": {
          "placeUrl": {
            "title": "URL del negocio en Google Maps",
            "type": "string",
            "description": "Pega la URL COMPLETA del negocio. Ábrelo en Google Maps haciendo clic en su ficha y copia la URL larga (la que contiene '/data=...!1s0x...'). Si no tienes la URL, usa el campo Place ID más abajo."
          },
          "placeId": {
            "title": "Place ID (alternativa a la URL)",
            "type": "string",
            "description": "Identificador único del local en Google (empieza con 'ChIJ...'). Úsalo si prefieres no pegar la URL. Solo necesitas uno de los dos: URL o Place ID."
          },
          "maxReviews": {
            "title": "Reseñas a analizar",
            "minimum": 20,
            "maximum": 2000,
            "type": "integer",
            "description": "Cuántas reseñas analizar (las más recientes primero). Recomendado 150+ para un análisis robusto: muchas reseñas son solo estrellas sin texto, así que cuantas más, mejor calidad del reporte.",
            "default": 150
          },
          "language": {
            "title": "Idioma del reporte",
            "enum": [
              "es",
              "en",
              "pt",
              "fr",
              "de",
              "it"
            ],
            "type": "string",
            "description": "Idioma en el que se entregará TODO el reporte, incluidas las citas de las reseñas (se traducen automáticamente).",
            "default": "es"
          },
          "industry": {
            "title": "Tipo de negocio",
            "enum": [
              "auto",
              "restaurant",
              "retail",
              "hotel",
              "clinic",
              "services",
              "other"
            ],
            "type": "string",
            "description": "Afina la categorización de quejas y elogios al rubro. 'Detectar automáticamente' funciona bien en la mayoría de casos.",
            "default": "auto"
          },
          "competitorUrl": {
            "title": "URL de competidor (opcional)",
            "type": "string",
            "description": "Activa el análisis comparativo lado a lado. Pega la URL completa de Google Maps de un competidor para ver cómo te comparas dimensión por dimensión."
          },
          "trendAnalysis": {
            "title": "Análisis de tendencia",
            "type": "boolean",
            "description": "Detecta qué mejoró o empeoró en los últimos 30 días frente a reseñas anteriores. Alerta temprana de problemas emergentes.",
            "default": true
          },
          "outputPdf": {
            "title": "Generar reporte PDF",
            "type": "boolean",
            "description": "Genera un reporte descargable listo para presentar a un cliente final (próximamente).",
            "default": false
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "Tu clave de OpenAI (empieza con 'sk-...'). Consíguela en platform.openai.com/api-keys. La cuenta debe tener saldo disponible."
          },
          "apifyApiToken": {
            "title": "Apify API Token (optional)",
            "type": "string",
            "description": "Leave blank in most cases — Review Radar fetches reviews automatically. Only paste your Apify token (apify_api_...) if a run reports a permissions error. Get it at console.apify.com/settings/integrations."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}