No Authentication Required by Default
The CSFD REST API does not require authentication by default. This is a scraping-based API that fetches publicly available data from CSFD.cz, making it easy to get started without managing API keys or tokens.The API scrapes public CSFD data. No login or authentication is needed to fetch movie information, search results, or creator details.
Optional API Key Protection
When deploying your own REST API server, you can optionally enable API key protection to control access. This is particularly useful when:- Running a public-facing server
- Sharing the API with specific clients
- Preventing unauthorized usage
- Implementing basic access control
Enabling API Key Protection
Set theAPI_KEY environment variable when starting the server:
Using Custom Header Name
By default, the API expects the key in thex-api-key header. You can customize this:
Making Authenticated Requests
Once API key protection is enabled, include the key in request headers:Error Responses
Missing API Key
When API key protection is enabled but no key is provided:401 Unauthorized
Invalid API Key
When the provided API key doesn’t match any configured keys:401 Unauthorized
Docker Configuration
When running the API in Docker, pass environment variables:Environment Variables
| Variable | Description | Default | Example |
|---|---|---|---|
API_KEY | API key(s) for authentication. Multiple keys can be separated by comma, semicolon, or space | (none) | secret123 or key1,key2 |
API_KEY_NAME | HTTP header name for the API key | x-api-key | Authorization |
PORT | Server port | 3000 | 8080 |
LANGUAGE | Default language for responses | (none) | cs, en, sk |
Best Practices for Deployment
1. Always Use API Keys in Production
2. Use Strong, Random Keys
Generate cryptographically secure API keys:3. Rotate Keys Regularly
Update your API keys periodically and distribute new keys to authorized clients.4. Use HTTPS in Production
API keys transmitted over HTTP can be intercepted. Always use a reverse proxy with SSL/TLS:5. Consider Additional Security Layers
For production deployments, consider:- Reverse proxy (nginx, Traefik) with IP filtering
- API gateway (Kong, AWS API Gateway) with advanced auth
- Rate limiting (see Rate Limiting)
- WAF (Web Application Firewall) for additional protection
- VPN or firewall rules for internal-only APIs
CSFD Terms of Service
Responsible Usage Guidelines
- Cache responses - Don’t fetch the same data repeatedly
- Rate limit requests - Add delays between requests (2+ seconds recommended)
- Monitor your usage - Keep track of request volumes
- Respect robots.txt - Be a good internet citizen
- Don’t monetize scraped data - CSFD owns the data rights
When Scraping is Appropriate
- Personal projects and learning
- Browser extensions for personal use
- Academic research
- Non-commercial applications
- Integrations that add value for users
When to Avoid Scraping
- Commercial products selling CSFD data
- High-volume data mining operations
- Applications that compete with CSFD
- Anything that could harm CSFD’s service
This library makes scraping easier, but you are responsible for how you use it. Always respect the source and use responsibly.
Library vs Server Authentication
It’s important to understand the difference:| Aspect | node-csfd-api Library | REST API Server |
|---|---|---|
| Authentication to CSFD | None required (scrapes public data) | None required (scrapes public data) |
| Your API Authentication | N/A - it’s a library | Optional via API_KEY env var |
| Use Case | Integrating into your own app | Exposing as a service to others |
| Security Responsibility | Your application handles it | Configure via environment variables |
Next Steps
Endpoints
Explore all available REST API endpoints
Rate Limiting
Learn about rate limiting and responsible usage