{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Complaints & Company Reputation Scraper",
    "description": "Official consumer complaint data and company reputation for 2,000+ Brazilian companies from Consumidor.gov.br (government, not Reclame Aqui). Complaints, solution rate, satisfaction, response time and rankings by sector or brand: banks, telecoms, health plans. No complaint texts or consumer data.",
    "version": "0.1",
    "x-build-id": "eQAaPEYE90aSQvL18"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/responsible_front_evw~consumidor-gov-br-company-complaints/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-responsible_front_evw-consumidor-gov-br-company-complaints",
        "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/responsible_front_evw~consumidor-gov-br-company-complaints/runs": {
      "post": {
        "operationId": "runs-sync-responsible_front_evw-consumidor-gov-br-company-complaints",
        "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/responsible_front_evw~consumidor-gov-br-company-complaints/run-sync": {
      "post": {
        "operationId": "run-sync-responsible_front_evw-consumidor-gov-br-company-complaints",
        "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": {
          "segments": {
            "title": "Sectors",
            "type": "array",
            "description": "Sectors as listed on Consumidor.gov.br, in English or Portuguese, or part of the name: Telecoms, Banks, Health insurance plans, E-commerce, Airlines, Insurance, Electricity, Retail, Supermercados... Leave empty for all sectors.",
            "items": {
              "type": "string"
            }
          },
          "companyNames": {
            "title": "Brand or company name contains",
            "type": "array",
            "description": "Optional: one or more words matched against the brand name on the platform (accents and case ignored), for example Nubank, Mercado Livre, Amazon. Note that 'Amazon' also matches 'Banco da Amazonia'.",
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "title": "Periods for the company indicators",
            "type": "array",
            "description": "One block of fields per period: complaints, solution rate, satisfaction, response rate and average response days. 30d = last 30 days, 6m = last 6 months, year = current calendar year, all = since the company joined. Each period is one extra request per company.",
            "items": {
              "type": "string",
              "enum": [
                "30d",
                "6m",
                "year",
                "all"
              ],
              "enumTitles": [
                "Last 30 days",
                "Last 6 months",
                "This year",
                "All time"
              ]
            },
            "default": [
              "6m",
              "all"
            ]
          },
          "includeProfileIndicators": {
            "title": "Include company indicators",
            "type": "boolean",
            "description": "Open each company profile to get complaint counts and indicators for the chosen periods (about 1 second per request). Turn off for a fast list of all companies with their rankings only.",
            "default": true
          },
          "includeRankings": {
            "title": "Include official rankings",
            "type": "boolean",
            "description": "Position of each company in the four official national rankings (solution, satisfaction, response time, responded complaints) and its position within its own sector. Only 4 requests per run. The site publishes the top 800 of each ranking; companies outside it get empty ranks.",
            "default": true
          },
          "rankingPeriodDays": {
            "title": "Ranking period",
            "enum": [
              "7",
              "30",
              "90",
              "180",
              "365"
            ],
            "type": "string",
            "description": "Period used by the official rankings, in days.",
            "default": "365"
          },
          "minComplaints": {
            "title": "Minimum complaints",
            "minimum": 0,
            "type": "integer",
            "description": "Optional: skip companies with fewer complaints than this in the first chosen period (needs company indicators). Skipped companies are not charged.",
            "default": 0
          },
          "includeDeactivated": {
            "title": "Include deactivated companies",
            "type": "boolean",
            "description": "The site keeps old brands marked DESATIVADA or DESATIVADO (for example after a merger). Some still get complaints, others have none. Turn this off to skip them. Every row has a deactivated flag.",
            "default": true
          },
          "joinedPlatformSince": {
            "title": "Joined the platform since (date)",
            "type": "string",
            "description": "Optional: only companies that joined Consumidor.gov.br on or after this date (YYYY-MM-DD). Newest first."
          },
          "joinedPlatformWithinDays": {
            "title": "Joined the platform in the last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Optional: only companies that joined Consumidor.gov.br in the last N days. Newest first."
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run (alerts)",
            "type": "boolean",
            "description": "Skip companies this same search already returned in earlier runs, so you do not pay twice. Use it on a schedule to catch companies that just joined the platform.",
            "default": false
          },
          "maxItems": {
            "title": "Max companies",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of companies to return (you pay per company).",
            "default": 50
          },
          "maxRequests": {
            "title": "Max requests to Consumidor.gov.br",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Safety limit per run. A company with indicators costs 1 request plus 1 per period.",
            "default": 2000
          },
          "requestDelaySecs": {
            "title": "Pause between requests (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Minimum 1 second, to be gentle with a public government site.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}