curl --request GET \
--url https://api.example.com/api/episodes/getEpisode{
"data": {
"id": "<string>",
"anime_mal_id": 123,
"episode_id": 123,
"video_url": "<string>",
"image_url": "<string>",
"title": "<string>",
"description": "<string>",
"date": "<string>"
},
"Retry-After": {}
}Retrieve detailed information about a specific anime episode
curl --request GET \
--url https://api.example.com/api/episodes/getEpisode{
"data": {
"id": "<string>",
"anime_mal_id": 123,
"episode_id": 123,
"video_url": "<string>",
"image_url": "<string>",
"title": "<string>",
"description": "<string>",
"date": "<string>"
},
"Retry-After": {}
}429 Too Many Requests when limit is exceededRetry-After header in rate limit responses529911curl -X GET "https://anidev.vercel.app/api/episodes/getEpisode?mal_id=52991&ep=1"
{
"data": {
"id": "ep-52991-1",
"anime_mal_id": 52991,
"episode_id": 1,
"video_url": "https://example.com/video/one-piece-ep1.m3u8",
"image_url": "https://example.com/thumbnails/one-piece-ep1.jpg",
"title": "I'm Luffy! The Man Who Will Become Pirate King!",
"description": "Monkey D. Luffy sets sail to find the legendary One Piece treasure and become the Pirate King.",
"date": "1999-10-20T00:00:00.000Z"
}
}
400 Bad Request
{
"error": "Missing mal_id parameter",
"type": "validation"
}
400 Bad Request
{
"error": "Missing episode number",
"type": "validation"
}
404 Not Found
{
"error": "Episode not found",
"type": "notFound"
}
429 Too Many Requests
{
"error": "Too many requests, please try again later",
"type": "tooManyRequests"
}
500 Internal Server Error
{
"error": "Internal server error"
}
video_url field may return streaming URLs that require proxy handling. Use the /api/videoProxy endpoint if you encounter CORS issues when streaming videos.import { MediaPlayer, MediaProvider } from '@vidstack/react';
const VideoPlayer = ({ malId, episodeNumber }) => {
const [episode, setEpisode] = React.useState(null);
React.useEffect(() => {
fetch(`/api/episodes/getEpisode?mal_id=${malId}&ep=${episodeNumber}`)
.then(res => res.json())
.then(({ data }) => setEpisode(data));
}, [malId, episodeNumber]);
if (!episode) return <div>Loading...</div>;
return (
<MediaPlayer src={episode.video_url} poster={episode.image_url}>
<MediaProvider />
</MediaPlayer>
);
};
const trackEpisodeProgress = async (malId, episodeNumber) => {
const episode = await fetchEpisode(malId, episodeNumber);
// Save to user's watch history
await fetch('/api/user/watchHistory', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
anime_mal_id: episode.anime_mal_id,
episode_id: episode.episode_id,
timestamp: Date.now()
})
});
};