{
  "openapi": "3.0.1",
  "info": {
    "title": "Thai Royal Gazette Alerts in English (Laws, EHS, Business)",
    "description": "New Thai laws and notices from the Royal Gazette (ราชกิจจานุเบกษา) by topic, with English labels: environment, pollution, hazardous substances, product standards, labour, tax. For factory EHS and ISO 14001/45001 legal registers. Alerts to Slack, Telegram, LINE, webhook.",
    "version": "1.0",
    "x-build-id": "SlWOkjGmjN6p6Pjvd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chatuporn~thai-royal-gazette-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chatuporn-thai-royal-gazette-alerts",
        "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/chatuporn~thai-royal-gazette-alerts/runs": {
      "post": {
        "operationId": "runs-sync-chatuporn-thai-royal-gazette-alerts",
        "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/chatuporn~thai-royal-gazette-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-chatuporn-thai-royal-gazette-alerts",
        "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": {
          "preset": {
            "title": "Preset",
            "enum": [
              "",
              "factory_ehs",
              "business"
            ],
            "type": "string",
            "description": "A ready-made set of topics. Factory EHS covers environment, pollution, waste and hazardous substances, industry, product standards, labour, energy, buildings and disasters. Topics below are added to the preset.",
            "default": "factory_ehs"
          },
          "topics": {
            "title": "Topics",
            "type": "array",
            "description": "Keep items with at least one of these topics (from the dataset's classification).",
            "items": {
              "type": "string",
              "enum": [
                "accounting",
                "land_reform",
                "agriculture",
                "pollution_air",
                "anticorruption",
                "aml",
                "aviation",
                "banking",
                "bankruptcy",
                "public_debt",
                "building",
                "climate",
                "commerce",
                "disease",
                "conservation",
                "corrections",
                "court",
                "crops",
                "culture_sport",
                "defence_security",
                "disaster",
                "education",
                "electricity",
                "egov",
                "emergency",
                "energy",
                "environment",
                "ethics",
                "finance",
                "fishery",
                "food_drug",
                "foreign_affairs",
                "housing",
                "industry",
                "insurance",
                "intellectual_prop",
                "trade_intl",
                "investment",
                "irrigation",
                "justice",
                "labour",
                "land_urban",
                "land_transport",
                "livestock",
                "public_health_local",
                "mining",
                "narcotics",
                "nationality",
                "pollution_noise",
                "nuclear",
                "information_access",
                "petroleum",
                "politics",
                "pollution",
                "consumer",
                "standards",
                "profession",
                "public_admin",
                "health",
                "rail",
                "juristic_registry",
                "religion",
                "science_tech",
                "securities",
                "social_security",
                "social_welfare",
                "tax",
                "telecom_digital",
                "tourism",
                "transport",
                "university",
                "utilities",
                "pollution_waste",
                "pollution_water",
                "water_resource",
                "marine"
              ],
              "enumTitles": [
                "Accounting standards",
                "Agricultural land reform",
                "Agriculture",
                "Air pollution",
                "Anti-corruption",
                "Anti-money laundering",
                "Aviation",
                "Banking and financial institutions",
                "Bankruptcy and enforcement",
                "Budget, bonds and public debt",
                "Buildings and construction",
                "Climate and greenhouse gases",
                "Commerce and business",
                "Communicable disease control",
                "Conservation, forests and wildlife",
                "Corrections",
                "Courts and judgments",
                "Crops, fertiliser and seeds",
                "Culture, sport and recreation",
                "Defence, military and police",
                "Disasters",
                "Education",
                "Electricity",
                "Electronic government",
                "Emergencies and internal security",
                "Energy",
                "Environment",
                "Ethics of state officials",
                "Finance, treasury and tax",
                "Fisheries",
                "Food and drugs",
                "Foreign affairs",
                "Housing",
                "Industry",
                "Insurance",
                "Intellectual property",
                "International trade",
                "Investment and special economic zones",
                "Irrigation",
                "Justice and litigation",
                "Labour and professions",
                "Land and town planning",
                "Land transport, highways and traffic",
                "Livestock",
                "Local public health and sanitation",
                "Mining",
                "Narcotics",
                "Nationality and immigration",
                "Noise and vibration",
                "Nuclear and atomic energy",
                "Official information",
                "Petroleum and gas",
                "Politics and elections",
                "Pollution",
                "Prices and consumer protection",
                "Product standards (TISI)",
                "Professional councils and licences",
                "Public administration",
                "Public health",
                "Railways",
                "Registration of companies, associations and foundations",
                "Religion",
                "Science and technology",
                "Securities and capital markets",
                "Social security",
                "Social welfare",
                "Tax, customs and excise",
                "Telecoms and digital",
                "Tourism",
                "Transport",
                "Universities",
                "Utilities",
                "Waste and hazardous substances",
                "Water pollution",
                "Water resources",
                "Water transport and marine"
              ]
            }
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Thai words in the title or issuing agency, e.g. วัตถุอันตราย, โรงงาน, ค่าจ้างขั้นต่ำ, ระยอง. Spaces and letter case are ignored.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip items whose title or agency contains any of these.",
            "items": {
              "type": "string"
            }
          },
          "agencyContains": {
            "title": "Issuing agency contains",
            "type": "string",
            "description": "e.g. กรมโรงงานอุตสาหกรรม, กรมควบคุมมลพิษ, กระทรวงแรงงาน."
          },
          "onlyNewRules": {
            "title": "Only new or amended rules",
            "type": "boolean",
            "description": "Acts, royal decrees, ministerial regulations and items classified as rule-making. Skips appointments, registrations and similar notices.",
            "default": false
          },
          "onlyLaws": {
            "title": "Only Acts, Royal Decrees and Ministerial Regulations",
            "type": "boolean",
            "description": "Stricter than the option above.",
            "default": false
          },
          "gazetteParts": {
            "title": "Gazette parts",
            "type": "array",
            "description": "Empty = all parts.",
            "items": {
              "type": "string",
              "enum": [
                "ก",
                "ข",
                "ค",
                "ง"
              ],
              "enumTitles": [
                "Part A: legislation",
                "Part B: royal and honours",
                "Part C: registrations and advertisements",
                "Part D: government notices"
              ]
            }
          },
          "excludeTopics": {
            "title": "Exclude topics",
            "type": "array",
            "description": "Skip items with these topics.",
            "items": {
              "type": "string",
              "enum": [
                "accounting",
                "land_reform",
                "agriculture",
                "pollution_air",
                "anticorruption",
                "aml",
                "aviation",
                "banking",
                "bankruptcy",
                "public_debt",
                "building",
                "climate",
                "commerce",
                "disease",
                "conservation",
                "corrections",
                "court",
                "crops",
                "culture_sport",
                "defence_security",
                "disaster",
                "education",
                "electricity",
                "egov",
                "emergency",
                "energy",
                "environment",
                "ethics",
                "finance",
                "fishery",
                "food_drug",
                "foreign_affairs",
                "housing",
                "industry",
                "insurance",
                "intellectual_prop",
                "trade_intl",
                "investment",
                "irrigation",
                "justice",
                "labour",
                "land_urban",
                "land_transport",
                "livestock",
                "public_health_local",
                "mining",
                "narcotics",
                "nationality",
                "pollution_noise",
                "nuclear",
                "information_access",
                "petroleum",
                "politics",
                "pollution",
                "consumer",
                "standards",
                "profession",
                "public_admin",
                "health",
                "rail",
                "juristic_registry",
                "religion",
                "science_tech",
                "securities",
                "social_security",
                "social_welfare",
                "tax",
                "telecom_digital",
                "tourism",
                "transport",
                "university",
                "utilities",
                "pollution_waste",
                "pollution_water",
                "water_resource",
                "marine"
              ],
              "enumTitles": [
                "Accounting standards",
                "Agricultural land reform",
                "Agriculture",
                "Air pollution",
                "Anti-corruption",
                "Anti-money laundering",
                "Aviation",
                "Banking and financial institutions",
                "Bankruptcy and enforcement",
                "Budget, bonds and public debt",
                "Buildings and construction",
                "Climate and greenhouse gases",
                "Commerce and business",
                "Communicable disease control",
                "Conservation, forests and wildlife",
                "Corrections",
                "Courts and judgments",
                "Crops, fertiliser and seeds",
                "Culture, sport and recreation",
                "Defence, military and police",
                "Disasters",
                "Education",
                "Electricity",
                "Electronic government",
                "Emergencies and internal security",
                "Energy",
                "Environment",
                "Ethics of state officials",
                "Finance, treasury and tax",
                "Fisheries",
                "Food and drugs",
                "Foreign affairs",
                "Housing",
                "Industry",
                "Insurance",
                "Intellectual property",
                "International trade",
                "Investment and special economic zones",
                "Irrigation",
                "Justice and litigation",
                "Labour and professions",
                "Land and town planning",
                "Land transport, highways and traffic",
                "Livestock",
                "Local public health and sanitation",
                "Mining",
                "Narcotics",
                "Nationality and immigration",
                "Noise and vibration",
                "Nuclear and atomic energy",
                "Official information",
                "Petroleum and gas",
                "Politics and elections",
                "Pollution",
                "Prices and consumer protection",
                "Product standards (TISI)",
                "Professional councils and licences",
                "Public administration",
                "Public health",
                "Railways",
                "Registration of companies, associations and foundations",
                "Religion",
                "Science and technology",
                "Securities and capital markets",
                "Social security",
                "Social welfare",
                "Tax, customs and excise",
                "Telecoms and digital",
                "Tourism",
                "Transport",
                "Universities",
                "Utilities",
                "Waste and hazardous substances",
                "Water pollution",
                "Water resources",
                "Water transport and marine"
              ]
            }
          },
          "includeCourtAndBankruptcy": {
            "title": "Include court and bankruptcy notices",
            "type": "boolean",
            "description": "About two thirds of all Gazette items are bankruptcy and court notices; they are left out unless you turn this on or pick those topics.",
            "default": false
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "How many days of publications to check. The source is updated daily, usually 1-2 days after publication.",
            "default": 7
          },
          "onlyNew": {
            "title": "Only items not delivered before",
            "type": "boolean",
            "description": "Remembers what earlier runs with the same filters returned. Keep on when you schedule the Actor.",
            "default": true
          },
          "includeText": {
            "title": "Add the start of the text",
            "type": "boolean",
            "description": "Adds textExcerpt (Thai, extracted from the PDF). Slower: the monthly text files are 25-55 MB.",
            "default": false
          },
          "textChars": {
            "title": "Text excerpt length (characters)",
            "minimum": 100,
            "maximum": 20000,
            "type": "integer",
            "description": "Used with 'Add the start of the text'.",
            "default": 1500
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 500
          },
          "webhookUrl": {
            "title": "Webhook URL (Slack, Discord or your own)",
            "type": "string",
            "description": "Slack and Discord webhook URLs get readable messages; any other URL gets a JSON POST with all items. Optional: items are always in the dataset, and Apify integrations (email, Google Sheets, Zapier, Make) work too."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "From @BotFather. Needs the chat ID below."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Your chat, group or channel ID."
          },
          "lineChannelAccessToken": {
            "title": "LINE channel access token",
            "type": "string",
            "description": "Messaging API channel access token of your LINE Official Account. Needs the recipient ID below."
          },
          "lineTo": {
            "title": "LINE user or group ID",
            "type": "string",
            "description": "The user ID (U...) or group ID (C...) to push to."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}