{
  "openapi": "3.0.1",
  "info": {
    "title": "Canada Traffic Signal Locations & Intersection Dataset (OSM)",
    "description": "OSM-derived, deduplicated inventory of Canadian signalized intersections and crossings — classified by signal type, with approach count and accessibility (APS) flags, by province and city. One result = one intersection. CSV/JSON/Excel/KML. Data © OpenStreetMap contributors (ODbL 1.0).",
    "version": "0.1",
    "x-build-id": "G32hOfJb90HOaNka1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scholarstack~canada-traffic-signal-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scholarstack-canada-traffic-signal-extractor",
        "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/scholarstack~canada-traffic-signal-extractor/runs": {
      "post": {
        "operationId": "runs-sync-scholarstack-canada-traffic-signal-extractor",
        "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/scholarstack~canada-traffic-signal-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-scholarstack-canada-traffic-signal-extractor",
        "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": {
          "city": {
            "title": "City (single)",
            "enum": [
              "ab-calgary",
              "ab-edmonton",
              "ab-lethbridge",
              "ab-red_deer",
              "bc-abbotsford",
              "bc-burnaby",
              "bc-kelowna",
              "bc-richmond",
              "bc-surrey",
              "bc-vancouver",
              "bc-victoria",
              "mb-brandon",
              "mb-winnipeg",
              "nb-fredericton",
              "nb-moncton",
              "nb-saint_john",
              "nl-st_johns",
              "nt-yellowknife",
              "ns-halifax",
              "ns-sydney",
              "nu-iqaluit",
              "on-brampton",
              "on-hamilton",
              "on-kingston",
              "on-kitchener",
              "on-london",
              "on-markham",
              "on-mississauga",
              "on-ottawa",
              "on-toronto",
              "on-vaughan",
              "on-waterloo",
              "on-windsor",
              "pe-charlottetown",
              "qc-gatineau",
              "qc-laval",
              "qc-longueuil",
              "qc-montreal",
              "qc-quebec_city",
              "qc-sherbrooke",
              "sk-regina",
              "sk-saskatoon",
              "yt-whitehorse"
            ],
            "type": "string",
            "description": "Select a single city (e.g. Toronto). Ignored if customBbox is set. For multiple cities use 'Cities' below; for all cities in a state use 'State'.",
            "default": "on-toronto"
          },
          "cities": {
            "title": "Cities (batch — pick multiple)",
            "type": "array",
            "description": "Select multiple cities to process in one run. All results are delivered into a single dataset. Overrides 'City' if set. Ignored if 'State' or 'Custom bbox' is set.",
            "items": {
              "type": "string",
              "enum": [
                "ab-calgary",
                "ab-edmonton",
                "ab-lethbridge",
                "ab-red_deer",
                "bc-abbotsford",
                "bc-burnaby",
                "bc-kelowna",
                "bc-richmond",
                "bc-surrey",
                "bc-vancouver",
                "bc-victoria",
                "mb-brandon",
                "mb-winnipeg",
                "nb-fredericton",
                "nb-moncton",
                "nb-saint_john",
                "nl-st_johns",
                "nt-yellowknife",
                "ns-halifax",
                "ns-sydney",
                "nu-iqaluit",
                "on-brampton",
                "on-hamilton",
                "on-kingston",
                "on-kitchener",
                "on-london",
                "on-markham",
                "on-mississauga",
                "on-ottawa",
                "on-toronto",
                "on-vaughan",
                "on-waterloo",
                "on-windsor",
                "pe-charlottetown",
                "qc-gatineau",
                "qc-laval",
                "qc-longueuil",
                "qc-montreal",
                "qc-quebec_city",
                "qc-sherbrooke",
                "sk-regina",
                "sk-saskatoon",
                "yt-whitehorse"
              ],
              "enumTitles": [
                "Calgary (AB)",
                "Edmonton (AB)",
                "Lethbridge (AB)",
                "Red Deer (AB)",
                "Abbotsford (BC)",
                "Burnaby (BC)",
                "Kelowna (BC)",
                "Richmond (BC)",
                "Surrey (BC)",
                "Vancouver (BC)",
                "Victoria (BC)",
                "Brandon (MB)",
                "Winnipeg (MB)",
                "Fredericton (NB)",
                "Moncton (NB)",
                "Saint John (NB)",
                "St. John's (NL)",
                "Yellowknife (NT)",
                "Halifax (NS)",
                "Sydney (NS)",
                "Iqaluit (NU)",
                "Brampton (ON)",
                "Hamilton (ON)",
                "Kingston (ON)",
                "Kitchener (ON)",
                "London (ON)",
                "Markham (ON)",
                "Mississauga (ON)",
                "Ottawa (ON)",
                "Toronto (ON)",
                "Vaughan (ON)",
                "Waterloo (ON)",
                "Windsor (ON)",
                "Charlottetown (PE)",
                "Gatineau (QC)",
                "Laval (QC)",
                "Longueuil (QC)",
                "Montreal (QC)",
                "Quebec City (QC)",
                "Sherbrooke (QC)",
                "Regina (SK)",
                "Saskatoon (SK)",
                "Whitehorse (YT)"
              ]
            }
          },
          "state": {
            "title": "State (batch — all cities)",
            "enum": [
              "AB",
              "BC",
              "MB",
              "NB",
              "NL",
              "NS",
              "NT",
              "NU",
              "ON",
              "PE",
              "QC",
              "SK",
              "YT"
            ],
            "type": "string",
            "description": "Select a state to process ALL its cities in one run. Overrides 'City' and 'Cities' inputs. Ignored if 'Custom bbox' is set."
          },
          "customBbox": {
            "title": "Custom bounding box",
            "type": "string",
            "description": "Override everything with your own bbox: \"south,west,north,east\" in decimal degrees. Example: \"34.00,-118.50,34.20,-118.20\""
          },
          "clusterRadiusMeters": {
            "title": "Cluster radius (metres)",
            "minimum": 10,
            "maximum": 150,
            "type": "integer",
            "description": "Signals within this radius are grouped into one intersection. Default 40m suits dense Canadian grids. Raise it (e.g. 70m) for sprawling suburbs with wide junctions.",
            "default": 40
          },
          "officialMatchRadiusMeters": {
            "title": "Official match radius (metres)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "When official city signal data exists, an OSM intersection within this distance of an official signal is treated as the same intersection and snapped onto the official (more accurate) position. Chosen from the nearest-official distance distribution; 30m captures same-intersection offsets without merging distinct neighbours (which sit 60m+ apart).",
            "default": 30
          },
          "mergeRadiusMeters": {
            "title": "Merge radius (metres)",
            "minimum": 10,
            "maximum": 150,
            "type": "integer",
            "description": "Centroids within this radius of each other are merged into one intersection. Default 40m. Lower it if separate nearby junctions get merged; raise it if duplicate points appear at one wide multi-carriageway junction.",
            "default": 40
          },
          "signalType": {
            "title": "Signal type(s)",
            "type": "array",
            "description": "Filter by intersection signal type. Pick one or more, or 'All'. vehicular_junction = road junctions; pedestrian_crossing = crossings; vehicular_and_pedestrian = junction with a pedestrian phase; hawk_signal = HAWK pedestrian beacon; level_crossing = rail crossing.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "vehicular_junction",
                "pedestrian_crossing",
                "vehicular_and_pedestrian",
                "hawk_signal",
                "level_crossing"
              ],
              "enumTitles": [
                "All signal types",
                "Vehicular junction",
                "Pedestrian crossing",
                "Vehicular + pedestrian",
                "HAWK signal",
                "Level crossing"
              ]
            },
            "default": [
              "all"
            ]
          },
          "minConfidence": {
            "title": "Minimum confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop intersections whose confidence score is below this value (0–100, interpreted as 0.00–1.00). 0 = keep all. Phase 1 scores are OSM-density based.",
            "default": 0
          },
          "includeAccessibility": {
            "title": "Include accessibility flags",
            "type": "boolean",
            "description": "Include the ADA / accessibility block (button_operated, sound_signal, tactile_paving, countdown_display, …) in each output record.",
            "default": true
          },
          "wholeState": {
            "title": "Whole state (ignore city)",
            "type": "boolean",
            "description": "Process EVERY signalized intersection in the selected State's data, ignoring city selection. Use together with 'State'. Large output — run dryRun=true first to see the count and cost.",
            "default": false
          },
          "includeKml": {
            "title": "Generate KML file (+$0.25 per run)",
            "type": "boolean",
            "description": "Also produce a Google Earth / KML file of the delivered intersections (saved to the run's key-value store with a public URL). Off by default. Charged once per run as a flat KML-export fee — see Pricing.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the total number of intersections delivered (and charged) across all cities. 0 = unlimited. Run dryRun=true first to see the full count.",
            "default": 1000
          },
          "dryRun": {
            "title": "Dry run (free estimate)",
            "type": "boolean",
            "description": "When true, runs the full pipeline but charges nothing and delivers nothing. Returns estimated count, estimated cost, and a 10-row sample.",
            "default": false
          },
          "priorDatasetId": {
            "title": "Prior Dataset ID (Delta Mode)",
            "type": "string",
            "description": "The defaultDatasetId of a previous run of this actor for the same city/state. Find it in the run's Storage tab in Apify Console. When set, only added, removed, and changed intersections are charged."
          },
          "kmlFromDatasetId": {
            "title": "KML from existing run (KML-only mode)",
            "type": "string",
            "description": "Forgot to enable KML on a previous run? Paste that run's defaultDatasetId (Storage tab) here and run again. The actor builds a KML from those exact results and charges ONLY the flat $0.25 KML fee — no re-extraction, no per-intersection charges. Leave empty for normal runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}