{
  "openapi": "3.0.1",
  "info": {
    "title": "RBQ Quebec Contractor Licence Scraper — Phone, Email, NEQ",
    "description": "Every active Régie du bâtiment du Québec contractor licence, one row per licence: phone, email, address, NEQ, sub-categories, bonding company and bond amount. 54,000+ licences from the RBQ's daily open data. Filter by trade, region, city.",
    "version": "0.1",
    "x-build-id": "fvCZFq10FcpfCEvDs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~rbq-quebec-licence-register-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-rbq-quebec-licence-register-scraper",
        "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/scrapersdelight~rbq-quebec-licence-register-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-rbq-quebec-licence-register-scraper",
        "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/scrapersdelight~rbq-quebec-licence-register-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-rbq-quebec-licence-register-scraper",
        "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": {
          "subcategories": {
            "title": "Sub-categories (RBQ codes)",
            "type": "array",
            "description": "RBQ licence sub-category codes, e.g. 15.5 (plumbing), 16 (electrical), 7 (insulation, waterproofing, roofing and cladding), 1.2 (small buildings), 1.3 (buildings of any kind), 2.5 (excavation). Dotted-prefix match: \"15\" matches 15.1 to 15.10, \"1.1\" matches 1.1.1 and 1.1.2. A licence matches if it holds ANY listed code. Empty = all trades.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Administrative regions",
            "type": "array",
            "description": "Québec administrative regions (by the RBQ region code). Empty = all of Québec.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "02",
                "03",
                "04",
                "05",
                "06",
                "07",
                "08",
                "09",
                "10",
                "11",
                "12",
                "13",
                "14",
                "15",
                "16",
                "17"
              ],
              "enumTitles": [
                "01 Bas-Saint-Laurent",
                "02 Saguenay–Lac-Saint-Jean",
                "03 Capitale-Nationale",
                "04 Mauricie",
                "05 Estrie",
                "06 Montréal",
                "07 Outaouais",
                "08 Abitibi-Témiscamingue",
                "09 Côte-Nord",
                "10 Nord-du-Québec",
                "11 Gaspésie–Îles-de-la-Madeleine",
                "12 Chaudière-Appalaches",
                "13 Laval",
                "14 Lanaudière",
                "15 Laurentides",
                "16 Montérégie",
                "17 Centre-du-Québec"
              ]
            }
          },
          "municipalities": {
            "title": "Municipalities",
            "type": "array",
            "description": "Municipality names, e.g. Montréal, Laval, Québec, Gatineau. Accents, case and hyphens are ignored (\"Levis\" matches \"Lévis\"). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "contractorCategories": {
            "title": "Contractor category",
            "type": "array",
            "description": "general = holds at least one general-contractor sub-category (1.x); specialised = holds at least one specialty sub-category (2 to 17). Empty = both.",
            "items": {
              "type": "string",
              "enum": [
                "general",
                "specialised"
              ],
              "enumTitles": [
                "General contractor (1.x)",
                "Specialty contractor (2-17)"
              ]
            }
          },
          "legalStatuses": {
            "title": "Legal status",
            "type": "array",
            "description": "The holder's legal form as the register states it. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "Personne morale",
                "Personne physique",
                "Corporation",
                "Autorite publique"
              ],
              "enumTitles": [
                "Personne morale (company)",
                "Personne physique (individual; the register withholds name and contact)",
                "Corporation",
                "Autorité publique (public body)"
              ]
            }
          },
          "licenceTypes": {
            "title": "Licence type",
            "type": "array",
            "description": "Entrepreneur = contractor working for others (98% of licences). Constructeur-propriétaire = owner-builder working on its own property (often municipalities and developers). Empty = both.",
            "items": {
              "type": "string",
              "enum": [
                "Entrepreneur",
                "Constructeur-proprietaire"
              ],
              "enumTitles": [
                "Entrepreneur (contractor)",
                "Constructeur-propriétaire (owner-builder)"
              ]
            }
          },
          "keyword": {
            "title": "Name contains",
            "type": "string",
            "description": "Keep only licences whose business name or a trade name contains this text (accents and case ignored), e.g. toiture, plomberie, excavation."
          },
          "issuedOnOrAfter": {
            "title": "Licence issued on or after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Only licences first issued on or after this date: new contractor businesses. Empty = any date."
          },
          "requirePhone": {
            "title": "Only licences with a phone",
            "type": "boolean",
            "description": "Skip licences the register publishes without a phone number.",
            "default": false
          },
          "requireEmail": {
            "title": "Only licences with an email",
            "type": "boolean",
            "description": "Skip licences without a usable email address.",
            "default": false
          },
          "includeWithheldIdentities": {
            "title": "Include licences whose identity the RBQ withholds",
            "type": "boolean",
            "description": "The RBQ withholds the name, address, phone and email of every individual (Personne physique) licence holder, about 4,400 licences. They are skipped and NOT charged by default; turn this on to receive them anyway (licence number, NEQ when present, sub-categories, region, bond). Each is then a billed row.",
            "default": false
          },
          "includeRegisterDetail": {
            "title": "Add register detail (named respondents)",
            "type": "boolean",
            "description": "For each delivered licence, also call the RBQ's own register to add the named respondents (first and last name, director flag, qualifications), work locations, the restriction text (e.g. a ban on public contracts) and phone extension. Home addresses of respondents are never returned. One extra request per licence (about 0.4 s, 8 in parallel).",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only licences new since the last run",
            "type": "boolean",
            "description": "Monitoring mode: return only licences that were not in the register the last time this ran with the same state key. The first run saves a baseline and returns rows as usual. Always reads the full register.",
            "default": false
          },
          "stateKey": {
            "title": "State key (monitoring mode)",
            "type": "string",
            "description": "Name for the saved licence list used by monitoring mode, so several monitors can run side by side.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max licences",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many licences (you are charged per licence delivered). The whole register is about 54,000 licences; about 49,700 publish a phone.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Defaults to NO PROXY (direct). The register is open data on a public government portal, and this Actor reads it as byte-range pieces, checks each against its Content-Range, retries a short piece, and proves a full read with the zip's own CRC-32, so a direct download is safe and costs no proxy transfer. Choose Apify RESIDENTIAL if a direct read ever fails for you (measured 8/8 clean whole reads). If the proxy cannot be started, the run falls back to direct.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}