{
  "openapi": "3.0.1",
  "info": {
    "title": "Compra Ágil Scraper — Chile Mercado Público Quotes",
    "description": "Scrape Compra Ágil purchase requests from Chile's Mercado Público: title, buyer, region, CLP budget, deadlines, requested products, quotes received, winning supplier and purchase order. Find public-sector leads fast. From US$3 per 1,000 requests.",
    "version": "0.1",
    "x-build-id": "dPhSbFG2LTjbcQg6g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~compra-agil-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-compra-agil-scraper",
        "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/fabrikit~compra-agil-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-compra-agil-scraper",
        "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/fabrikit~compra-agil-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-compra-agil-scraper",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Search words, same as the site's search box (matched against title and description; several words = ANY of them). Example: `notebook`, `aseo`, `agua purificada`. Leave empty for everything.",
            "default": ""
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Buyer's region. Empty = all 16 regions.",
            "items": {
              "type": "string",
              "enum": [
                "15",
                "1",
                "2",
                "3",
                "4",
                "5",
                "13",
                "6",
                "7",
                "16",
                "8",
                "9",
                "14",
                "10",
                "11",
                "12"
              ],
              "enumTitles": [
                "Arica y Parinacota (XV)",
                "Tarapacá (I)",
                "Antofagasta (II)",
                "Atacama (III)",
                "Coquimbo (IV)",
                "Valparaíso (V)",
                "Metropolitana de Santiago (RM)",
                "O'Higgins (VI)",
                "Maule (VII)",
                "Ñuble (XVI)",
                "Biobío (VIII)",
                "Araucanía (IX)",
                "Los Ríos (XIV)",
                "Los Lagos (X)",
                "Aysén (XI)",
                "Magallanes (XII)"
              ]
            },
            "default": []
          },
          "status": {
            "title": "Status",
            "enum": [
              "published",
              "closed",
              "supplierSelected",
              "cancelled",
              "deserted",
              "all"
            ],
            "type": "string",
            "description": "`published` = open and receiving quotes right now (the leads). `supplierSelected` = winner chosen / purchase order issued — useful for price intelligence.",
            "default": "published"
          },
          "dateFrom": {
            "title": "Published from",
            "type": "string",
            "description": "First publication date (YYYY-MM-DD). Empty = use \"Last N days\"."
          },
          "dateTo": {
            "title": "Published to",
            "type": "string",
            "description": "Last publication date (YYYY-MM-DD). Empty = today (Chile time)."
          },
          "lastDays": {
            "title": "Last N days (when no \"Published from\")",
            "minimum": 1,
            "maximum": 366,
            "type": "integer",
            "description": "Publication window ending today (or on \"Published to\"). Compra Ágil requests usually close 1–5 days after publication, so 3–7 days covers everything still open.",
            "default": 5
          },
          "fetchDetails": {
            "title": "Fetch full details",
            "type": "boolean",
            "description": "One extra request per result (no extra charge) to add: description, buyer RUT, estimated budget, delivery address and term, requested products with UNSPSC codes and quantities, quotes received (supplier, amounts, winner), selection/cancellation reason and the purchase order code + link. The official detail service is slow (typically 2–20 s per record, a few heavy records time out and keep list data only), so turn this off for ~10x faster list-only runs.",
            "default": true
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many Compra Ágil requests. A normal weekday has ~3,500–4,000 new requests nationwide.",
            "default": 30
          },
          "source": {
            "title": "Data source",
            "enum": [
              "auto",
              "searchApi",
              "officialApi"
            ],
            "type": "string",
            "description": "`auto` = public search engine of buscador.mercadopublico.cl, and if it is down, ChileCompra's official Compra Ágil API. `officialApi` forces the official API (needs the ticket below; slower, daily quota).",
            "default": "auto"
          },
          "ticket": {
            "title": "Mercado Público API ticket (fallback only)",
            "type": "string",
            "description": "Only used by the official-API fallback. Free at https://www.chilecompra.cl/api/ → \"Pide tu ticket\" (ClaveÚnica login, e-mailed instantly). Empty = try the public demo ticket from the API docs."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed. If the site ever blocks Apify's datacenter IPs (HTML 403), the Actor switches to Chilean residential proxies automatically.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}