Access our platform via API to integrate riddles into your apps, games, or AI systems.
Get StartedConnect to our riddle database with real-time solving mechanics and contest tracking.
Native libraries for Unity, Flutter, React, and more to add riddles to applications.
Track user performance, puzzle engagement, and contest metrics.
// GET /api/v1/puzzle-random
//
// Accept: application/json
//
// Auth:
// {
// "Authorization":
// "Bearer YOUR_API_KEY"
// }
//
// Response Example:
//
// {
// "riddle": "I have keys but no locks, space but no room",
// "solution": "keyboard",
// "difficulty": 3,
// "tags": ["logic", "everyday"]
// }
import { useState, useEffect } from 'react';
const RiddleComponent = ({ apiKey }) => {
const [riddle, setRiddle] = useState(null);
const [answer, setAnswer] = useState('');
useEffect(() => {
fetch('https://api.riddle.com/v1/puzzle-random', {
headers: { 'Authorization': `Bearer ${apiKey}` }
})
.then(res => res.json())
.then(data => setRiddle(data));
}, [apiKey]);
const checkAnswer = () => {
// Implementation to validate user's answer
};
return (
{riddle ? (
<>
Q: {riddle.question}
setAnswer(e.target.value)}
className="w-full px-3 py-2 border rounded mb-2"
/>
>
) : (
Loading riddle...
)}
);
};
Join thousands of developers integrating Riddle into their AI/ML projects, games, and educational platforms.