{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Congress Bills Tracker – Projetos de Lei Câmara/Senado",
    "description": "Brazil Congress bills tracker: follow the tramitação of projetos de lei (PL, PEC, MPV) in the Câmara dos Deputados and Senado Federal. Current status + andamentos history, alerts only when a bill moves. Search new bills by keyword, type, author, party, UF. Official open data. Pay per bill.",
    "version": "0.1",
    "x-build-id": "LIbL9c6rexqSYaocJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cairolabs~brazil-bills-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cairolabs-brazil-bills-monitor",
        "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/cairolabs~brazil-bills-monitor/runs": {
      "post": {
        "operationId": "runs-sync-cairolabs-brazil-bills-monitor",
        "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/cairolabs~brazil-bills-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-cairolabs-brazil-bills-monitor",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "track"
            ],
            "type": "string",
            "description": "'search' lists bills matching your filters. 'track' follows the tramitação (andamentos) of the bills listed in 'Bills to track' in both houses: current status + history; with 'Only new' it returns only new andamentos since the last run.",
            "default": "search"
          },
          "bills": {
            "title": "Bills to track (track mode)",
            "type": "array",
            "description": "Used only when mode = track. Format 'SIGLA NUMBER/YEAR', e.g. 'PL 2338/2023', 'PEC 45/2019', 'MPV 1303/2025'. Each bill is looked up in the Câmara and in the Senado; you get one item per house where it exists.",
            "items": {
              "type": "string"
            }
          },
          "maxHistory": {
            "title": "Max andamentos per item (track mode)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Track mode: how many andamentos (newest first) to include in each item's 'history'. 'newEvents' and 'totalEvents' always give the full counts.",
            "default": 20
          },
          "sources": {
            "title": "Sources (houses)",
            "type": "array",
            "description": "Which houses to monitor. If one API fails, the other still returns results.",
            "items": {
              "type": "string",
              "enum": [
                "camara",
                "senado"
              ],
              "enumTitles": [
                "Câmara dos Deputados",
                "Senado Federal"
              ]
            },
            "default": [
              "camara",
              "senado"
            ]
          },
          "keywords": {
            "title": "Keywords (any match, search mode)",
            "type": "array",
            "description": "Accent/case-insensitive match on the bill ementa (summary), e.g. 'inteligencia artificial', 'saúde'. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop bills whose ementa contains any of these terms, e.g. 'denomina' (naming of roads/buildings).",
            "items": {
              "type": "string"
            }
          },
          "types": {
            "title": "Bill types (sigla)",
            "type": "array",
            "description": "Default: PL (projeto de lei), PLP (lei complementar), PEC (emenda constitucional), MPV (medida provisória), PDL (decreto legislativo). Any list you set replaces the default. Empty list [] = all types, including requerimentos (REQ/RQS). Unknown siglas make the run fail with the list of valid types (case-insensitive).",
            "default": [
              "PL",
              "PLP",
              "PEC",
              "MPV",
              "PDL"
            ],
            "items": {
              "type": "string"
            }
          },
          "year": {
            "title": "Bill year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Bill year (e.g. 2026). Without dates, searches the whole year."
          },
          "dateFrom": {
            "title": "Presented from (YYYY-MM-DD)",
            "type": "string",
            "description": "Presentation date start. Default: 7 days before 'Presented until'."
          },
          "dateTo": {
            "title": "Presented until (YYYY-MM-DD)",
            "type": "string",
            "description": "Presentation date end. Default: today (Brasília)."
          },
          "authorName": {
            "title": "Author name",
            "type": "string",
            "description": "Part of the author's name, e.g. 'Tabata Amaral' (Câmara: API filter; Senado: API + local match)."
          },
          "party": {
            "title": "Author party",
            "type": "string",
            "description": "Party acronym, e.g. PT, PL, MDB (Câmara: API filter; Senado: matched in the author string)."
          },
          "uf": {
            "title": "Author state (UF)",
            "type": "string",
            "description": "Two-letter code, e.g. SP (Câmara: API filter; Senado: matched in the author string)."
          },
          "includeDetails": {
            "title": "Include status & authors (Câmara)",
            "type": "boolean",
            "description": "Fetches the current status (last tramitação), authors and full-text link for each Câmara bill returned (2 extra requests per bill). Senado data already includes them.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new since last run (alerts)",
            "type": "boolean",
            "description": "Search mode: remembers returned bills and returns only fresh ones. Track mode: remembers each bill's andamentos per house and returns only bills with new andamentos (bills with nothing new are not returned and not charged). State is kept in a named key-value store.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Use different names for independent monitors (search and track keep separate state under the same name).",
            "default": "default"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cost cap: max dataset items (search: bills; track: bill-per-house items).",
            "default": 50
          },
          "maxPagesPerSource": {
            "title": "Max pages per date chunk (Câmara, 100 items/page)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Max pages per date chunk (Câmara, 100 items/page).",
            "default": 20
          },
          "requestsPerSecond": {
            "title": "Requests per second",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Polite rate limit for the public APIs.",
            "default": 3
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries with exponential backoff on timeouts, 429 and 5xx.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}