DLE News REST API — Full CRUD, File Uploads & Poster Manager for DataLife Engine
by Vitalii-litv
About this product
DLE News REST API is a powerful, standalone PHP script that adds a complete REST API layer to your DataLife Engine website. No core modifications needed — just drop a single api.php file into your DLE root and get instant programmatic access to your content.
FULL NEWS MANAGEMENT (CRUD)
Create, read, update, and delete news articles via simple JSON requests. Publish immediately or save as draft (approve: 0) for admin review later. Full support for DLE custom fields (xfields), tags, categories, and SEO meta fields (keywords, description, metatitle). Automatic transliteration for SEO-friendly URLs. Works with any DLE category structure.
SMART POSTER HANDLING
Automatically download posters from trusted image sources including Kinopoisk, TMDB, and OpenMovieDB. Images are resized and converted to WebP, JPG, or PNG with configurable quality and dimensions. Whitelist-based domain security ensures only safe sources are allowed. Posters are saved locally and linked to the article's xfields and images field automatically.
FILE UPLOAD SYSTEM
Upload ZIP, RAR, PDF, DOCX, XLSX, TXT, CSV and other files via standard multipart/form-data requests. Attach uploaded files to any news article with custom descriptions. Built-in multi-layer security includes dangerous file detection, extension filtering, PHP code scanning inside uploaded files, and safe permission settings. Files are organized automatically into date-based subfolders.
DLE DEEP INTEGRATION
Full rebuild emulation covering post_extras, post_extras_cats, full_search index, and meta fields — your news articles appear on the main page and in search results immediately after creation. Tags and xfsearch indexes are updated for proper DLE filtering and search. DLE cache is cleared automatically after every write operation. Duplicate detection by Kinopoisk ID searches both xfsearch table and xfields content.
SECURITY AND PERFORMANCE
Two authentication methods: API key (recommended) and DLE user credentials with password_verify. Configurable rate limiting with default of 500 requests per hour per IP address. All database queries use PDO prepared statements for complete SQL injection protection. Comprehensive request logging for monitoring and debugging.
DEVELOPER FRIENDLY
Single-file deployment with zero dependencies — no frameworks, no composer, no external libraries. Compatible with PHP 5.6 through 8.3 and MariaDB/MySQL. Auto-detects your DLE version from 13.x through 18.1+, discovers table structure and field names automatically. Clean JSON responses include timestamps and API version headers. Descriptive error messages with proper HTTP status codes.
AVAILABLE API ENDPOINTS
add_news — Create a new article (requires authentication) update_news — Update an existing article (requires authentication) delete_news — Delete article with full cleanup of related tables (requires authentication) get_news — List articles with pagination, filtering, and sorting (public) get_news_by_id — Get a single article with all fields and parsed xfields (public) search_news — Full-text search across title, content, and keywords (public) upload_file — Upload file attachment with optional news linking (requires authentication) get_categories — List all DLE categories (public) add_category — Create a new category (requires authentication) get_stats — Site statistics including totals, views, and popular articles (requires authentication) get_news_status — Detailed article status with extras and index info (requires authentication) check_duplicate — Check if article exists by Kinopoisk ID (requires authentication) test — API health check and connection diagnostics (public)
PERFECT FOR
Movie and TV show databases powered by DataLife Engine. Automated content import from external APIs such as Kinopoisk, TMDB, and IMDB. Headless DLE setups with mobile apps or single-page application frontends. Bulk content management, migration, and synchronization tools. External dashboards and monitoring systems.
QUICK START
Upload api.php to your DLE root directory. Edit database credentials and API secret key inside the file. Run curl https://yoursite.com/api.php to verify the connection. Full API documentation with curl command examples for every endpoint is included.
REQUIREMENTS
PHP 5.6 or higher (recommended 7.4 through 8.3). MySQL 5.7 or higher, or MariaDB 10.3 or higher. DataLife Engine 13.x through 18.1 or newer. GD library for poster image processing. cURL PHP extension for poster downloading from remote sources.
WHAT YOU GET
api.php — the complete API script, single file, approximately 1900 lines of well-commented code. Full HTML documentation with curl examples for every endpoint and complete workflow scenarios. Ready to use immediately after configuration.
CHANGELOG
Version 4.0 — Full DLE 18.1 compatibility, rebuild emulation for post_extras and post_extras_cats, xfsearch index support, file upload system with security scanning, poster auto-download with image processing and format conversion, duplicate detection by Kinopoisk ID.
Changelog
New Feature
- Initial release
Standard License
There is no additional charge for updates. You can continue to download the latest version for free.
-
Single end product Use in one project only
-
Personal or commercial use Suitable for business projects
-
No redistribution Cannot be resold or shared
Refer & Earn 10% New
Share with friends and earn commission on their purchases.
Vitalii-litv