API Documentation

API for managing parsing tasks. All requests require a valid API key.

⚠️ Important: Use HTTP

Use HTTP instead of HTTPS: http://extension-parser.rest

HTTPS requests may not work due to SSL certificate issues.

🔑 API Key

To get your API key:

  1. Log in to the system using the login page
  2. Navigate to the API section from the main menu
  3. Your personal API key will be displayed there

Note: API key is required for all API requests. Please log in to get your personal key.

📝 1. Create Task

Create a new parsing task

POST
/api/task/create

Parameters:

domain (required if no list) - Domain to parse
domain[] or domains or urls (optional) - Multiple domains/URLs (comma/newline separated, array or JSON array)
device (optional) - Device: "Desktop" or "Mobile" (default: "Desktop")
cache (optional) - Cache control flag: false (default) uses 47h cache, true forces fresh parsing (ignores cache)
callbackURL (optional) - When task is Ready/Completed, system will call GET: callbackURL?completed={TASK_ID}
api_key (required) - API key
Cache behavior (47 hours):
If request has the same domain + device and a parsed result exists for the last 47 hours, API creates a new task by copying previous result files (without re-parsing).
Use cache=true to bypass this rule and parse again.

Request example (PHP, single task):

<?php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'domain' => 'example.com', 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response (single task):

{ "Success": "001", "Description": "Task created successfully", "TaskID": "abc123def456", "Domain": "example.com", "Device": "Desktop", "Status": "new" }

Note: On cache hit response also includes "Cache Hit": true and "Source TaskID".

Request example (PHP, multiple tasks via domain[]):

<?php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'domain' => ['example.com', 'example.org'], 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
<?php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'domains' => 'example.com,example.org', 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
<?php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'urls' => '["example.com","example.org"]', 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response (multiple tasks):

{ "Success": "001", "Description": "Tasks created successfully", "Count": 2, "Tasks": [ { "TaskID": "id1", "Domain": "example.com", "Status": "new" }, { "TaskID": "id2", "Domain": "example.org", "Status": "new" } ], "Device": "Desktop" }

🖥️ /new-task form cache control

Cache-Control: Cache - false (default) - use the same 47h cache logic as API.
Cache-Control: Cache - true - ignore cache and force fresh parsing.

📊 2. Get Task Status

Check task execution status

GET
/api/task/status?task_id=xxx&api_key=xxx

Parameters:

task_id (required) - Task ID
api_key (required) - API key
Note for extension tasks: response payload may include extra fields in Result:
headers - response headers captured by extension
data_nojs - HTML without JS rendering
data - rendered HTML (main content)

Request example (PHP):

<?php $url = 'http://extension-parser.rest/api/task/status?task_id=abc123def456&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response:

{ "Success": "001", "Description": "Task found", "TaskID": "abc123def456", "Domain": "example.com", "Device": "Desktop", "Status": "Ready", "Created": "01.01.2025 12:00:00" }

📄 3. Get Task Result

Get parsing result in JSON format

GET
/api/task/result?task_id=xxx&api_key=xxx

Parameters:

task_id (required) - Task ID
api_key (required) - API key

Request example (PHP):

<?php $url = 'http://extension-parser.rest/api/task/result?task_id=abc123def456&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response:

{ "Success": "001", "Description": "Result retrieved successfully", "TaskID": "abc123def456", "Domain": "example.com", "Result": { "taskid": "abc123def456", "url": "https://example.com/page", "headers": "content-type: text/html; charset=utf-8\n...", "data_nojs": "...", "data": "..." } }

📄 4. Get Task Result (Original HTML)

Get full original HTML content without cleaning

GET
/api/task/result-original?task_id=xxx&api_key=xxx&format=json|html

Parameters:

task_id (required) - Task ID
api_key (required) - API key
format (optional) - Response format: "json" (default) or "html"

Request example (PHP, JSON format):

<?php $url = 'http://extension-parser.rest/api/task/result-original?task_id=abc123def456&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response (JSON format):

{ "Success": "001", "Description": "Original HTML retrieved successfully", "TaskID": "abc123def456", "Domain": "example.com", "HTML": "\n...full original HTML without cleaning..." }

Request example (PHP, HTML format):

<?php $url = 'http://extension-parser.rest/api/task/result-original?task_id=abc123def456&api_key=YOUR_API_KEY_HERE&format=html'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Success response (HTML format):

Example Page ... ...full original HTML content...

Content-Type: text/html; charset=UTF-8

⚠️ Important: Original HTML is only saved for valid content (not for CAPTCHA/block pages). If the task resulted in "Error parser data", the original HTML file will not be available.

⚠️ Error Codes

Possible errors:

  • 002 - Invalid API key
  • 004 - Task not found
  • 006 - Only POST requests are allowed
  • 007 - Missing required fields
  • 008 - Failed to create task
  • 009 - Server error
  • 010 - Task is not ready
  • 011 - Result file not found / Original HTML file not found
  • 012 - Invalid JSON file / Failed to read original HTML file

Наш API возвращает только коды 001–012. Коды вроде 10028, 524 и т.п. приходят не от API: 10028 — ошибка Cloudflare (Lists/дубликаты или сетевая проблема), 524 — таймаут прокси. Проверьте настройки Cloudflare, сетевое соединение или обращайтесь к серверу напрямую.

🔄 Task Statuses

new - Task created, waiting for processing
send - Task sent to worker
In progress - Task in progress
Completed - Task completed successfully, result ready
Ready - Task completed (legacy), result ready
Error 001 - Response too short: if the number of characters in the parsing result is less than 475, the task status is set to "Error 001". You can still get the result via Get Task Result / Get Task Result (Original HTML), but the content is considered invalid/short.

📋 Real Examples

Creating task for Google:

<?php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'domain' => 'https://www.google.com/', 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Checking status:

<?php $url = 'http://extension-parser.rest/api/task/status?task_id=YOUR_TASK_ID&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Getting result (cleaned HTML):

<?php $url = 'http://extension-parser.rest/api/task/result?task_id=YOUR_TASK_ID&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Getting original HTML (without cleaning):

<?php $url = 'http://extension-parser.rest/api/task/result-original?task_id=YOUR_TASK_ID&api_key=YOUR_API_KEY_HERE'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

💡 Copy-Paste Tips

Problem: When copying curl commands from browser, line breaks may be lost.

Solutions:

🔧 Alternative testing method (PHP CLI)

<?php // php test_create.php $ch = curl_init('http://extension-parser.rest/api/task/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'domain' => 'example.com', 'device' => 'Desktop', 'cache' => 'false', 'api_key' => 'YOUR_API_KEY_HERE', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response, "\n"; ?>