{
  "openapi": "3.1.0",
  "info": {
    "title": "fondurieuropene.net API",
    "version": "1.0.0",
    "summary": "Apelurile de finanțare nerambursabilă din România, din surse oficiale.",
    "description": "API public, doar citire, fără autentificare (120 de cereri/minut per IP). Fiecare fapt are sursa oficială; statusul apelului e calculat la data `today`. Eligibilitatea și condițiile complete sunt în ghidul solicitantului. Există și un server MCP la /mcp (search_calls, get_call, list_programs, explain_rule).",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/deed.ro"
    },
    "contact": {
      "name": "fondurieuropene.net",
      "url": "https://fondurieuropene.net/date-deschise"
    }
  },
  "servers": [
    {
      "url": "https://fondurieuropene.net"
    }
  ],
  "paths": {
    "/api/v1/calls": {
      "get": {
        "operationId": "searchCalls",
        "summary": "Caută apeluri",
        "description": "Apelurile active, ordonate după termen (cel mai apropiat întâi).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Text (fără diacritice) în titlu, program, regiune, cod, SMIS"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "upcoming",
                "consultation",
                "closed",
                "other"
              ]
            }
          },
          {
            "name": "program",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Cheia programului (vezi /api/v1/programs)"
          },
          {
            "name": "region",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Regiunea de dezvoltare, de ex. Nord-Est"
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "micro",
                "mica",
                "mijlocie",
                "mare",
                "imm",
                "start-up"
              ]
            },
            "description": "Mărimea firmei; micro/mica/mijlocie includ apelurile pentru IMM"
          },
          {
            "name": "firms",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "0"
              ]
            },
            "description": "1 = doar apelurile în care sursele menționează firme ca beneficiari"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de apeluri",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "today": {
                      "type": "string",
                      "format": "date"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CallSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Eroare (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Eroare (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/calls/{slug}": {
      "get": {
        "operationId": "getCall",
        "summary": "Un apel, cu toate faptele și sursele lor",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]{3,120}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Apelul",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Call"
                }
              }
            }
          },
          "404": {
            "description": "Eroare (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Eroare (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Eroare (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/programs": {
      "get": {
        "operationId": "listPrograms",
        "summary": "Programele și regiunile cu apeluri active",
        "responses": {
          "200": {
            "description": "Programe și regiuni, cu numărul de apeluri pe status"
          }
        }
      }
    },
    "/api/v1/sources": {
      "get": {
        "operationId": "listSources",
        "summary": "Sursele oficiale și ultima preluare",
        "responses": {
          "200": {
            "description": "Surse"
          }
        }
      }
    },
    "/data/apeluri.json": {
      "get": {
        "operationId": "dumpJson",
        "summary": "Toate apelurile active (rezumat), JSON",
        "responses": {
          "200": {
            "description": "Dump"
          }
        }
      }
    },
    "/data/apeluri.csv": {
      "get": {
        "operationId": "dumpCsv",
        "summary": "Toate apelurile active (rezumat), CSV UTF-8",
        "responses": {
          "200": {
            "description": "Dump",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CallSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "program": {
            "type": "object",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "upcoming",
              "consultation",
              "closed",
              "other"
            ]
          },
          "statusLabel": {
            "type": "string"
          },
          "statusBasis": {
            "type": "string",
            "enum": [
              "dates",
              "no-deadline",
              "declared",
              "estimated",
              "unknown"
            ]
          },
          "open": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "time": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "HH:MM, ora României"
              },
              "estimated": {
                "type": "boolean",
                "description": "dată provizorie din calendarul MIPE"
              }
            }
          },
          "close": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "time": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "HH:MM, ora României"
              },
              "estimated": {
                "type": "boolean",
                "description": "dată provizorie din calendarul MIPE"
              }
            }
          },
          "openToFirms": {
            "type": "boolean"
          },
          "firmSizes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "micro",
                "mica",
                "mijlocie",
                "mare",
                "imm",
                "start-up"
              ]
            }
          },
          "budget": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "type": "string",
                "examples": [
                  "EUR",
                  "RON"
                ]
              },
              "kind": {
                "type": "string",
                "description": "eu = contribuția UE, total = bugetul total"
              }
            }
          },
          "callCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "smis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conflicts": {
            "type": "integer",
            "description": "numărul de câmpuri pe care sursele nu se potrivesc"
          },
          "version": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "urls": {
            "type": "object",
            "properties": {
              "html": {
                "type": "string",
                "format": "uri"
              },
              "markdown": {
                "type": "string",
                "format": "uri"
              },
              "json": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "Call": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "description": "2–3 propoziții citabile, doar din date"
          },
          "status": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "enum": [
                  "open",
                  "upcoming",
                  "consultation",
                  "closed",
                  "other"
                ]
              },
              "label": {
                "type": "string"
              },
              "basis": {
                "type": "string"
              },
              "basisNote": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "computedAt": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "program": {
            "type": "object",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "callCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "smis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dates": {
            "type": "object",
            "properties": {
              "consultationStart": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HH:MM, ora României"
                  },
                  "estimated": {
                    "type": "boolean",
                    "description": "dată provizorie din calendarul MIPE"
                  },
                  "source": {
                    "type": "string",
                    "description": "id-ul sursei (vezi /api/v1/sources)"
                  }
                }
              },
              "consultationEnd": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HH:MM, ora României"
                  },
                  "estimated": {
                    "type": "boolean",
                    "description": "dată provizorie din calendarul MIPE"
                  },
                  "source": {
                    "type": "string",
                    "description": "id-ul sursei (vezi /api/v1/sources)"
                  }
                }
              },
              "open": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HH:MM, ora României"
                  },
                  "estimated": {
                    "type": "boolean",
                    "description": "dată provizorie din calendarul MIPE"
                  },
                  "source": {
                    "type": "string",
                    "description": "id-ul sursei (vezi /api/v1/sources)"
                  }
                }
              },
              "close": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HH:MM, ora României"
                  },
                  "estimated": {
                    "type": "boolean",
                    "description": "dată provizorie din calendarul MIPE"
                  },
                  "source": {
                    "type": "string",
                    "description": "id-ul sursei (vezi /api/v1/sources)"
                  }
                }
              }
            }
          },
          "budget": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "type": "string",
                "examples": [
                  "EUR",
                  "RON"
                ]
              },
              "kind": {
                "type": "string",
                "description": "eu = contribuția UE, total = bugetul total"
              },
              "source": {
                "type": "string"
              }
            }
          },
          "openToFirms": {
            "type": "boolean"
          },
          "firmSizes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "beneficiaries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "date": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source": {
                  "type": "string"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "q": {
                  "type": "string"
                },
                "a": {
                  "type": "string"
                }
              }
            }
          },
          "citation": {
            "type": "string"
          },
          "urls": {
            "type": "object",
            "properties": {
              "html": {
                "type": "string",
                "format": "uri"
              },
              "markdown": {
                "type": "string",
                "format": "uri"
              },
              "json": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "license": {
            "type": "object"
          },
          "notice": {
            "type": "string"
          }
        }
      }
    }
  }
}
