Lightweight REST API wrapper for Mobinime anime streaming platform
Built with Hono (JS, ESM) • Easy integration with WhatsApp bots, frontends & automation tools
- Features
- Quick Start
- API Endpoints
- Configuration
- Caching & Performance
- Security
- Examples
- Testing
- Roadmap
- License
|
|
Node.js >= 18.x
npm or yarn or pnpm# Clone the repository
git clone https://github.com/yourusername/mobinime-api.git
# Navigate to directory
cd mobinime-api
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Start development server
npm run devcurl http://localhost:3000/Response:
{
"status": true,
"message": "Mobinime API running"
}https://your-api-domain.com
GET /homepage
Get homepage data with latest anime updates.
Response:
{
"status": true,
"data": {
"ongoing": [...],
"completed": [...],
"popular": [...]
}
}GET /genres
Retrieve all available anime genres.
Response:
{
"status": true,
"data": [
{ "id": "1", "title": "Action" },
{ "id": "2", "title": "Comedy" },
{ "id": "3", "title": "Drama" }
]
}📚 GET /anime/:type
Get anime list filtered by type and genre.
Valid Types: series | movie | ova | live-action
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page |
number | 0 | Page number |
count |
number | 15 | Items per page |
genre |
string | - | Genre slug (e.g., "action") |
Example:
GET /anime/series?genre=action&page=0&count=15Response:
{
"status": true,
"data": {
"perpage": 15,
"startpage": 0,
"total": 1200,
"items": [
{
"id": "1001",
"title": "Anime Title",
"thumb": "https://...",
"rating": "8.5"
}
]
}
}GET /search
Search anime by query string.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | ✅ Yes | Search query |
page |
number | No | Page number |
count |
number | No | Items per page |
Example:
GET /search?q=naruto&page=0&count=10Response:
{
"status": true,
"data": {
"results": [
{
"id": "123",
"title": "Naruto Shippuden",
"thumb": "https://..."
}
]
}
}GET /detail/:id
Get detailed information about a specific anime.
Example:
GET /detail/123Response:
{
"status": true,
"data": {
"id": "123",
"title": "Anime Title",
"description": "...",
"genres": ["Action", "Adventure"],
"episodes": [
{ "id": "456", "title": "Episode 1" }
],
"staff": {...},
"rating": "8.5"
}
}GET /stream
Get streaming URL for a specific episode.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | ✅ Yes | Anime ID |
epsid |
string | ✅ Yes | Episode ID |
quality |
string | No | Quality (HD/SD) |
Example:
GET /stream?id=123&epsid=456&quality=HDResponse:
{
"status": true,
"url": "https://streaming-url.com/video.m3u8"
}Error Response (404):
{
"status": false,
"error": {
"code": 404,
"message": "Stream URL not found"
}
}Create a .env file in the root directory:
# API Configuration
MOBINIME_BASE_URL=https://air.vunime.my.id/mobinime
MOBINIME_API_KEY=your-api-key-here
MOBINIME_USER_AGENT=Mozilla/5.0...
# Caching
CACHE_PROVIDER=redis # redis | memory
REDIS_URL=redis://localhost:6379
# Rate Limiting
RATE_LIMIT=60 # requests per minute
# Server
PORT=3000
NODE_ENV=production
# Logging
LOG_LEVEL=info # info | debug | warn | error- type: Must be one of
series,movie,ova,live-action - page: Integer >= 0
- count: Integer >= 0
- genre: Valid genre slug from genre list
- id: Numeric string
const CACHE_TTL = {
genres: 86400, // 24 hours
homepage: 1800, // 30 minutes
animeList: 900, // 15 minutes
detail: 3600, // 1 hour
stream: 300 // 5 minutes
};mobinime:genres
mobinime:animeList:${type}:${genre}:${page}:${count}
mobinime:detail:${id}
mobinime:stream:${id}:${epsid}:${quality}
- Public Endpoints: 60 requests/minute per IP
- Search Endpoint: 30 requests/minute per IP
- Stream Endpoint: 100 requests/minute per IP
| Security Measure | Implementation |
|---|---|
| API Keys | Never commit to repository |
| Timeouts | 8-12s for external requests |
| Input Sanitization | All user inputs validated |
| Rate Limiting | IP & API key based throttling |
| CORS | Restricted to trusted origins |
| HTTPS | Required in production |
// ✅ DO: Use environment variables
const baseURL = process.env.MOBINIME_BASE_URL;
// ❌ DON'T: Hardcode secrets
const apiKey = "abc123..."; // Never do this!
// ✅ DO: Set timeouts
axios.get(url, { timeout: 10000 });
// ✅ DO: Validate inputs
if (!['series', 'movie', 'ova', 'live-action'].includes(type)) {
throw new Error('Invalid type');
}// Search for anime
const searchAnime = async (query) => {
const response = await fetch(
`https://api.example.com/search?q=${encodeURIComponent(query)}&page=0&count=10`
);
const data = await response.json();
return data;
};
// Get streaming URL
const getStreamURL = async (animeId, episodeId) => {
const response = await fetch(
`https://api.example.com/stream?id=${animeId}&epsid=${episodeId}&quality=HD`
);
const data = await response.json();
return data.url;
};import axios from 'axios';
const api = axios.create({
baseURL: 'https://api.example.com',
timeout: 10000
});
// Get anime list
const getAnimeList = async (type, genre, page = 0) => {
const { data } = await api.get(`/anime/${type}`, {
params: { genre, page, count: 15 }
});
return data;
};
// Get anime details
const getAnimeDetail = async (id) => {
const { data } = await api.get(`/detail/${id}`);
return data;
};# Get genres
curl -X GET "https://api.example.com/genres"
# Search anime
curl -X GET "https://api.example.com/search?q=naruto&page=0&count=10"
# Get stream URL
curl -X GET "https://api.example.com/stream?id=123&epsid=456&quality=HD"# Unit tests
npm run test
# Integration tests
npm run test:integration
# Coverage report
npm run test:coveragetests/
├── unit/
│ ├── validators.test.js
│ ├── mappers.test.js
│ └── utils.test.js
├── integration/
│ ├── endpoints.test.js
│ └── cache.test.js
└── e2e/
└── flow.test.js
- Core API endpoints
- Error handling
- Redis caching integration
- API key authentication
- Rate limiting middleware
- OpenAPI/Swagger documentation
- Circuit breaker pattern
- GraphQL wrapper
- Monitoring & alerting
- Multi-provider fallback
| Code | Description |
|---|---|
| 200 | ✅ Success |
| 400 | ❌ Bad Request - Invalid parameters |
| 404 | ❌ Not Found - Resource doesn't exist |
| 429 | ❌ Too Many Requests - Rate limit exceeded |
| 500 | ❌ Internal Server Error |
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- ✅ Follow ESLint rules
- ✅ Write tests for new features
- ✅ Update documentation
- ✅ Keep PRs small and focused
This project is licensed under the MIT License - see the LICENSE file for details.
This API wraps endpoints from air.vunime.my.id/mobinime which is not owned by this project. Please ensure your usage complies with the upstream Terms of Service and does not constitute abuse.
- Built with Hono - Ultrafast web framework
- HTTP client powered by Axios
- Data source: air.vunime.my.id/mobinime
Made with ❤️ by Ryuhan, for developers