{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Green Grants Radar (BDNS): Subvenciones verdes",
    "description": "Open Spanish grant calls for waste, energy, forestry, water, biodiversity, mobility and agriculture from the official BDNS/SNPSAP open-data API. 0-100 relevance score, open/closing-soon, beneficiary and region filters. Calls only, no beneficiary data. Unofficial service.",
    "version": "1.0",
    "x-build-id": "xcyA6ZQf4TbLWhxNi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rubenpa~spain-green-grants/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rubenpa-spain-green-grants",
        "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/rubenpa~spain-green-grants/runs": {
      "post": {
        "operationId": "runs-sync-rubenpa-spain-green-grants",
        "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/rubenpa~spain-green-grants/run-sync": {
      "post": {
        "operationId": "run-sync-rubenpa-spain-green-grants",
        "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": {
          "categories": {
            "title": "Green sectors",
            "type": "array",
            "description": "Sectors to search. Default: all eight.",
            "items": {
              "type": "string",
              "enum": [
                "waste_circular",
                "energy",
                "forestry_wildfire",
                "water",
                "biodiversity",
                "mobility",
                "agriculture",
                "climate_environment"
              ],
              "enumTitles": [
                "Waste & circular economy",
                "Energy efficiency & renewables",
                "Forestry & wildfire prevention",
                "Water & sanitation",
                "Biodiversity & nature conservation",
                "Sustainable mobility",
                "Sustainable agriculture",
                "Climate & environment (general)"
              ]
            },
            "default": [
              "waste_circular",
              "energy",
              "forestry_wildfire",
              "water",
              "biodiversity",
              "mobility",
              "agriculture",
              "climate_environment"
            ]
          },
          "applicationStatus": {
            "title": "Application status",
            "enum": [
              "open_or_upcoming",
              "closing_soon",
              "any"
            ],
            "type": "string",
            "description": "'Open or upcoming' (default) keeps calls whose application window is open, opens soon or has no published end date. 'Closing soon' keeps only calls closing within the number of days below. 'Any' also returns closed calls.",
            "default": "open_or_upcoming"
          },
          "closingSoonDays": {
            "title": "'Closing soon' threshold (days)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Calls whose deadline is within this many days get status 'closing_soon' (1-180).",
            "default": 15
          },
          "deadlineBefore": {
            "title": "Deadline on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional: keep only calls whose application deadline is on or before this date. Calls without a published deadline are dropped when this is set."
          },
          "beneficiaryTypes": {
            "title": "Who can apply",
            "type": "array",
            "description": "Keep calls open to at least one of these beneficiary types. Empty = all. Derived from the official beneficiary type plus wording in the call title and bases (the official type is always output).",
            "items": {
              "type": "string",
              "enum": [
                "companies",
                "smes",
                "self_employed",
                "local_entities",
                "ngos",
                "individuals"
              ],
              "enumTitles": [
                "Companies (any size)",
                "SMEs",
                "Self-employed (autónomos)",
                "Local entities (town councils, provincial councils, consortia)",
                "NGOs and non-profits",
                "Individuals (no economic activity)"
              ]
            },
            "default": []
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Region names or NUTS codes (e.g. Cataluña, Andalucía, Navarra, ES51, ES61). Nationwide calls are always kept because they are open to every region. Empty = all Spain.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minBudget": {
            "title": "Minimum total budget (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum total budget of the call. Calls without a published budget are dropped when this is set, unless includeUnknownBudget is true. 0 = no limit.",
            "default": 0
          },
          "includeUnknownBudget": {
            "title": "Include calls with no published budget",
            "type": "boolean",
            "description": "Off by default. When minBudget is set, calls without a published budget are dropped and not charged (pay-per-event). Turn this on only if you want them delivered, flagged as budgetUnknown.",
            "default": false
          },
          "minRelevance": {
            "title": "Minimum relevance (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only calls scoring at least this are delivered. 40 (default) balances precision and coverage; 60+ keeps only clear-cut cases.",
            "default": 40
          },
          "includeDirectGrants": {
            "title": "Include direct grants",
            "type": "boolean",
            "description": "Direct grants (concesión directa) are awarded to a named beneficiary without a public application window, so they are not actionable for applicants. Off by default.",
            "default": false
          },
          "daysBack": {
            "title": "Registered in the last N days",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Look-back window on the date the call was registered in the BDNS (1-730).",
            "default": 90
          },
          "keywords": {
            "title": "Extra keywords",
            "type": "array",
            "description": "Optional own words/phrases (Spanish). They are searched in the call title and count as strong evidence under the 'custom' sector, in addition to the sectors above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Words to exclude",
            "type": "array",
            "description": "Calls whose title or bases contain any of these words are dropped.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum calls to deliver",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Best-scored first. Each delivered call is one billable event.",
            "default": 100
          },
          "maxDetailRequests": {
            "title": "Maximum detail lookups",
            "minimum": 10,
            "maximum": 3000,
            "type": "integer",
            "description": "Safety cap on the sequential, rate-limited per-call lookups (about 0.3 s each) made to the official API.",
            "default": 400
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}