{
  "openapi": "3.0.1",
  "info": {
    "title": "South Africa Government Supplier Tracker",
    "description": "Which suppliers win South African government tenders: eTenders awards grouped by supplier, with buyers, signed contract values and official links.",
    "version": "1.0",
    "x-build-id": "UlnYEJhpJtaJnupml"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mastazee_data_lab~south-africa-government-supplier-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mastazee_data_lab-south-africa-government-supplier-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/mastazee_data_lab~south-africa-government-supplier-tracker/runs": {
      "post": {
        "operationId": "runs-sync-mastazee_data_lab-south-africa-government-supplier-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/mastazee_data_lab~south-africa-government-supplier-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-mastazee_data_lab-south-africa-government-supplier-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": {
          "supplierNames": {
            "title": "Supplier names",
            "type": "array",
            "description": "Only keep suppliers whose name contains one of these (not case-sensitive), e.g. \"security\" or \"Microsoft\". Leave empty to see every supplier in the scanned range.",
            "items": {
              "type": "string"
            }
          },
          "supplierIds": {
            "title": "eTenders supplier ids",
            "type": "array",
            "description": "Only keep these eTenders supplier ids (the supplier_id field of an earlier run). The most precise way to follow a known company.",
            "items": {
              "type": "string"
            }
          },
          "toOcid": {
            "title": "Start from tender number",
            "minimum": 0,
            "type": "integer",
            "description": "The scan starts at this eTenders tender number (the digits after ocds-9t57fa-) and counts back. 0 means the newest tender. Awards appear weeks or months after a tender opens, so the default (157000, May 2026) returns awards straight away.",
            "default": 157000
          },
          "recordsToScan": {
            "title": "Tenders to scan",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many tender numbers to check. About 110 tenders are published a day; 500 takes about a minute, 15000 (about 4-5 months) roughly half an hour. Maximum 50000 per run.",
            "default": 500
          },
          "buyerContains": {
            "title": "Buyer name contains",
            "type": "string",
            "description": "Only count awards from buyers whose name contains this text."
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Only count awards in these procurement categories.",
            "items": {
              "type": "string",
              "enum": [
                "goods",
                "services",
                "works"
              ]
            }
          },
          "provinces": {
            "title": "Buyer province",
            "type": "array",
            "description": "Only count awards from buyers whose name places them in these provinces. eTenders has no province field; national departments and most municipalities have none and are dropped when this is set.",
            "items": {
              "type": "string",
              "enum": [
                "Eastern Cape",
                "Western Cape",
                "Northern Cape",
                "Free State",
                "KwaZulu-Natal",
                "Gauteng",
                "Limpopo",
                "Mpumalanga",
                "North West"
              ]
            }
          },
          "minContractValue": {
            "title": "Minimum contract value per award (ZAR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only count awards with a signed contract worth at least this much. Awards without a published contract are dropped when this is set."
          },
          "onlyNewAwards": {
            "title": "Only awards not seen in earlier runs",
            "type": "boolean",
            "description": "For scheduled monitoring: leave out awards already delivered by an earlier run of the same monitor (same state key and filters), so you are charged once per supplier delivery. A run started while the same monitor is still running stops without output.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name for this monitor's memory when 'Only awards not seen in earlier runs' is on. Monitors with different filters keep separate memories automatically; use a different key to start a watch list over.",
            "default": "default"
          },
          "includeAwardList": {
            "title": "Include each supplier's award list",
            "type": "boolean",
            "description": "Adds the individual awards (with links to the official records) to each supplier row.",
            "default": true
          },
          "maxResults": {
            "title": "Maximum suppliers",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many supplier rows. Leave empty for no limit."
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Requests sent to the eTenders API at once. Keep this low; it is a government server.",
            "default": 4
          },
          "maxRuntimeSeconds": {
            "title": "Maximum scan time (seconds)",
            "minimum": 60,
            "maximum": 36000,
            "type": "integer",
            "description": "Stop scanning after this long and output what was found. The summary says how far the scan got.",
            "default": 3300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}