A powerful, modern API service for scraping movie and anime content from multiple providers
๐ Live Demo โข ๐ Documentation โข ๐ Report Bug โข โจ Request Feature
- Features
- Architecture
- Screenshots
- Supported Providers
- Tech Stack
- Getting Started
- API Documentation
- Authentication
- Environment Variables
- Deployment
- Contributing
- Performance & Optimization
- Roadmap
- License
- Support
- Star History
- ๐ Secure API Key Authentication - JWT-based authentication with request quota management
- ๐ Multiple Content Providers - Support for 15+ providers including KMMovies, AnimeSalt, NetMirror, and more
- ๐ฏ Comprehensive Endpoints - Search, details, streaming links, and download options
- ๐ High Performance - Built with Next.js 16 and modern optimizations with edge caching
- ๐ฑ Modern Dashboard - User-friendly interface for API key management and documentation
- ๐ Real-time Updates - Dynamic content scraping with intelligent caching strategies
- ๐ Interactive Documentation - Built-in API playground with TypeScript/JavaScript examples
- ๐จ Beautiful UI - Shadcn/ui components with Tailwind CSS and dark mode support
- ๐พ PostgreSQL Database - Powered by Neon serverless PostgreSQL with Drizzle ORM
- ๐ง Email Notifications - Automated login alerts and quota warnings with beautiful HTML emails
- ๐ Rate Limiting - Intelligent quota management at both user and API key levels
- ๐ Usage Analytics - Track your API usage with detailed statistics
- ๐ Cross-Platform - Works seamlessly on mobile, desktop, and tablets
- ๐ Smart Search - Advanced search with filters and auto-suggestions
- ๐ฌ Multiple Extractors - Support for various video streaming platforms
graph TB
subgraph Client["๐ค Client Applications"]
Web["๐ Web Browser"]
Mobile["๐ฑ Mobile App"]
API_Client["๐ง API Client"]
end
subgraph NextJS["โก Next.js App Router"]
Pages["๐ Pages/Routes"]
API["๐ API Routes"]
Auth["๐ Authentication"]
end
subgraph Services["๐ Services Layer"]
Scrapers["๐ท๏ธ Web Scrapers"]
Validators["โ
Validators"]
Cache["๐พ Cache Manager"]
Email["๐ง Email Service"]
end
subgraph Data["๐ฝ Data Layer"]
Neon[("๐ Neon PostgreSQL")]
Redis[("โก Upstash Redis")]
end
subgraph External["๐ External Sources"]
Providers["๐ฌ Content Providers"]
Extractors["๐ฅ Video Extractors"]
end
Client --> NextJS
NextJS --> Services
Services --> Data
Services --> External
Auth --> Neon
API --> Validators
Validators --> Cache
Cache --> Redis
Scrapers --> Providers
Scrapers --> Extractors
style Client fill:#e1f5ff
style NextJS fill:#fff3e0
style Services fill:#f3e5f5
style Data fill:#e8f5e9
style External fill:#fce4ec
sequenceDiagram
participant U as ๐ค User
participant C as ๐ Client
participant A as ๐ Auth API
participant DB as ๐พ Database
participant E as ๐ง Email Service
U->>C: Login Request
C->>A: POST /api/auth/login
A->>DB: Verify Credentials
DB-->>A: User Data
A->>DB: Create Session
A->>E: Send Login Alert
E-->>U: Email Notification
A-->>C: Session Token
C-->>U: Login Success
Note over U,E: API Key Generation
U->>C: Generate API Key
C->>A: POST /api/keys
A->>DB: Verify Session
A->>DB: Create API Key
DB-->>A: API Key Data
A-->>C: API Key
C-->>U: Display Key
sequenceDiagram
participant C as ๐ค Client
participant M as ๐ก๏ธ Middleware
participant A as ๐ API Handler
participant V as โ
Validator
participant S as ๐ท๏ธ Scraper
participant Ch as ๐พ Cache
participant P as ๐ Provider
C->>M: API Request + Key
M->>V: Validate API Key
V->>Ch: Check Request Quota
alt Quota Exceeded
V-->>C: 429 Quota Exceeded
else Valid Request
V->>Ch: Check Cache
alt Cache Hit
Ch-->>A: Cached Data
A-->>C: Response
else Cache Miss
A->>S: Scrape Request
S->>P: Fetch Content
P-->>S: HTML Response
S->>S: Parse Data
S->>Ch: Store Cache
S-->>A: Parsed Data
A-->>C: Response
end
V->>V: Update Quota
end
erDiagram
USER ||--o{ API_KEY : has
USER ||--o{ SESSION : has
USER {
string id PK
string email
string name
int totalRequestCount
int totalRequestQuota
timestamp createdAt
timestamp lastQuotaWarningAt
}
API_KEY {
string id PK
string key UK
string userId FK
string name
int requestCount
int requestQuota
boolean isActive
timestamp lastUsedAt
timestamp createdAt
}
SESSION {
string id PK
string userId FK
string token UK
timestamp expiresAt
timestamp createdAt
}
Home Screen |
Search & Discovery |
Video Player |
Content Details |
Content Providers |
Server Selection |
Settings |
Desktop Dashboard |
|
Video Player |
Content Information |
Episode Browser |
Player Controls |
-
KMMovies - Latest Bollywood, Hollywood, and dubbed movies
- Homepage listings with pagination
- Advanced search functionality
- Detailed movie information with IMDb ratings
- Multiple quality download links (480p, 720p, 1080p, 4K)
- Magic links resolver for direct downloads
-
NetMirror - Streaming content with multiple servers
- Homepage content with categories
- Search functionality
- Post details with metadata
- Stream links with playlist URLs
- AnimeSalt - Comprehensive anime database
- Latest anime releases
- Episode listings
- Streaming and download links
- Search with filters
- Framework: Next.js 16 - React framework with App Router
- Language: TypeScript 5 - Type-safe JavaScript
- Runtime: Node.js 18+
- Styling: Tailwind CSS 4 - Utility-first CSS framework
- UI Components: Shadcn/ui - Beautiful and accessible components
- Icons: Lucide React - Clean and consistent icons
- Animations: Framer Motion - Production-ready animations
- 3D Graphics: Three.js + React Three Fiber - 3D visualizations
- Authentication: Better Auth - Modern auth library
- Database: Neon PostgreSQL - Serverless PostgreSQL
- ORM: Drizzle ORM - TypeScript ORM
- Caching: Upstash Redis - Serverless Redis
- Web Scraping: Cheerio - Fast HTML parser
- HTTP Client: Axios - Promise-based HTTP client
- Validation: Zod - TypeScript-first schema validation
- API Validation: Custom middleware with quota management
- Email Service: Resend - Modern email API
- Email Templates: React Email components
- Deployment: Vercel - Edge network deployment
- CI/CD: GitHub Actions
- Monitoring: Vercel Analytics
- Error Tracking: Built-in logging
# 1. Clone and install
git clone https://github.com/Anshu78780/ScarperApi.git
cd ScarperApi
npm install
# 2. Setup environment
cp .env.example .env.local
# Edit .env.local with your credentials
# 3. Setup database
npm run db:push
# 4. Start development server
npm run dev๐ Visit http://localhost:3000
๐ Prerequisites
Before you begin, ensure you have the following installed:
1๏ธโฃ Clone Repository
git clone https://github.com/Anshu78780/ScarperApi.git
cd ScarperApi2๏ธโฃ Install Dependencies
Choose your preferred package manager:
# Using npm
npm install
# Using yarn
yarn install
# Using pnpm
pnpm install
# Using bun
bun install3๏ธโฃ Environment Setup
Create environment file:
cp .env.example .env.localGet your Neon database URL:
- Sign up at Neon
- Create a new project
- Copy the connection string
Edit .env.local:
# Database (Required)
DATABASE_URL="postgresql://user:password@host/database?sslmode=require"
# Better Auth (Required)
BETTER_AUTH_SECRET="generate-a-random-secret-key"
BETTER_AUTH_URL="http://localhost:3000"
# Optional: Email Service (for notifications)
RESEND_API_KEY="your-resend-api-key"
# Optional: OAuth Providers
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"Generate a secure secret:
# Option 1: Using OpenSSL
openssl rand -base64 32
# Option 2: Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"4๏ธโฃ Database Migrations
Run database migrations to create tables:
npm run db:pushThis will create all necessary tables in your Neon database.
5๏ธโฃ Start Development Server
npm run devThe application will be available at:
- Frontend: http://localhost:3000
- API: http://localhost:3000/api
6๏ธโฃ Create Your First Account
- Navigate to http://localhost:3000/signup
- Create an account
- Log in at http://localhost:3000/login
- Go to Dashboard โ APIs to generate your first API key
- Start making requests! ๐
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run database migrations
npm run db:push
# Generate database migrations
npm run db:generate
# Open Drizzle Studio (Database GUI)
npm run db:studio
# Lint code
npm run lintAccess the interactive API documentation at /dashboard/docs after logging in.
// Using fetch
const response = await fetch('https://screenscapeapi.dev/api/kmmovies/search?q=inception', {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);import requests
url = "https://screenscapeapi.dev/api/kmmovies/search"
params = {"q": "inception"}
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)curl -X GET "https://screenscapeapi.dev/api/kmmovies/search?q=inception" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"const axios = require('axios');
axios.get('https://screenscapeapi.dev/api/kmmovies/search', {
params: { q: 'inception' },
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));GET /api/kmmovies- Latest releasesGET /api/kmmovies/search?q={query}- Search moviesGET /api/kmmovies/details?url={url}- Movie detailsGET /api/kmmovies/magiclinks?url={url}- Download links
GET /api/animesalt- Latest animeGET /api/animesalt/search?q={query}- Search animeGET /api/animesalt/details?url={url}- Anime detailsGET /api/animesalt/stream?url={url}- Streaming links
GET /api/netmirror- Homepage contentGET /api/netmirror/search?q={query}- Search contentGET /api/netmirror/getpost?id={id}- Post detailsGET /api/netmirror/stream?id={id}- Stream URLs
All API endpoints require authentication via API keys.
- Sign up at
/signup - Log in at
/login - Navigate to
/dashboard/apis - Generate a new API key
- Copy and use in your requests
Header (Recommended)
curl -H "x-api-key: YOUR_API_KEY" https://screenscapeapi.dev/api/kmmoviesQuery Parameter
curl "https://screenscapeapi.dev/api/kmmovies?api_key=YOUR_API_KEY"Session (Dashboard) Automatic when logged into the dashboard
Create a .env.local file in the project root with the following variables:
# Database Configuration (Required)
# Get from: https://neon.tech/
DATABASE_URL="postgresql://user:password@ep-xxx.us-east-2.aws.neon.tech/dbname?sslmode=require"
# Better Auth Configuration (Required)
# Generate a random 32-byte base64 string
BETTER_AUTH_SECRET="your-secret-key-min-32-characters"
# Application URL (Required)
# Development: http://localhost:3000
# Production: https://your-domain.com
BETTER_AUTH_URL="http://localhost:3000"# Email Service (Optional - for notifications)
# Get from: https://resend.com/
RESEND_API_KEY="re_xxxxxxxxxxxxx"
RESEND_FROM_EMAIL="noreply@yourdomain.com"
# OAuth Providers (Optional)
# GitHub OAuth - Get from: https://github.com/settings/developers
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"
# Google OAuth (Optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# Rate Limiting (Optional - defaults shown)
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_WINDOW=900000 # 15 minutes in milliseconds
# Cookie Management (Optional)
COOKIES_URL="https://your-cookies-endpoint.com/cookies.json"
# Application Settings (Optional)
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_APP_NAME="ScreenScape API"
# Redis Cache (Optional - for enhanced caching)
UPSTASH_REDIS_REST_URL="https://xxx.upstash.io"
UPSTASH_REDIS_REST_TOKEN="your-token"๐ How to get DATABASE_URL (Neon PostgreSQL)
- Go to Neon
- Sign up for a free account
- Create a new project
- Navigate to your project dashboard
- Copy the connection string from the dashboard
- It should look like:
postgresql://user:password@ep-xxx.region.aws.neon.tech/dbname?sslmode=require
๐ How to generate BETTER_AUTH_SECRET
Use one of these methods to generate a secure random secret:
Option 1: OpenSSL (Linux/Mac)
openssl rand -base64 32Option 2: Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"Option 3: Online Generator Visit Generate Random and generate a 32+ character key
๐ง How to get RESEND_API_KEY
- Go to Resend
- Sign up for a free account (100 emails/day free)
- Navigate to API Keys section
- Create a new API key
- Copy the key (starts with
re_)
๐ How to get GitHub OAuth credentials
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in the details:
- Application name: Your app name
- Homepage URL:
http://localhost:3000(dev) or your domain - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Click "Register application"
- Copy the Client ID
- Generate a Client Secret and copy it
# Minimal setup for development
DATABASE_URL="postgresql://user:pass@host.neon.tech/db?sslmode=require"
BETTER_AUTH_SECRET="super-secret-key-at-least-32-characters-long"
BETTER_AUTH_URL="http://localhost:3000"
# Optional: Enable email notifications
RESEND_API_KEY="re_xxxxxxxxxxxxxxxxxx"
# Optional: Enable GitHub OAuth
GITHUB_CLIENT_ID="github_client_id_here"
GITHUB_CLIENT_SECRET="github_client_secret_here"-
Fork this repository
# Click the Fork button on GitHub -
Import to Vercel
- Go to Vercel Dashboard
- Click "Add New" -> "Project"
- Import your forked repository
-
Configure Environment Variables Add the following in Vercel project settings:
DATABASE_URL=your_neon_database_url BETTER_AUTH_SECRET=your_secret_key BETTER_AUTH_URL=https://your-domain.vercel.app
-
Deploy
- Click "Deploy"
- Wait for build to complete
- Your API is live! ๐
-
Run Database Migrations
# After deployment, run migrations npm run db:push
-
Create New Web Service
- Go to Render Dashboard
- Click "New" -> "Web Service"
- Connect your GitHub repository
-
Configure Build Settings
Name: screenscape-api Environment: Node Build Command: npm install && npm run build Start Command: npm start
-
Add Environment Variables
DATABASE_URL=your_neon_database_url BETTER_AUTH_SECRET=your_secret_key BETTER_AUTH_URL=https://your-app.onrender.com NODE_VERSION=18
-
Deploy
- Click "Create Web Service"
- Render will automatically build and deploy
- Access your API at
https://your-app.onrender.com
# Install Railway CLI
npm install -g @railway/cli
# Login
railway login
# Initialize project
railway init
# Add environment variables
railway variables set DATABASE_URL="your_database_url"
railway variables set BETTER_AUTH_SECRET="your_secret"
# Deploy
railway up# Create Dockerfile in project root
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]# Build and run
docker build -t screenscape-api .
docker run -p 3000:3000 --env-file .env screenscape-api# Clone repository
git clone https://github.com/Anshu78780/ScarperApi.git
cd ScarperApi
# Install dependencies
npm install
# Build application
npm run build
# Start production server
npm start- Provider Cache: 30-minute TTL for content listings
- Search Results: 15-minute TTL
- Video Links: 5-minute TTL
- Static Assets: CDN caching with Vercel Edge Network
- API Response Time: < 200ms (cached)
- First Contentful Paint: < 1.5s
- Time to Interactive: < 3s
- Lighthouse Score: 95+
- Edge caching for API responses
- Database connection pooling
- Lazy loading for images
- Code splitting for faster page loads
- Gzip compression
- Serverless functions for scalability
- Basic scraping functionality
- User authentication system
- API key management
- Quota system
- Email notifications
- Interactive documentation
- Mobile responsive design
- Dark mode support
- GraphQL API support
- WebSocket for real-time updates
- Advanced analytics dashboard
- API versioning
- OAuth provider integration
- Webhook support
- Custom scraper plugins
- AI-powered content recommendations
- Multi-language support
- API playground improvements
- Rate limiting with Redis
- Monitoring and alerting
- API documentation generator
- SDK for popular languages (Python, Go, Ruby)
Have an idea? Open an issue or start a discussion!
Contributions are welcome! Please feel free to submit a Pull Request.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐ฌ GitHub Discussions: Ask questions and share ideas
- ๐ Issue Tracker: Report bugs
- ๐ง Email: anshu78780@gmail.com
- ๐ Documentation: Read the docs
How do I get an API key?
Sign up at the website, log in, and navigate to the dashboard to generate your API key.
What are the rate limits?
Free tier: 10,000 requests/month. Premium plans available with higher quotas.
Can I use this in production?
Yes! The API is production-ready. For commercial use, please review the license terms.
How do I report a bug?
Open an issue on GitHub with detailed information about the bug and steps to reproduce.
Found a security vulnerability? Please email anshu78780@gmail.com instead of opening a public issue.
๐ Built with passion by Anshu
If you found this project helpful, please consider giving it a โญ star!
Made with โค๏ธ and โ











