/v1/questions
Trivia questions
Pruébalo en vivo
10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.
Funciona. Consigue una clave API y úsala en tu proyecto.
Obtener una clave APIFragmentos de código
curl "https://api.oanor.com/opentdb-api/v1/questions" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/opentdb-api/v1/questions", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/opentdb-api/v1/questions");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/opentdb-api/v1/questions",
headers={"x-oanor-key": "oanor_test_..."}
)
Respuesta de ejemplo
Una respuesta real de este endpoint, capturada en la última comprobación de estado.
{
"data": {
"count": 10,
"questions": [
{
"type": "multiple",
"category": "General Knowledge",
"question": "In \"Katamari Damacy\", you control a character known as:",
"difficulty": "easy",
"correct_answer": "The Prince",
"incorrect_answers": [
"Fujio",
"Ichigo ",
"Foomin"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "In DC comics where does the Green Arrow (Oliver Queen) live?",
"difficulty": "easy",
"correct_answer": "Star City",
"incorrect_answers": [
"Central City",
"Gotham City",
"Metropolis"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "When one is \"envious\", they are said to be what color?",
"difficulty": "easy",
"correct_answer": "Green",
"incorrect_answers": [
"Red",
"Blue",
"Yellow"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "Who was the 1st President of Mexico?",
"difficulty": "easy",
"correct_answer": "Guadalupe Victoria",
"incorrect_answers": [
"Benito Juárez",
"Miguel Hidalgo Y Costilla",
"Vicente Guerrero"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "According to the Book of Genesis in the Old Testament, how many days did it take God to create the world?",
"difficulty": "easy",
"correct_answer": "Six",
"incorrect_answers": [
"Seven",
"One",
"Twelve"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "How many letters are there in the English alphabet?",
"difficulty": "easy",
"correct_answer": "26",
"incorrect_answers": [
"28",
"23",
"24"
]
},
{
"type": "multiple",
"category": "General Knowledge",
"question": "What is the official language of Brazil?",
"difficulty": "easy",
"correct_answer": "Portuguese",
"incorrect_answer
…