{
  "openapi": "3.0.1",
  "info": {
    "title": "Vietnam Tender Intelligence",
    "description": "Monitor Vietnam's e-procurement portal muasamcong (VNEPS) by keyword: upcoming plans, open tenders, and contract awards — full tender lifecycle in one Actor. Theo dõi đấu thầu công Việt Nam: kế hoạch, thông báo mời thầu, kết quả trúng thầu.",
    "version": "0.2",
    "x-build-id": "dMeXgzFwZuVepHt73"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/donerightlabs~tender-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-donerightlabs-tender-intelligence",
        "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/donerightlabs~tender-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-donerightlabs-tender-intelligence",
        "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/donerightlabs~tender-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-donerightlabs-tender-intelligence",
        "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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Danh sách từ khoá đấu thầu",
            "maxItems": 20,
            "type": "array",
            "description": "Từ khoá gói thầu cần theo dõi trên Hệ thống mạng đấu thầu quốc gia (VNEPS), ví dụ: \"thiết bị y tế\".",
            "default": [
              "thiết bị"
            ],
            "items": {
              "type": "string"
            }
          },
          "recordType": {
            "title": "Loại dữ liệu",
            "enum": [
              "notices",
              "plans",
              "awards",
              "awards_by_date"
            ],
            "type": "string",
            "description": "Thông báo mời thầu (mặc định): tìm gói thầu theo từ khoá. Kế hoạch lựa chọn nhà thầu (KHLCNT): tìm các kế hoạch (dự định mua sắm sắp tới, thường công bố TRƯỚC khi có thông báo mời thầu chính thức) theo từ khoá - mỗi kế hoạch có thể gồm nhiều gói thầu con. Kết quả trúng thầu: tìm gói thầu đã đóng theo từ khoá rồi lấy tên nhà thầu thắng + giá trúng thầu cho từng gói (bỏ qua trường 'Chỉ lấy gói thầu còn mở'; chỉ trả về gói đã có kết quả công bố). Kết quả trúng thầu tốn nhiều thời gian/chi phí hơn mỗi từ khoá vì phải mở riêng từng gói - nên đặt Số kết quả tối đa mỗi từ khoá thấp (khoảng 5) khi dùng chế độ này. Kết quả trúng thầu theo ngày: không cần từ khoá - duyệt toàn bộ kết quả trúng thầu mới công bố trong 1 tỉnh/thành theo khoảng ngày (bắt buộc chọn trường 'Tỉnh/thành phố' bên dưới khi dùng chế độ này).",
            "default": "notices"
          },
          "maxResultsPerKeyword": {
            "title": "Số kết quả tối đa mỗi từ khoá",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Giới hạn số gói thầu lấy về cho mỗi từ khoá (hoặc mỗi lượt duyệt, khi dùng chế độ 'Kết quả trúng thầu theo ngày').",
            "default": 3
          },
          "onlyOpenTenders": {
            "title": "Chỉ lấy gói thầu còn mở",
            "type": "boolean",
            "description": "Bật: chỉ trả về gói thầu có ngày đóng thầu từ hôm nay trở đi. Tắt: trả về cả gói đã đóng thầu trong quá khứ (hữu ích nếu muốn xem lịch sử/phân tích xu hướng). Không áp dụng khi Loại dữ liệu là 'Kết quả trúng thầu theo ngày'.",
            "default": true
          },
          "province": {
            "title": "Tỉnh/ Thành phố",
            "enum": [
              "Thành phố Hà Nội",
              "Thành phố Hải Phòng",
              "Thành phố Hồ Chí Minh",
              "Thành phố Đà Nẵng",
              "Thành phố Huế",
              "Thành phố Cần Thơ",
              "Thành phố Bắc Ninh",
              "Thành phố Quảng Ninh",
              "Thành phố Đồng Nai",
              "Tỉnh An Giang",
              "Tỉnh Cao Bằng",
              "Tỉnh Cà Mau",
              "Tỉnh Gia Lai",
              "Tỉnh Hà Tĩnh",
              "Tỉnh Hưng Yên",
              "Tỉnh Khánh Hòa",
              "Tỉnh Lai Châu",
              "Tỉnh Lào Cai",
              "Tỉnh Lâm Đồng",
              "Tỉnh Lạng Sơn",
              "Tỉnh Nghệ An",
              "Tỉnh Ninh Bình",
              "Tỉnh Phú Thọ",
              "Tỉnh Quảng Ngãi",
              "Tỉnh Quảng Trị",
              "Tỉnh Sơn La",
              "Tỉnh Thanh Hóa",
              "Tỉnh Thái Nguyên",
              "Tỉnh Tuyên Quang",
              "Tỉnh Tây Ninh",
              "Tỉnh Vĩnh Long",
              "Tỉnh Điện Biên",
              "Tỉnh Đắk Lắk",
              "Tỉnh Đồng Tháp"
            ],
            "type": "string",
            "description": "BẮT BUỘC khi Loại dữ liệu = 'Kết quả trúng thầu theo ngày'. Chỉ lấy kết quả trúng thầu của các gói thầu thực hiện tại tỉnh/thành này (theo địa giới hành chính hiện hành, sau sáp nhập 2025). Bỏ qua ở 2 chế độ còn lại."
          },
          "dateFrom": {
            "title": "Từ ngày (chỉ dùng cho Kết quả trúng thầu theo ngày)",
            "type": "string",
            "description": "Định dạng dd/mm/yyyy, ví dụ 25/09/2026. Để trống: actor tự lấy mặc định là hôm qua (khoảng ngày hẹp, an toàn cho lượt chạy tự động mặc định)."
          },
          "dateTo": {
            "title": "Đến ngày (chỉ dùng cho Kết quả trúng thầu theo ngày)",
            "type": "string",
            "description": "Định dạng dd/mm/yyyy, ví dụ 30/09/2026. Để trống: actor tự lấy mặc định là hôm nay."
          },
          "proxyConfiguration": {
            "title": "Cấu hình Proxy",
            "type": "object",
            "description": "Khuyến nghị bật Residential Proxy (Việt Nam) để tăng độ ổn định kết nối.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyCountry": "VN"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}