{
  "openapi": "3.0.1",
  "info": {
    "title": "Google News Scraper & AI Sentiment Analysis (Bolivia & LatAm)",
    "description": "Rastreo en tiempo real de más de 30 periódicos y cadenas de TV de Bolivia y LatAm. Extrae artículos completos, fotos de portada y audita reputación con IA Multi-Proveedor: Groq (Llama 3.3), OpenRouter, Gemini y GPT-4o mini.",
    "version": "0.0",
    "x-build-id": "T9ItjowltNakgfzPU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/reymon~news-sentiment-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-reymon-news-sentiment-ai",
        "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/reymon~news-sentiment-ai/runs": {
      "post": {
        "operationId": "runs-sync-reymon-news-sentiment-ai",
        "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/reymon~news-sentiment-ai/run-sync": {
      "post": {
        "operationId": "run-sync-reymon-news-sentiment-ai",
        "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": [
          "query"
        ],
        "properties": {
          "query": {
            "title": "Término de búsqueda / Persona",
            "type": "string",
            "description": "Nombre de la figura pública, autoridad, empresa o tema a monitorear en prensa (ej. 'Juan Pérez', 'Ministerio de Economía', 'Banco Unión')."
          },
          "country": {
            "title": "País objetivo",
            "enum": [
              "BO",
              "AR",
              "CL",
              "PE",
              "CO",
              "MX",
              "ES",
              "US"
            ],
            "type": "string",
            "description": "Código de país para el monitoreo de medios.",
            "default": "BO"
          },
          "maxArticles": {
            "title": "Cantidad máxima de noticias",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Número máximo de artículos a rastrear y analizar con IA.",
            "default": 10
          },
          "aiProvider": {
            "title": "Proveedor de Inteligencia Artificial",
            "enum": [
              "groq",
              "bai",
              "openrouter",
              "gemini",
              "openai"
            ],
            "type": "string",
            "description": "Selecciona qué Inteligencia Artificial deseas usar para auditar la reputación.",
            "default": "groq"
          },
          "apiKey": {
            "title": "API Key de la IA",
            "type": "string",
            "description": "Ingresa tu clave de Groq (gsk_...), B.AI (bai_...), OpenRouter (sk-or-...), Gemini (AIzaSy...) o OpenAI (sk-...). Si la dejas vacía, se usará la clave configurada en las variables de entorno."
          },
          "aiModel": {
            "title": "Modelo de IA específico (Opcional)",
            "type": "string",
            "description": "Opcional: puedes personalizar el modelo exacto (ej. 'DeepSeek V3.2', 'Qwen3.8-Flash', 'openai/gpt-oss-120b', 'gpt-4o-mini', 'gemini-3.6-flash'). Si lo dejas vacío, se usará el modelo optimizado por defecto automáticamente."
          },
          "additionalKeywords": {
            "title": "Palabras clave adicionales (Opcional)",
            "type": "string",
            "description": "Palabras clave separadas por comas (ej. 'Warnes, elecciones, justicia' o apodos) para afinar o ampliar la búsqueda."
          },
          "keywordMode": {
            "title": "Modo de palabras clave",
            "enum": [
              "AND",
              "OR"
            ],
            "type": "string",
            "description": "Elige 'AND' para filtrar temas específicos (menos ruido), o 'OR' para buscar variantes/sinónimos (más noticias).",
            "default": "AND"
          },
          "excludeKeywords": {
            "title": "Palabras a excluir (Opcional)",
            "type": "string",
            "description": "Palabras que NO deben aparecer en las noticias, separadas por comas (ej. 'futbol, farandula')."
          },
          "customPrompt": {
            "title": "Instrucciones personalizadas para la IA (Opcional)",
            "type": "string",
            "description": "Instrucciones o reglas específicas para que la IA juzgue el sentimiento y relevancia según tu enfoque o intereses del cliente. Ejemplos:\n- 'Considerar negativo si se le vincula a denuncias de corrupción o juicios'.\n- 'Enfoque empresarial: evaluar solvencia, inversiones y quejas de clientes; ignorar farándula'.\n- 'Enfoque ambiental: evaluar estricto cumplimiento ecológico y acuerdos con comunidades originarias'."
          },
          "filterIrrelevant": {
            "title": "Filtrar noticias irrelevantes con IA (Recomendado)",
            "type": "boolean",
            "description": "Descarta automáticamente noticias donde la persona o empresa solo fue nombrada en enlaces sugeridos, barras laterales o menciones accidentales, entregando solo notas que traten realmente sobre el tema.",
            "default": true
          },
          "dateRange": {
            "title": "Ventana de tiempo",
            "enum": [
              "all",
              "1d",
              "7d",
              "30d",
              "1y"
            ],
            "type": "string",
            "description": "Filtrar noticias por antigüedad reciente.",
            "default": "all"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}