{
  "openapi": "3.0.1",
  "info": {
    "title": "South Africa Government Tender Awards",
    "description": "Who won South African government tenders, for how much and from which buyer: award rows from the official eTenders API, linked to source.",
    "version": "1.0",
    "x-build-id": "5Ioosh2cPM7ba68A5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mastazee_data_lab~south-africa-government-tender-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mastazee_data_lab-south-africa-government-tender-awards",
        "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-tender-awards/runs": {
      "post": {
        "operationId": "runs-sync-mastazee_data_lab-south-africa-government-tender-awards",
        "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-tender-awards/run-sync": {
      "post": {
        "operationId": "run-sync-mastazee_data_lab-south-africa-government-tender-awards",
        "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": {
          "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 works backwards. Set to 0 to start from the newest tender. Awards are published weeks or months after a tender opens, so the newest few thousand tenders hold few awards. The default, 157000, is May 2026.",
            "default": 157000
          },
          "recordsToScan": {
            "title": "Tenders to scan",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many tender numbers to check, counting back from the start. About 110 tenders are published per day and roughly one in seven readable tenders has an award. 500 takes under a minute; 15000 covers about four to five months (roughly 25 minutes). Maximum 50000 per run.",
            "default": 500
          },
          "maxAwards": {
            "title": "Maximum awards",
            "minimum": 1,
            "type": "integer",
            "description": "Stop once this many award rows have been saved. Leave empty for no limit."
          },
          "buyerContains": {
            "title": "Buyer name contains",
            "type": "string",
            "description": "Only keep awards whose buyer name contains this text, for example \"Revenue Service\" or \"Municipality\". Not case-sensitive."
          },
          "supplierContains": {
            "title": "Supplier name contains",
            "type": "string",
            "description": "Only keep awards whose winning supplier name contains this text. Not case-sensitive."
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Only keep these procurement categories. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "goods",
                "services",
                "works"
              ],
              "enumTitles": [
                "Goods",
                "Services",
                "Works"
              ]
            }
          },
          "provinces": {
            "title": "Buyer province",
            "type": "array",
            "description": "Only keep buyers whose name places them in these provinces (e.g. \"Gauteng Department of Health\", \"City of Johannesburg\"). eTenders has no province field, so national departments and most municipalities have no province and are dropped when this filter 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 (ZAR)",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep awards with a signed contract worth at least this many rand. Awards without a published contract are dropped when this is set."
          },
          "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 keep the awards already saved. The run 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}