{
  "openapi": "3.0.1",
  "info": {
    "title": "Thai Government Procurement (e-GP) & New Company Feed",
    "description": "Clean Thai government procurement contracts (e-GP, FY2558-2568) linked to DBD company registrations: winner age, capital and dissolution, risk signals such as brand-new winners, and the contracts won by each new company. Official open data only.",
    "version": "1.3",
    "x-build-id": "oWg1ECSyYBfLih5uD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chatuporn~thai-procurement-company-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chatuporn-thai-procurement-company-feed",
        "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-procurement-company-feed/runs": {
      "post": {
        "operationId": "runs-sync-chatuporn-thai-procurement-company-feed",
        "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-procurement-company-feed/run-sync": {
      "post": {
        "operationId": "run-sync-chatuporn-thai-procurement-company-feed",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "procurement",
              "tenderAlerts",
              "newCompanies",
              "dissolvedCompanies",
              "companyChanges"
            ],
            "type": "string",
            "description": "Government procurement contracts from e-GP, fresh tender announcements for alerts, or monthly company registrations from the Department of Business Development (DBD).",
            "default": "procurement"
          },
          "fiscalYears": {
            "title": "Fiscal years (Buddhist era)",
            "type": "array",
            "description": "Thai fiscal years, e.g. 2568 = Oct 2024 - Sep 2025. Available: 2565-2568.",
            "default": [
              2568
            ]
          },
          "keyword": {
            "title": "Keyword in project name",
            "type": "string",
            "description": "Thai or English, e.g. คอมพิวเตอร์, ถนน, CCTV."
          },
          "winnerTaxId": {
            "title": "Winner tax ID (13 digits)",
            "type": "string",
            "description": "Juristic person ID of the winning company. Note: the FY2565-2567 source files damaged most IDs, so use winner name for those years."
          },
          "winnerName": {
            "title": "Winner name contains",
            "type": "string",
            "description": "Part of the winning company's Thai name, e.g. พอร์ทัลเน็ท."
          },
          "agency": {
            "title": "Agency (exact Thai name)",
            "type": "string",
            "description": "e.g. การไฟฟ้าส่วนภูมิภาค"
          },
          "projectType": {
            "title": "Project type",
            "enum": [
              "ซื้อ",
              "จ้างก่อสร้าง",
              "จ้างทำของ/จ้างเหมาบริการ",
              "เช่า",
              "จ้างที่ปรึกษา",
              "จ้างออกแบบ",
              "จ้างควบคุมงาน",
              "จ้างออกแบบและควบคุมงานก่อสร้าง"
            ],
            "type": "string",
            "description": "Exact e-GP project type."
          },
          "minAmountThb": {
            "title": "Minimum amount (THB)",
            "minimum": 0,
            "type": "integer",
            "description": "Agreed price (or budget if missing)."
          },
          "maxAmountThb": {
            "title": "Maximum amount (THB)",
            "minimum": 0,
            "type": "integer",
            "description": "Agreed price (or budget if missing)."
          },
          "excludeIndividuals": {
            "title": "Skip contracts won by individuals",
            "type": "boolean",
            "description": "Contracts won by private individuals are always redacted (no name, no ID). Turn this on to drop them entirely.",
            "default": false
          },
          "riskFlags": {
            "title": "Only contracts with these risk signals",
            "type": "array",
            "description": "Keep a contract when its winner shows at least one of these signals in the DBD company files. These are signals for review, not evidence of wrongdoing. Needs the pre-built index; covers winners registered or dissolved since January 2022.",
            "items": {
              "type": "string",
              "enum": [
                "company_under_1_year_at_contract",
                "registered_after_project_announced",
                "company_dissolved",
                "dissolved_before_contract_end"
              ],
              "enumTitles": [
                "Company less than 1 year old when the contract was signed",
                "Company registered after the project was announced",
                "Company has since been dissolved",
                "Company dissolved before the contract end date"
              ]
            }
          },
          "alertKeywords": {
            "title": "Alert keywords (any)",
            "type": "array",
            "description": "Alert when the announcement title contains any of these, e.g. คอมพิวเตอร์, กล้องวงจรปิด, CCTV, ก่อสร้างถนน, จังหวัดเชียงใหม่. Spaces and letter case are ignored. Empty = every announcement of the chosen types.",
            "items": {
              "type": "string"
            }
          },
          "alertExcludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Skip announcements whose title contains any of these.",
            "items": {
              "type": "string"
            }
          },
          "alertTypes": {
            "title": "Announcement types",
            "type": "array",
            "description": "Empty = draft TORs and invitations to bid.",
            "items": {
              "type": "string",
              "enum": [
                "P0",
                "15",
                "B0",
                "D0",
                "W0",
                "D1",
                "W1",
                "D2",
                "W2"
              ],
              "enumTitles": [
                "Procurement plans (แผนการจัดซื้อจัดจ้าง)",
                "Reference prices (ประกาศราคากลาง)",
                "Draft TOR for comment (ร่างเอกสารประกวดราคา)",
                "Invitations to bid (ประกาศเชิญชวน)",
                "Winner announcements (ประกาศผู้ชนะ)",
                "Invitation cancelled (ยกเลิกประกาศเชิญชวน)",
                "Winner cancelled (ยกเลิกประกาศผู้ชนะ)",
                "Invitation changed (เปลี่ยนแปลงประกาศเชิญชวน)",
                "Winner changed (เปลี่ยนแปลงประกาศผู้ชนะ)"
              ]
            }
          },
          "alertMethods": {
            "title": "Procurement methods",
            "type": "array",
            "description": "Empty = every method.",
            "items": {
              "type": "string",
              "enum": [
                "e-bidding",
                "e-market",
                "specific (direct)",
                "selective",
                "price inquiry"
              ],
              "enumTitles": [
                "e-bidding",
                "e-market",
                "Specific / direct (เฉพาะเจาะจง)",
                "Selective (คัดเลือก)",
                "Price inquiry (สอบราคา)"
              ]
            }
          },
          "alertAgencyContains": {
            "title": "Agency or place contains",
            "type": "string",
            "description": "e.g. กรมทางหลวง, เทศบาล, เชียงใหม่. Checked against the announcement title."
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 45,
            "type": "integer",
            "description": "How many days of announcements to check. With 'Only new alerts' on, each announcement is sent once.",
            "default": 2
          },
          "alertOnlyNew": {
            "title": "Only new alerts",
            "type": "boolean",
            "description": "Send each announcement once across scheduled runs with the same filters.",
            "default": true
          },
          "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 alerts. Optional: alerts are always in the dataset, and you can also use Apify integrations (email, Zapier, Make)."
          },
          "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 alerts to."
          },
          "province": {
            "title": "Province (Thai name)",
            "type": "string",
            "description": "Applies to both modes, e.g. เชียงราย, กรุงเทพมหานคร."
          },
          "months": {
            "title": "Months",
            "type": "array",
            "description": "YYYY-MM in CE or BE, e.g. 2026-09 or 2569-09. Leave empty to use the latest months.",
            "items": {
              "type": "string"
            }
          },
          "lastMonths": {
            "title": "Latest N months (if no months given)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How many of the most recent monthly DBD files to read.",
            "default": 1
          },
          "objectiveCodePrefixes": {
            "title": "Business objective code prefixes",
            "type": "array",
            "description": "DBD objective codes (TSIC-based), e.g. 62 for IT services, 41 for building construction.",
            "items": {
              "type": "string"
            }
          },
          "minCapitalThb": {
            "title": "Minimum registered capital (THB)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep companies with at least this registered capital."
          },
          "nameContains": {
            "title": "Company name contains",
            "type": "string",
            "description": "Part of the company's Thai name."
          },
          "onlyWithGovContracts": {
            "title": "Only companies that won government contracts",
            "type": "boolean",
            "description": "Keep only companies found as winners in the indexed e-GP years. Every company comes with a govContracts summary when the index is available.",
            "default": false
          },
          "onlyNew": {
            "title": "Only items not delivered before",
            "type": "boolean",
            "description": "Remembers what earlier runs with the same filters returned. Use with a schedule for alerts.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 1000
          },
          "useIndex": {
            "title": "Use the pre-built index",
            "type": "boolean",
            "description": "Keep this on. The Actor answers from its pre-built copy of the data; the portals do not accept requests from cloud servers.",
            "default": true
          },
          "linkCompanies": {
            "title": "Link companies across e-GP and DBD",
            "type": "boolean",
            "description": "Adds winnerCompany and riskFlags to contracts, and govContracts to companies. Turn off for the plain source fields only.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for these official portals. Leave off.",
            "default": {
              "useApifyProxy": false
            }
          },
          "buildIndex": {
            "title": "Build the index",
            "type": "boolean",
            "description": "Publisher only. Ignored without the admin key.",
            "default": false
          },
          "adminKey": {
            "title": "Admin key",
            "type": "string",
            "description": "Publisher only."
          },
          "collectLive": {
            "title": "Collect the live announcement feed",
            "type": "boolean",
            "description": "Publisher only. Ignored without the admin key.",
            "default": false
          },
          "collectStore": {
            "title": "Live announcement store",
            "type": "string",
            "description": "Publisher only. The key-value store the collector writes to."
          },
          "collectDeptCodes": {
            "title": "Department codes to poll",
            "type": "array",
            "description": "Publisher only. 4-digit e-GP department codes polled in addition to the national feeds.",
            "items": {
              "type": "string"
            }
          },
          "buildFiscalYears": {
            "title": "Fiscal years to index",
            "type": "array",
            "description": "Empty = every year on data.go.th."
          },
          "forceRebuild": {
            "title": "Rebuild unchanged files",
            "type": "boolean",
            "description": "Publisher only. Re-download files even if data.go.th did not change them.",
            "default": false
          },
          "buildCompanyLinks": {
            "title": "Link winners to DBD companies after the build",
            "type": "boolean",
            "description": "Publisher only. Match contract winners to DBD companies after building.",
            "default": true
          },
          "buildMaxFilesPerYear": {
            "title": "Test: max files per year",
            "minimum": 0,
            "type": "integer",
            "description": "Publisher only, for testing."
          },
          "buildMaxRowsPerFile": {
            "title": "Test: max rows per file",
            "minimum": 0,
            "type": "integer",
            "description": "Publisher only, for testing."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}