{
    "openapi": "3.1.0",
    "info": {
        "title": "API de datos abiertos de Quedé",
        "version": "1.0.0",
        "summary": "Datos de admisión a la UNAM y al IPN: aciertos, lugares y calendario.",
        "description": "Datos públicos de admisión a licenciatura de la UNAM y del IPN que usa Quedé, con fuente oficial. Sin registro ni llaves: cada endpoint responde a GET y permite CORS. Cada respuesta incluye la fecha de revisión y la licencia. Metodología: https://quede.app/metodologia-de-datos.\n\nFree and open: no API key, no sign-up and no authentication required. Rate limit: 120 requests per minute per IP, reported in the X-RateLimit-Limit and X-RateLimit-Remaining headers.\n\nVersiones y deprecación: v1 es estable. Un cambio incompatible irá en /api/v2, y v1 seguirá respondiendo al menos 6 meses después, con los headers Deprecation y Sunset y aviso en esta página. Los campos nuevos se agregan sin cambiar de versión.",
        "contact": {
            "name": "Quedé",
            "email": "hola@quede.app",
            "url": "https://quede.app/contacto"
        },
        "license": {
            "name": "CC BY 4.0",
            "url": "https://creativecommons.org/licenses/by/4.0/deed.es"
        }
    },
    "externalDocs": {
        "description": "Documentación y ejemplos",
        "url": "https://quede.app/datos/api"
    },
    "servers": [
        {
            "url": "https://quede.app/api/v1"
        }
    ],
    "security": [],
    "paths": {
        "/datos": {
            "get": {
                "operationId": "listDatasets",
                "summary": "Lista los datasets disponibles",
                "responses": {
                    "200": {
                        "description": "Datasets con su descripción y URLs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DatasetList"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/datos/{dataset}": {
            "get": {
                "operationId": "getDataset",
                "summary": "Descarga un dataset completo",
                "parameters": [
                    {
                        "name": "dataset",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "aciertos-historicos-unam",
                                "lugares-ipn",
                                "estimaciones-ipn",
                                "calendario-admision"
                            ]
                        },
                        "description": "`aciertos-historicos-unam`: Corte oficial por carrera, plantel y modalidad, 2021–2025, con el mínimo 2021–2026, lugares y demanda. `lugares-ipn`: Oferta de lugares de cada carrera y escuela en las convocatorias 27/1 y 27/2. `estimaciones-ipn`: Cifras publicadas por medios, sin metodología verificable. No oficiales. `calendario-admision`: Fechas de cada ciclo con su estado (confirmada, referencia, estimada) y fuente."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "El dataset con sus metadatos.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Dataset"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "El dataset no existe.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Más de 120 peticiones por minuto.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "message"
                ],
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "Qué salió mal."
                    }
                }
            },
            "Dataset": {
                "type": "object",
                "required": [
                    "dataset",
                    "titulo",
                    "actualizado",
                    "licencia",
                    "datos"
                ],
                "properties": {
                    "dataset": {
                        "type": "string",
                        "enum": [
                            "aciertos-historicos-unam",
                            "lugares-ipn",
                            "estimaciones-ipn",
                            "calendario-admision"
                        ]
                    },
                    "titulo": {
                        "type": "string"
                    },
                    "descripcion": {
                        "type": "string"
                    },
                    "actualizado": {
                        "type": "string",
                        "format": "date"
                    },
                    "licencia": {
                        "type": "string"
                    },
                    "csv": {
                        "type": "string",
                        "format": "uri"
                    },
                    "datos": {
                        "type": "array",
                        "description": "Las filas; sus campos dependen del dataset.",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/AciertosHistoricosUnamRow"
                                },
                                {
                                    "$ref": "#/components/schemas/LugaresIpnRow"
                                },
                                {
                                    "$ref": "#/components/schemas/EstimacionesIpnRow"
                                },
                                {
                                    "$ref": "#/components/schemas/CalendarioAdmisionRow"
                                }
                            ]
                        }
                    }
                }
            },
            "DatasetList": {
                "type": "object",
                "properties": {
                    "datasets": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "dataset": {
                                    "type": "string"
                                },
                                "titulo": {
                                    "type": "string"
                                },
                                "descripcion": {
                                    "type": "string"
                                },
                                "json": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "csv": {
                                    "type": "string",
                                    "format": "uri"
                                }
                            }
                        }
                    }
                }
            },
            "AciertosHistoricosUnamRow": {
                "type": "object",
                "title": "Fila: Aciertos históricos de la UNAM",
                "properties": {
                    "clave_carrera": {
                        "type": "string"
                    },
                    "carrera": {
                        "type": "string"
                    },
                    "area": {
                        "type": "integer"
                    },
                    "clave_plantel": {
                        "type": "string"
                    },
                    "plantel": {
                        "type": "string"
                    },
                    "sede": {
                        "type": [
                            "null",
                            "string"
                        ]
                    },
                    "modalidad": {
                        "type": "string"
                    },
                    "ingreso_indirecto": {
                        "type": "string"
                    },
                    "aciertos_2021": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "aciertos_2022": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "aciertos_2023": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "aciertos_2024": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "aciertos_2025": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "aciertos_2026": {
                        "type": "null"
                    },
                    "minimo_2021_2026": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2021": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2022": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2023": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2024": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2025": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_2026": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "demanda_2021": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "demanda_2022": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "demanda_2023": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "demanda_2024": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "demanda_2025": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "LugaresIpnRow": {
                "type": "object",
                "title": "Fila: Lugares del IPN por escuela",
                "properties": {
                    "escuela": {
                        "type": "string"
                    },
                    "nombre_escuela": {
                        "type": "string"
                    },
                    "entidad": {
                        "type": "string"
                    },
                    "carrera": {
                        "type": "string"
                    },
                    "rama": {
                        "type": "string"
                    },
                    "modalidad": {
                        "type": "string"
                    },
                    "lugares_27_1_agosto_2026": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "lugares_27_2_febrero_2027": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "EstimacionesIpnRow": {
                "type": "object",
                "title": "Fila: Estimaciones de aciertos IPN (prensa)",
                "properties": {
                    "carrera": {
                        "type": "string"
                    },
                    "escuela": {
                        "type": [
                            "null",
                            "string"
                        ]
                    },
                    "aciertos_estimados": {
                        "type": "integer"
                    },
                    "fuente": {
                        "type": "string"
                    },
                    "fecha_publicacion": {
                        "type": "string"
                    },
                    "proceso_referido": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "etiqueta": {
                        "type": "string"
                    }
                }
            },
            "CalendarioAdmisionRow": {
                "type": "object",
                "title": "Fila: Calendario de admisión UNAM e IPN",
                "properties": {
                    "institucion": {
                        "type": "string"
                    },
                    "ciclo": {
                        "type": "string"
                    },
                    "evento": {
                        "type": "string"
                    },
                    "inicio": {
                        "type": "string"
                    },
                    "fin": {
                        "type": "string"
                    },
                    "estado": {
                        "type": "string"
                    },
                    "aproximada": {
                        "type": "boolean"
                    },
                    "nota": {
                        "type": [
                            "null",
                            "string"
                        ]
                    },
                    "fuente": {
                        "type": "string"
                    }
                }
            }
        }
    }
}