{
  "openapi": "3.0.1",
  "info": {
    "title": "Quebec Contractor Leads – RBQ Licence Register (Phone & Email)",
    "description": "Quebec contractors from the official RBQ open register of active licences: phone, e-mail, address, NEQ, licence subclasses, issue date, bond provider and amount. Filter by city, region, trade and issue date, or verify RBQ licence numbers in bulk. $1 per 1,000 licences.",
    "version": "0.1",
    "x-build-id": "mvced8M859c8Zm3Oi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~quebec-contractor-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-quebec-contractor-leads",
        "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/gazidev~quebec-contractor-leads/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-quebec-contractor-leads",
        "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/gazidev~quebec-contractor-leads/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-quebec-contractor-leads",
        "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": {
          "municipalities": {
            "title": "Municipalities",
            "type": "array",
            "description": "Cities or towns to keep, e.g. Laval, Montreal, Quebec City, Sherbrooke. Accents, hyphens and upper/lower case do not matter; the whole name must match. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Administrative regions",
            "type": "array",
            "description": "Quebec administrative regions to keep. Empty = all. Firms based outside Quebec have no region.",
            "items": {
              "type": "string",
              "enum": [
                "Abitibi-Témiscamingue",
                "Bas-Saint-Laurent",
                "Capitale-Nationale",
                "Centre-du-Québec",
                "Chaudière-Appalaches",
                "Côte-Nord",
                "Estrie",
                "Gaspésie--Îles-de-la-Madeleine",
                "Lanaudière",
                "Laurentides",
                "Laval",
                "Mauricie",
                "Montérégie",
                "Montréal",
                "Nord-du-Québec",
                "Outaouais",
                "Saguenay--Lac-Saint-Jean"
              ],
              "enumTitles": [
                "Abitibi-Témiscamingue",
                "Bas-Saint-Laurent",
                "Capitale-Nationale",
                "Centre-du-Québec",
                "Chaudière-Appalaches",
                "Côte-Nord",
                "Estrie",
                "Gaspésie / Îles-de-la-Madeleine",
                "Lanaudière",
                "Laurentides",
                "Laval",
                "Mauricie",
                "Montérégie",
                "Montréal",
                "Nord-du-Québec",
                "Outaouais",
                "Saguenay / Lac-Saint-Jean"
              ]
            }
          },
          "subCategories": {
            "title": "Licence subclasses (trades)",
            "type": "array",
            "description": "RBQ licence subclasses. A licence is kept when it holds at least one of them. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "1.1",
                "2",
                "13",
                "14",
                "15",
                "1.1.1",
                "1.1.2",
                "1.2",
                "1.3",
                "1.4",
                "1.5",
                "1.6",
                "1.7",
                "1.8",
                "1.9",
                "1.10",
                "2.1",
                "2.2",
                "2.3",
                "2.4",
                "2.5",
                "2.6",
                "2.7",
                "2.8",
                "3.1",
                "3.2",
                "4.1",
                "4.2",
                "5.1",
                "5.2",
                "6.1",
                "6.2",
                "7",
                "8",
                "9",
                "10",
                "11.1",
                "11.2",
                "12",
                "13.1",
                "13.2",
                "13.3",
                "13.4",
                "13.5",
                "14.1",
                "14.2",
                "14.3",
                "15.1",
                "15.2",
                "15.3",
                "15.4",
                "15.5",
                "15.6",
                "15.7",
                "15.8",
                "15.9",
                "15.10",
                "16",
                "17.1",
                "17.2"
              ],
              "enumTitles": [
                "1 - All general contractors (1.1.1 to 1.10)",
                "1.1 - New homes under a guaranty plan (1.1.1, 1.1.2)",
                "2 - All groundwork (2.1 to 2.8)",
                "13 - All fire and lightning protection (13.1 to 13.5)",
                "14 - All elevators and lifts (14.1 to 14.3)",
                "15 - All plumbing, heating, ventilation, refrigeration (15.1 to 15.10)",
                "1.1.1 - New residential buildings covered by a guaranty plan, Class I",
                "1.1.2 - New residential buildings covered by a guaranty plan, Class II",
                "1.2 - Small buildings",
                "1.3 - All buildings",
                "1.4 - Roads and mains",
                "1.5 - Civil engineering structures",
                "1.6 - Underwater civil engineering",
                "1.7 - Telecommunications, transmission, transformation and distribution of electric power",
                "1.8 - Petroleum equipment installation",
                "1.9 - Building mechanicals",
                "1.10 - Mechanical lifts",
                "2.1 - Drilled wells",
                "2.2 - Non-drilled water collection structures",
                "2.3 - Underground water pumping systems",
                "2.4 - Private sewerage systems",
                "2.5 - Excavation and earthwork",
                "2.6 - Piles and special foundations",
                "2.7 - Sitework",
                "2.8 - Blasting",
                "3.1 - Concrete structures",
                "3.2 - Small concrete works",
                "4.1 - Masonry structures",
                "4.2 - Non-structural masonry, marble and ceramics",
                "5.1 - Metallic structures and prefabricated concrete elements",
                "5.2 - Metal fabrication",
                "6.1 - Wood structures",
                "6.2 - Wood and plastic work",
                "7 - Insulation, waterproofing, roofing and siding",
                "8 - Doors and windows",
                "9 - Interior finishing",
                "10 - Solid fuel local heating systems",
                "11.1 - Pressurized industrial or institutional piping",
                "11.2 - Special equipment and products",
                "12 - Manufactured cabinets and counter tops",
                "13.1 - Lightning protection",
                "13.2 - Fire alarm systems",
                "13.3 - Fire extinguishing systems",
                "13.4 - Local fire extinguishing systems",
                "13.5 - Prefabricated or special installations",
                "14.1 - Passenger and freight elevators",
                "14.2 - Lifts for persons with physical disabilities",
                "14.3 - Other types of elevators",
                "15.1 - Pulsed air heating systems",
                "15.2 - Natural gas burners",
                "15.3 - Oil burners",
                "15.4 - Hydronic heating systems",
                "15.5 - Plumbing",
                "15.6 - Propane",
                "15.7 - Residential ventilation",
                "15.8 - Ventilation",
                "15.9 - Small refrigeration systems",
                "15.10 - Refrigeration",
                "16 - Electrical",
                "17.1 - Instrumentation and control systems",
                "17.2 - Intercommunications, telephone and surveillance"
              ]
            }
          },
          "issuedWithinDays": {
            "title": "Issued within the last N days (new-licence leads)",
            "minimum": 0,
            "type": "integer",
            "description": "Only licences first issued within the last N days, e.g. 30. 0 = no limit."
          },
          "issuedAfter": {
            "title": "Issued on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Alternative to the field above. Overrides it when set."
          },
          "onlyWithEmail": {
            "title": "Only licences with an e-mail",
            "type": "boolean",
            "description": "Skip rows without an e-mail address (free).",
            "default": false
          },
          "onlyWithPhone": {
            "title": "Only licences with a phone number",
            "type": "boolean",
            "description": "Skip rows without a valid 10-digit phone (free).",
            "default": false
          },
          "licenceType": {
            "title": "Licence type",
            "enum": [
              "any",
              "contractor",
              "ownerBuilder"
            ],
            "type": "string",
            "description": "Contractors work for others; owner-builders build for themselves.",
            "default": "any"
          },
          "excludeIndividuals": {
            "title": "Skip individuals",
            "type": "boolean",
            "description": "Skip licences held by natural persons (Personne physique). RBQ publishes these without name, phone, e-mail or address, so they are not useful as leads.",
            "default": true
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Text in the licence holder's name or any of its other names. Accents and case do not matter."
          },
          "bondProviderContains": {
            "title": "Bond provider contains",
            "type": "string",
            "description": "Text in the association or insurer that provides the licence security, e.g. APCHQ, ACQ, Intact, Trisura."
          },
          "annualPaymentWithinDays": {
            "title": "Annual payment due within N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only licences whose next annual fee date falls between today and today + N days. 0 = off."
          },
          "licenceNumbers": {
            "title": "Licence numbers (verify)",
            "type": "array",
            "description": "Look up these RBQ licence numbers, e.g. 5678-1234-01 (dashes optional). The other filters are ignored. Numbers that are not active give a free `found: false` row.",
            "items": {
              "type": "string"
            }
          },
          "neqs": {
            "title": "NEQ numbers (verify)",
            "type": "array",
            "description": "Look up by Quebec enterprise number (NEQ, 10 digits). The other filters are ignored. Not found = free row.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "issueDateDesc",
              "issueDateAsc",
              "annualPaymentDateAsc",
              "nameAsc"
            ],
            "type": "string",
            "description": "Order of the output. With a max-items cap you get the top N in this order.",
            "default": "issueDateDesc"
          },
          "maxItems": {
            "title": "Max licences",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum licences to return (and pay for). 0 = no limit.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only licences not returned before (for schedules)",
            "type": "boolean",
            "description": "Remembers returned licence numbers in a named key-value store, so a scheduled run gives only new ones.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key for 'only new'",
            "type": "string",
            "description": "Use different keys for different saved searches.",
            "default": "default"
          },
          "useCache": {
            "title": "Reuse today's downloaded file",
            "type": "boolean",
            "description": "Keeps the parsed RBQ file for 20 hours in a named key-value store (quebec-rbq-licences-cache), so repeated runs do not download it again. RBQ updates the file daily.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}