{
  "openapi": "3.0.1",
  "info": {
    "title": "PROFECO Buró Comercial Scraper",
    "description": "Search Mexican companies in PROFECO Buró Comercial and export complaint breakdowns: yearly stats, conciliation rates, and claim motives. Great for due diligence and risk checks.",
    "version": "0.1",
    "x-build-id": "WsZEU8AaG5iaLVBWU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fateful_zebec~profeco-buro-comercial/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fateful_zebec-profeco-buro-comercial",
        "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/fateful_zebec~profeco-buro-comercial/runs": {
      "post": {
        "operationId": "runs-sync-fateful_zebec-profeco-buro-comercial",
        "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/fateful_zebec~profeco-buro-comercial/run-sync": {
      "post": {
        "operationId": "run-sync-fateful_zebec-profeco-buro-comercial",
        "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": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Empresas a buscar",
            "type": "array",
            "description": "Nombres comerciales o razones sociales. Se normalizan solos (sin acentos, sin SA DE CV, etc.). Ej: WALMART, Grupo Raíz, COPPEL.",
            "items": {
              "type": "string"
            }
          },
          "giro": {
            "title": "Filtro por giro comercial",
            "type": "string",
            "description": "Opcional. Filtra por giro (ej. TIENDAS DE AUTOSERVICIO).",
            "default": ""
          },
          "exactMatch": {
            "title": "Exact match",
            "type": "boolean",
            "description": "Si está activo, solo devuelve coincidencias exactas (o casi exactas: mismo nombre normalizado / prefijo de marca).",
            "default": true
          },
          "bestMatch": {
            "title": "Best match",
            "type": "boolean",
            "description": "Si está activo, devuelve solo el mejor resultado por cada query (mayor matchScore; empate por más quejas).",
            "default": true
          },
          "maxResultsPerQuery": {
            "title": "Máx. resultados por búsqueda",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Solo aplica si Best match está desactivado. Máximo de proveedores por query.",
            "default": 10
          },
          "includeBreakdown": {
            "title": "Desglosar quejas por año",
            "type": "boolean",
            "description": "IMPORTANTE: actívalo para ver quejas por año, conciliadas/no conciliadas y motivos. Si está apagado solo verás el total histórico del listado.",
            "default": true
          },
          "yearFrom": {
            "title": "Año desde",
            "enum": [
              "2000",
              "2001",
              "2002",
              "2003",
              "2004",
              "2005",
              "2006",
              "2007",
              "2008",
              "2009",
              "2010",
              "2011",
              "2012",
              "2013",
              "2014",
              "2015",
              "2016",
              "2017",
              "2018",
              "2019",
              "2020",
              "2021",
              "2022",
              "2023",
              "2024",
              "2025",
              "2026"
            ],
            "type": "string",
            "description": "Primer año del desglose (incluido). Lista 2000–2026.",
            "default": "2019"
          },
          "yearTo": {
            "title": "Año hasta",
            "enum": [
              "2000",
              "2001",
              "2002",
              "2003",
              "2004",
              "2005",
              "2006",
              "2007",
              "2008",
              "2009",
              "2010",
              "2011",
              "2012",
              "2013",
              "2014",
              "2015",
              "2016",
              "2017",
              "2018",
              "2019",
              "2020",
              "2021",
              "2022",
              "2023",
              "2024",
              "2025",
              "2026"
            ],
            "type": "string",
            "description": "Último año del desglose (incluido). Lista 2000–2026. Debe ser ≥ Año desde.",
            "default": "2026"
          },
          "allYears": {
            "title": "Ignorar rango (todos los años del proveedor)",
            "type": "boolean",
            "description": "Si está activo, ignora Año desde/hasta y desglosa todos los años que PROFECO tenga para esa empresa (hasta el tope de Máx. años).",
            "default": false
          },
          "maxYearsPerProvider": {
            "title": "Máx. años por proveedor",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Tope de seguridad al desglosar (años más recientes primero).",
            "default": 20
          },
          "includeRegionalBreakdown": {
            "title": "Desglose por zona/oficina",
            "type": "boolean",
            "description": "Además del nacional, obtiene quejas por cada unidad administrativa PROFECO. Mucho más lento.",
            "default": false
          },
          "requestDelayMs": {
            "title": "Delay entre requests (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Pausa entre llamadas a PROFECO.",
            "default": 400
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}