{
  "openapi": "3.0.1",
  "info": {
    "title": "HKEX Insider & Short Tracker — Director Dealings + Shorts",
    "description": "Live Hong Kong director & substantial-shareholder dealings (SFO Part XV, HKEX DI daily summaries) plus SFC weekly aggregated short positions (Cap. 571AJ CSV). Fetched live each run with a source URL per row — insider and short rows in one schema.",
    "version": "0.0",
    "x-build-id": "uHcXl7B2z3JPy1SmY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgendata~hkex-insider-short-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgendata-hkex-insider-short-tracker",
        "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/nexgendata~hkex-insider-short-tracker/runs": {
      "post": {
        "operationId": "runs-sync-nexgendata-hkex-insider-short-tracker",
        "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/nexgendata~hkex-insider-short-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-nexgendata-hkex-insider-short-tracker",
        "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": {
          "stockCode": {
            "title": "HKEX stock code(s)",
            "type": "string",
            "description": "Optional HKEX numeric stock code(s) to filter the live results to — comma-separated for multi-ticker pulls. Codes are normalized, so '700', '0700' and '0700.HK' all match Tencent. Leave blank to return every issuer that appears in the fetched HKEX Disclosure of Interests daily summaries and the SFC weekly short-position file for the selected window.",
            "default": ""
          },
          "disclosureType": {
            "title": "Disclosure type",
            "enum": [
              "both",
              "insider",
              "short"
            ],
            "type": "string",
            "description": "Which live regime to fetch. 'insider' = HKEX Disclosure of Interests daily summaries — directors' dealings (DSM...C2) plus individual & corporate substantial-shareholder changes (DSM...C1) under SFO Part XV. 'short' = SFC weekly Aggregated Reportable Short Positions CSV under the Securities and Futures (Short Position Reporting) Rules Cap. 571AJ. 'both' (default) fetches both and returns them in a unified schema with the `type` field distinguishing them.",
            "default": "both"
          },
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "type": "string",
            "description": "Inclusive lower bound on the disclosure / reporting date. Defaults to 14 days before the end date. The actor iterates business days in this window for HKEX DI daily summaries (weekends and days with no published summary are skipped) and selects the SFC weekly CSV file(s) whose reporting date falls in the window. ISO-8601 format.",
            "default": ""
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "type": "string",
            "description": "Inclusive upper bound on the disclosure / reporting date. Defaults to today. ISO-8601 format.",
            "default": ""
          },
          "maxDiDays": {
            "title": "Max HKEX DI business days to fetch",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Safety cap on how many business days of HKEX DI daily summaries to fetch (most recent first) within the date window. Each business day requires up to two HTTP fetches (C1 + C2). Raise for deeper history, lower for faster/cheaper runs.",
            "default": 10
          },
          "minSharesChanged": {
            "title": "Minimum shares changed (insider records)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Lower bound (absolute value) on the number of shares bought/sold/involved for insider (DI) records. Filters out small housekeeping transactions. Short-position records pass through unchanged (this filter applies only to type=insider). 0 = no filter.",
            "default": 0
          },
          "limit": {
            "title": "Max records returned",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard cap on total disclosure records pushed to the dataset (1-200). Each row is one real, live-fetched disclosure event (one director/substantial-shareholder dealing OR one SFC short position) and carries its real source URL.",
            "default": 25
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used for outbound requests to the HKEX DI portal and SFC site. RESIDENTIAL with HK egress is recommended because the DI portal may block datacenter IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "HK"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}