{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Health Insurance Data — Operadoras ANS",
    "description": "Health insurance operators in Brazil from official ANS open data: registry search, complaint index (IGR) rankings, IDSS quality score, prudential class and monthly history since 2015. No scraping. | Operadoras de planos de saúde: cadastro, IGR, IDSS e histórico, direto da fonte oficial da ANS.",
    "version": "0.1",
    "x-build-id": "UWhY3hlPGjlMfyyOx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/matheus_dev_natal~brazil-health-insurance-ans/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-matheus_dev_natal-brazil-health-insurance-ans",
        "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/matheus_dev_natal~brazil-health-insurance-ans/runs": {
      "post": {
        "operationId": "runs-sync-matheus_dev_natal-brazil-health-insurance-ans",
        "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/matheus_dev_natal~brazil-health-insurance-ans/run-sync": {
      "post": {
        "operationId": "run-sync-matheus_dev_natal-brazil-health-insurance-ans",
        "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": [
          "mode",
          "maxItems"
        ],
        "properties": {
          "mode": {
            "title": "What to fetch — O que buscar",
            "enum": [
              "complaints",
              "operators",
              "history"
            ],
            "type": "string",
            "description": "Complaint ranking: operators ordered by the official complaint index (IGR = complaints per 100,000 beneficiaries) in one month. Registry search: find operators by name, CNPJ, modality or state. Monthly history: the IGR/beneficiary series of ONE operator — requires the ANS registry number.",
            "default": "complaints"
          },
          "maxItems": {
            "title": "Max results — Máximo de registros",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of records returned in this run. The actor stops exactly at this limit — you never pay for a single item beyond it.",
            "default": 10
          },
          "coverage": {
            "title": "Coverage — Cobertura",
            "enum": [
              "medical",
              "dental"
            ],
            "type": "string",
            "description": "Coverage segment: medical assistance plans or dental-only plans.",
            "default": "medical"
          },
          "size": {
            "title": "Operator size — Porte",
            "enum": [
              "large",
              "medium",
              "small",
              "all"
            ],
            "type": "string",
            "description": "Size band for the ranking. Default 'Large': the IGR of a 200-beneficiary operator against a 3-million-beneficiary one is statistically meaningless, so the default keeps the comparison honest.",
            "default": "large"
          },
          "order": {
            "title": "Ranking order — Ordem",
            "enum": [
              "best",
              "worst"
            ],
            "type": "string",
            "description": "Lowest complaint index first, or highest first.",
            "default": "best"
          },
          "modality": {
            "title": "Modality — Modalidade",
            "enum": [
              "Administradora de Benefícios",
              "Autogestão",
              "Cooperativa Médica",
              "Cooperativa odontológica",
              "Filantropia",
              "Medicina de Grupo",
              "Odontologia de Grupo",
              "Seguradora Especializada em Saúde"
            ],
            "type": "string",
            "description": "Regulatory modality, verbatim from the ANS registry. Useful to keep a broker ranking to sellable plans — picking 'Cooperativa Médica' or 'Medicina de Grupo' leaves out self-managed corporate plans (Autogestão). Also filters the registry search."
          },
          "competencia": {
            "title": "Reference month, YYYY-MM — Competência",
            "type": "string",
            "description": "Format YYYY-MM (e.g. '2026-07'). Leave empty for the most recent month published by ANS. In monthly history mode this is the upper bound of the window. The series starts at 2015-01."
          },
          "search": {
            "title": "Search by name — Busca por nome",
            "type": "string",
            "description": "Free-text match against corporate and trade names, ignoring case and accents. Example: 'unimed'."
          },
          "operatorRegistry": {
            "title": "ANS registry number — Registro ANS",
            "type": "string",
            "description": "The operator's ANS registry number (up to 6 digits, e.g. '005711' or '5711' — leading zeros optional). Required for monthly history; optional filter in the registry search. Don't know it? Run the registry search by name first."
          },
          "cnpj": {
            "title": "CNPJ",
            "type": "string",
            "description": "Company CNPJ, 14 digits (punctuation accepted and ignored). Registry search only."
          },
          "uf": {
            "title": "State of headquarters — UF da sede",
            "enum": [
              "AC",
              "AL",
              "AM",
              "AP",
              "BA",
              "CE",
              "DF",
              "ES",
              "GO",
              "MA",
              "MG",
              "MS",
              "MT",
              "PA",
              "PB",
              "PE",
              "PI",
              "PR",
              "RJ",
              "RN",
              "RO",
              "RR",
              "RS",
              "SC",
              "SE",
              "SP",
              "TO"
            ],
            "type": "string",
            "description": "State (UF) where the operator is headquartered. Registry search only."
          },
          "includeContacts": {
            "title": "Include institutional contacts — Incluir contatos",
            "type": "boolean",
            "description": "Adds the company's institutional phone and e-mail, as published in the official ANS registry, to registry-search results. Off by default; using contact data in compliance with LGPD is your responsibility. Legal-representative personal data is never returned.",
            "default": false
          },
          "monthsBack": {
            "title": "Months of history — Meses de histórico",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "How many months to return, counting back from the reference month (or from the most recent month published).",
            "default": 12
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed in most cases — the ANS open-data server answers direct connections. Enable only if runs fail with connection or SSL errors from datacenter IPs.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}