{"openapi":"3.0.3","info":{"title":"ENEM API","description":"API publica para consulta de provas e questões do ENEM","version":"1.0.0","contact":{"name":"yunger","url":"https://github.com/yunger7"}},"servers":[{"url":"https://api.enem.dev/v1","description":"API de produção"}],"paths":{"/exams":{"get":{"operationId":"getExams","summary":"Listar provas","description":"Listar todas as provas disponíveis","tags":["Provas"],"responses":{"200":{"description":"Lista de provas","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"O título da prova","example":"ENEM 2020"},"year":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O ano em que a prova foi aplicada","example":2020},"disciplines":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"O nome da disciplina"},"value":{"type":"string","description":"O código da disciplina"}},"required":["label","value"]},"description":"As disciplinas da prova","example":[{"label":"Ciências Humanas e suas Tecnologias","value":"ciencias-humanas"},{"label":"Ciências da Natureza e suas Tecnologias","value":"ciencias-natureza"},{"label":"Linguagens, Códigos e suas Tecnologias","value":"linguagens"},{"label":"Matemática e suas Tecnologias","value":"matematica"}]},"languages":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"O nome do idioma"},"value":{"type":"string","description":"O código do idioma"}},"required":["label","value"]},"description":"Os idiomas da prova","example":[{"label":"Espanhol","value":"espanhol"},{"label":"Inglês","value":"ingles"}]}},"required":["title","year","disciplines","languages"],"title":"Prova"}}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).","content":{"application/json":{"schema":{"x-speakeasy-name-override":"BadRequest","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"],"description":"A short code indicating the error code returned.","example":"bad_request"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#bad-request"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"NotFound","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"],"description":"A short code indicating the error code returned.","example":"not_found"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot find the requested resource."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#not-found"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"UnprocessableEntity","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"A short code indicating the error code returned.","example":"unprocessable_entity"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The request was well-formed but was unable to be followed due to semantic errors."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#unprocessable-entity"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"The user has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"x-speakeasy-name-override":"RateLimitExceeded","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limit_exceeded"],"description":"A short code indicating the error code returned.","example":"rate_limit_exceeded"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The user has sent too many requests in a given amount of time"},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#rate-limit_exceeded"}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"The server has encountered a situation it does not know how to handle.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InternalServerError","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"A short code indicating the error code returned.","example":"internal_server_error"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server has encountered a situation it does not know how to handle."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#internal-server_error"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/exams/{year}":{"get":{"operationId":"getExamDetails","summary":"Listar prova","description":"Lstar detalhes de uma prova por seu ano","tags":["Provas"],"parameters":[{"in":"path","name":"year","description":"O ano em que a prova foi aplicada","schema":{"$ref":"#/components/schemas/year"},"required":true}],"responses":{"200":{"description":"Detalhes da prova","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"O título da prova","example":"ENEM 2020"},"year":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O ano em que a prova foi aplicada","example":2020},"disciplines":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"O nome da disciplina"},"value":{"type":"string","description":"O código da disciplina"}},"required":["label","value"]},"description":"As disciplinas da prova","example":[{"label":"Ciências Humanas e suas Tecnologias","value":"ciencias-humanas"},{"label":"Ciências da Natureza e suas Tecnologias","value":"ciencias-natureza"},{"label":"Linguagens, Códigos e suas Tecnologias","value":"linguagens"},{"label":"Matemática e suas Tecnologias","value":"matematica"}]},"languages":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"O nome do idioma"},"value":{"type":"string","description":"O código do idioma"}},"required":["label","value"]},"description":"Os idiomas da prova","example":[{"label":"Espanhol","value":"espanhol"},{"label":"Inglês","value":"ingles"}]},"questions":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"O título da questão","example":"Questão 1 - ENEM 2020"},"index":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O número da questão na prova","example":1},"discipline":{"type":"string","nullable":true,"description":"A disciplina da questão","example":"linguagens"},"language":{"type":"string","nullable":true,"description":"O idioma da questão","example":"ingles"}},"required":["title","index","discipline","language"],"title":"Questão"},"description":"As questões da prova"}},"required":["title","year","disciplines","languages","questions"],"title":"Detalhes da prova"}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).","content":{"application/json":{"schema":{"x-speakeasy-name-override":"BadRequest","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"],"description":"A short code indicating the error code returned.","example":"bad_request"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#bad-request"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"NotFound","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"],"description":"A short code indicating the error code returned.","example":"not_found"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot find the requested resource."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#not-found"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"UnprocessableEntity","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"A short code indicating the error code returned.","example":"unprocessable_entity"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The request was well-formed but was unable to be followed due to semantic errors."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#unprocessable-entity"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"The user has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"x-speakeasy-name-override":"RateLimitExceeded","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limit_exceeded"],"description":"A short code indicating the error code returned.","example":"rate_limit_exceeded"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The user has sent too many requests in a given amount of time"},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#rate-limit_exceeded"}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"The server has encountered a situation it does not know how to handle.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InternalServerError","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"A short code indicating the error code returned.","example":"internal_server_error"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server has encountered a situation it does not know how to handle."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#internal-server_error"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/exams/{year}/questions":{"get":{"operationId":"getQuestions","summary":"Listar questões","description":"Listar questões de uma prova por seu ano","tags":["Questões"],"parameters":[{"in":"path","name":"year","description":"O ano em que a prova foi aplicada","schema":{"$ref":"#/components/schemas/year"},"required":true},{"in":"query","name":"limit","description":"O número máximo de questões a serem retornadas","schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":10,"description":"O número máximo de questões a serem retornadas","example":10}},{"in":"query","name":"offset","description":"O numero da primeira questão a ser retornada","schema":{"type":"integer","minimum":0,"default":0,"description":"O numero da primeira questão a ser retornada","example":0}},{"in":"query","name":"language","description":"O idioma desejado das questões","schema":{"type":"string","description":"O idioma desejado das questões","example":"ingles"}}],"responses":{"200":{"description":"Lista de questões","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O número máximo de questões retornadas","example":10},"offset":{"type":"integer","minimum":0,"description":"O número da primeira questão retornada","example":0},"total":{"type":"integer","minimum":0,"description":"O número total de questões da prova","example":180},"hasMore":{"type":"boolean","description":"Se há mais questões disponíveis ou não","example":true}},"required":["limit","offset","total","hasMore"]},"questions":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"O título da questão","example":"Questão 1 - ENEM 2020"},"index":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O número da questão na prova","example":1},"discipline":{"type":"string","nullable":true,"description":"A disciplina da questão","example":"linguagens"},"language":{"type":"string","nullable":true,"description":"O idioma da questão","example":"ingles"},"year":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O ano em que a prova foi aplicada","example":2020},"context":{"type":"string","nullable":true,"description":"O contexto da questão, em Makdown","example":"Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat."},"files":{"type":"array","items":{"type":"string"},"description":"Os arquivos da questão","example":["https://enem.dev/2020/questions/1-ingles/6e1ca12e-9bc4-472b-8809-84e7e394714a.png"]},"correctAlternative":{"type":"string","enum":["A","B","C","D","E"],"description":"A alternativa correta da questão","example":"A"},"alternativesIntroduction":{"type":"string","nullable":true,"description":"O texto introdutório das alternativas da questão","example":"Com base no texto, selecione a alternativa correta"},"alternatives":{"type":"array","items":{"type":"object","properties":{"letter":{"type":"string","enum":["A","B","C","D","E"],"description":"A letra da alternativa","example":"A"},"text":{"type":"string","nullable":true,"description":"O texto da alternativa","example":"Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat."},"file":{"type":"string","nullable":true,"description":"O arquivo da alternativa","example":"https://enem.dev/2020/questions/1-ingles/6e1ca12e-9bc4-472b-8809-84e7e394714a.png"},"isCorrect":{"type":"boolean","description":"Se a alternativa é a correta ou não","example":true}},"required":["letter","text","file","isCorrect"]},"description":"As alternativas da questão"}},"required":["title","index","discipline","language","year","context","files","correctAlternative","alternativesIntroduction","alternatives"],"title":"Detalhes da questão"},"description":"As questões da prova"}},"required":["metadata","questions"]}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).","content":{"application/json":{"schema":{"x-speakeasy-name-override":"BadRequest","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"],"description":"A short code indicating the error code returned.","example":"bad_request"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#bad-request"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"NotFound","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"],"description":"A short code indicating the error code returned.","example":"not_found"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot find the requested resource."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#not-found"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"UnprocessableEntity","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"A short code indicating the error code returned.","example":"unprocessable_entity"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The request was well-formed but was unable to be followed due to semantic errors."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#unprocessable-entity"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"The user has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"x-speakeasy-name-override":"RateLimitExceeded","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limit_exceeded"],"description":"A short code indicating the error code returned.","example":"rate_limit_exceeded"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The user has sent too many requests in a given amount of time"},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#rate-limit_exceeded"}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"The server has encountered a situation it does not know how to handle.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InternalServerError","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"A short code indicating the error code returned.","example":"internal_server_error"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server has encountered a situation it does not know how to handle."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#internal-server_error"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/exams/{year}/questions/{index}":{"get":{"operationId":"getQuestionDetails","summary":"Listar questão","description":"Listar detalhes de uma questão pelo seu número","tags":["Questões"],"parameters":[{"in":"path","name":"year","description":"O ano em que a prova foi aplicada","schema":{"$ref":"#/components/schemas/year"},"required":true},{"in":"path","name":"index","description":"O número da questão na prova","schema":{"$ref":"#/components/schemas/index"},"required":true},{"in":"query","name":"language","description":"O idioma desejado da questão","schema":{"type":"string","description":"O idioma desejado da questão","example":"ingles"}}],"responses":{"200":{"description":"Detalhes da questão","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"O título da questão","example":"Questão 1 - ENEM 2020"},"index":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O número da questão na prova","example":1},"discipline":{"type":"string","nullable":true,"description":"A disciplina da questão","example":"linguagens"},"language":{"type":"string","nullable":true,"description":"O idioma da questão","example":"ingles"},"year":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"O ano em que a prova foi aplicada","example":2020},"context":{"type":"string","nullable":true,"description":"O contexto da questão, em Makdown","example":"Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat."},"files":{"type":"array","items":{"type":"string"},"description":"Os arquivos da questão","example":["https://enem.dev/2020/questions/1-ingles/6e1ca12e-9bc4-472b-8809-84e7e394714a.png"]},"correctAlternative":{"type":"string","enum":["A","B","C","D","E"],"description":"A alternativa correta da questão","example":"A"},"alternativesIntroduction":{"type":"string","nullable":true,"description":"O texto introdutório das alternativas da questão","example":"Com base no texto, selecione a alternativa correta"},"alternatives":{"type":"array","items":{"type":"object","properties":{"letter":{"type":"string","enum":["A","B","C","D","E"],"description":"A letra da alternativa","example":"A"},"text":{"type":"string","nullable":true,"description":"O texto da alternativa","example":"Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat."},"file":{"type":"string","nullable":true,"description":"O arquivo da alternativa","example":"https://enem.dev/2020/questions/1-ingles/6e1ca12e-9bc4-472b-8809-84e7e394714a.png"},"isCorrect":{"type":"boolean","description":"Se a alternativa é a correta ou não","example":true}},"required":["letter","text","file","isCorrect"]},"description":"As alternativas da questão"}},"required":["title","index","discipline","language","year","context","files","correctAlternative","alternativesIntroduction","alternatives"],"title":"Detalhes da questão"}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).","content":{"application/json":{"schema":{"x-speakeasy-name-override":"BadRequest","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"],"description":"A short code indicating the error code returned.","example":"bad_request"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#bad-request"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"NotFound","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"],"description":"A short code indicating the error code returned.","example":"not_found"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server cannot find the requested resource."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#not-found"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"UnprocessableEntity","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"A short code indicating the error code returned.","example":"unprocessable_entity"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The request was well-formed but was unable to be followed due to semantic errors."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#unprocessable-entity"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"The user has sent too many requests in a given amount of time","content":{"application/json":{"schema":{"x-speakeasy-name-override":"RateLimitExceeded","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limit_exceeded"],"description":"A short code indicating the error code returned.","example":"rate_limit_exceeded"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The user has sent too many requests in a given amount of time"},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#rate-limit_exceeded"}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"The server has encountered a situation it does not know how to handle.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InternalServerError","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"A short code indicating the error code returned.","example":"internal_server_error"},"message":{"type":"string","description":"A human readable explanation of what went wrong.","example":"The server has encountered a situation it does not know how to handle."},"docUrl":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://enem.dev/docs/errors#internal-server_error"}},"required":["code","message"]}},"required":["error"]}}}}}}}},"components":{"schemas":{"year":{"type":"string","example":"2020","description":"O ano em que a prova foi aplicada"},"index":{"type":"string","example":"42","description":"O número da questão na prova"}}}}