{
  "openapi": "3.0.1",
  "info": {
    "title": "Italy Public Spending – SIOPE Payments & Receipts",
    "description": "Monthly cash payments and receipts of Italian municipalities, provinces and other public bodies from SIOPE (MEF – Ragioneria Generale dello Stato, OpenBDAP open data), by SIOPE code, with year-to-date, monthly and per-capita amounts.",
    "version": "0.1",
    "x-build-id": "M3kTK7MQ1PsxlKoTM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/orchestrated_daffodil~italy-public-spending-siope/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-orchestrated_daffodil-italy-public-spending-siope",
        "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/orchestrated_daffodil~italy-public-spending-siope/runs": {
      "post": {
        "operationId": "runs-sync-orchestrated_daffodil-italy-public-spending-siope",
        "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/orchestrated_daffodil~italy-public-spending-siope/run-sync": {
      "post": {
        "operationId": "run-sync-orchestrated_daffodil-italy-public-spending-siope",
        "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": {
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Region(s) whose SIOPE data to read. The entity you want must be located in one of these regions. Default: Liguria.",
            "items": {
              "type": "string",
              "enum": [
                "Piemonte",
                "Valle d'Aosta",
                "Lombardia",
                "Trentino-Alto Adige",
                "Veneto",
                "Friuli-Venezia Giulia",
                "Liguria",
                "Emilia-Romagna",
                "Toscana",
                "Umbria",
                "Marche",
                "Lazio",
                "Abruzzo",
                "Molise",
                "Campania",
                "Puglia",
                "Basilicata",
                "Calabria",
                "Sicilia",
                "Sardegna"
              ]
            },
            "default": [
              "Liguria"
            ]
          },
          "entities": {
            "title": "Entities (name contains)",
            "type": "array",
            "description": "Optional. Text contained in the official entity name as written in SIOPE, e.g. 'COMUNE DI SANREMO', 'SANREMO', 'PROVINCIA DI IMPERIA', 'UNIONE DEI COMUNI'. Case-insensitive. Leave empty to get every entity of the region (use Provinces / Entity types to narrow down).",
            "items": {
              "type": "string"
            }
          },
          "provinces": {
            "title": "Provinces",
            "type": "array",
            "description": "Optional. Province codes (IM, GE, MI, RM...) or BDAP province names in capitals (IMPERIA, GENOVA...).",
            "items": {
              "type": "string"
            }
          },
          "entityTypes": {
            "title": "Entity type codes",
            "type": "array",
            "description": "Optional. SIOPE entity type codes, e.g. CO = municipalities (Comuni), PR = provinces, UC = unions of municipalities, CM = mountain communities, IS = state schools. The full description is returned in the entityType field.",
            "items": {
              "type": "string"
            }
          },
          "year": {
            "title": "Year",
            "minimum": 2014,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional. Year of the data (SIOPE open data starts in 2014). Leave empty for the latest year available."
          },
          "flow": {
            "title": "Flow",
            "enum": [
              "spesa",
              "entrata",
              "both"
            ],
            "type": "string",
            "description": "Spending (pagamenti / uscite) or receipts (incassi / entrate).",
            "default": "spesa"
          },
          "period": {
            "title": "Months",
            "enum": [
              "latest",
              "all"
            ],
            "type": "string",
            "description": "latest = only the most recent month published (cumulative year-to-date amounts). all = every month of the year, with month-by-month amounts.",
            "default": "latest"
          },
          "months": {
            "title": "Specific months",
            "type": "array",
            "description": "Optional. Month numbers (1-12) to return instead of the 'Months' setting, e.g. [6, 12]."
          },
          "siopeCodes": {
            "title": "SIOPE code prefixes",
            "type": "array",
            "description": "Optional. Keep only SIOPE codes starting with these prefixes, e.g. U1 (current expenditure), U103 (purchase of goods and services), U2 (capital expenditure), E1 (tax revenue).",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Description keywords",
            "type": "array",
            "description": "Optional. Keep only rows whose SIOPE description contains one of these keywords (Italian), e.g. 'rifiuti', 'energia elettrica', 'manutenzione'. All words of a keyword must match.",
            "items": {
              "type": "string"
            }
          },
          "skipZeroRows": {
            "title": "Skip zero rows",
            "type": "boolean",
            "description": "Skip rows whose cumulative and monthly amounts are both zero (you are not charged for skipped rows).",
            "default": true
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of rows to save (you pay per row).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}