Files
crawlshot/crawlshot-api.postman_collection.json
2025-08-10 21:10:33 +08:00

598 lines
20 KiB
JSON

{
"info": {
"name": "Crawlshot API",
"description": "Complete API collection for Crawlshot - A self-hosted web crawling and screenshot service built with Laravel and Spatie Browsershot",
"version": "1.0.0",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_token}}",
"type": "string"
}
]
},
"variable": [
{
"key": "base_url",
"value": "https://crawlshot.test",
"type": "string"
},
{
"key": "api_token",
"value": "1|rrWUM5ZkmLfGipkm1oIusYX45KbukIekUwMjgB3Nd1121a5c",
"type": "string"
}
],
"item": [
{
"name": "Health Check",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/api/health",
"host": [
"{{base_url}}"
],
"path": [
"api",
"health"
]
},
"description": "Health check endpoint to verify the service is running. No authentication required."
},
"response": [
{
"name": "Success",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/health",
"host": [
"{{base_url}}"
],
"path": [
"api",
"health"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"status\": \"healthy\",\n \"timestamp\": \"2025-08-10T09:54:52.195383Z\",\n \"service\": \"crawlshot\"\n}"
}
]
},
{
"name": "Web Crawling",
"item": [
{
"name": "Initiate Crawl Job",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"url\": \"https://example.com\",\n \"timeout\": 30,\n \"delay\": 2000,\n \"block_ads\": true,\n \"block_cookie_banners\": true,\n \"block_trackers\": true,\n \"wait_until_network_idle\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/api/crawl",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl"
]
},
"description": "Initiate a web crawling job to extract HTML content from a URL.\n\n**Parameters:**\n- `url` (required): Target URL to crawl\n- `timeout` (optional): Request timeout in seconds (5-300)\n- `delay` (optional): Wait time before capture in milliseconds (0-30000)\n- `block_ads` (optional): Block ads using EasyList filters (default: true)\n- `block_cookie_banners` (optional): Block cookie banners (default: true)\n- `block_trackers` (optional): Block tracking scripts (default: true)\n- `wait_until_network_idle` (optional): Wait for network activity to cease (default: false)"
},
"response": [
{
"name": "Success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"url\": \"https://example.com\",\n \"timeout\": 30,\n \"block_ads\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/api/crawl",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"b5dc483b-f62d-4e40-8b9e-4715324a8cbb\",\n \"status\": \"queued\",\n \"message\": \"Crawl job initiated successfully\"\n}"
}
]
},
{
"name": "Get Crawl Status & Results",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/api/crawl/:uuid",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl",
":uuid"
],
"variable": [
{
"key": "uuid",
"value": "b5dc483b-f62d-4e40-8b9e-4715324a8cbb",
"description": "Job UUID returned from crawl initiation"
}
]
},
"description": "Check the status and retrieve results of a crawl job. When completed, returns the full HTML content."
},
"response": [
{
"name": "Queued",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/crawl/b5dc483b-f62d-4e40-8b9e-4715324a8cbb",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl",
"b5dc483b-f62d-4e40-8b9e-4715324a8cbb"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"b5dc483b-f62d-4e40-8b9e-4715324a8cbb\",\n \"status\": \"queued\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:00:42.000000Z\"\n}"
},
{
"name": "Processing",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/crawl/b5dc483b-f62d-4e40-8b9e-4715324a8cbb",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl",
"b5dc483b-f62d-4e40-8b9e-4715324a8cbb"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"b5dc483b-f62d-4e40-8b9e-4715324a8cbb\",\n \"status\": \"processing\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:00:42.000000Z\",\n \"started_at\": \"2025-08-10T10:00:45.000000Z\"\n}"
},
{
"name": "Completed",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/crawl/b5dc483b-f62d-4e40-8b9e-4715324a8cbb",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl",
"b5dc483b-f62d-4e40-8b9e-4715324a8cbb"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"b5dc483b-f62d-4e40-8b9e-4715324a8cbb\",\n \"status\": \"completed\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:00:42.000000Z\",\n \"started_at\": \"2025-08-10T10:00:45.000000Z\",\n \"completed_at\": \"2025-08-10T10:01:12.000000Z\",\n \"result\": \"<!doctype html>\\n<html>\\n<head>\\n <title>Example Domain</title>\\n</head>\\n<body>\\n <h1>Example Domain</h1>\\n <p>This domain is for use in illustrative examples...</p>\\n</body>\\n</html>\"\n}"
},
{
"name": "Failed",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/crawl/b5dc483b-f62d-4e40-8b9e-4715324a8cbb",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl",
"b5dc483b-f62d-4e40-8b9e-4715324a8cbb"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"b5dc483b-f62d-4e40-8b9e-4715324a8cbb\",\n \"status\": \"failed\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:00:42.000000Z\",\n \"started_at\": \"2025-08-10T10:00:45.000000Z\",\n \"completed_at\": \"2025-08-10T10:00:50.000000Z\",\n \"error\": \"Timeout: Navigation failed after 30 seconds\"\n}"
}
]
},
{
"name": "List Crawl Jobs",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/api/crawl",
"host": [
"{{base_url}}"
],
"path": [
"api",
"crawl"
]
},
"description": "List all crawl jobs with pagination. Optional endpoint for debugging and monitoring."
},
"response": []
}
]
},
{
"name": "Screenshots",
"item": [
{
"name": "Initiate Screenshot Job",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"url\": \"https://example.com\",\n \"viewport_width\": 1920,\n \"viewport_height\": 1080,\n \"format\": \"webp\",\n \"quality\": 90,\n \"timeout\": 30,\n \"delay\": 2000,\n \"block_ads\": true,\n \"block_cookie_banners\": true,\n \"block_trackers\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/api/shot",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot"
]
},
"description": "Initiate a screenshot job to capture an image of a webpage.\n\n**Parameters:**\n- `url` (required): Target URL to screenshot\n- `viewport_width` (optional): Viewport width in pixels (320-3840, default: 1920)\n- `viewport_height` (optional): Viewport height in pixels (240-2160, default: 1080)\n- `format` (optional): Image format - jpg, png, webp (default: jpg)\n- `quality` (optional): Image quality 1-100 (default: 90)\n- `timeout` (optional): Request timeout in seconds (5-300)\n- `delay` (optional): Wait time before capture in milliseconds (0-30000)\n- `block_ads` (optional): Block ads using EasyList filters (default: true)\n- `block_cookie_banners` (optional): Block cookie banners (default: true)\n- `block_trackers` (optional): Block tracking scripts (default: true)"
},
"response": [
{
"name": "Success",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"url\": \"https://example.com\",\n \"viewport_width\": 1280,\n \"viewport_height\": 720,\n \"format\": \"webp\",\n \"block_ads\": true\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/api/shot",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"fe37d511-99cb-4295-853b-6d484900a851\",\n \"status\": \"queued\",\n \"message\": \"Screenshot job initiated successfully\"\n}"
}
]
},
{
"name": "Get Screenshot Status & Results",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/api/shot/:uuid",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot",
":uuid"
],
"variable": [
{
"key": "uuid",
"value": "fe37d511-99cb-4295-853b-6d484900a851",
"description": "Job UUID returned from screenshot initiation"
}
]
},
"description": "Check the status and retrieve results of a screenshot job. When completed, returns base64 image data and download URL."
},
"response": [
{
"name": "Queued",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/shot/fe37d511-99cb-4295-853b-6d484900a851",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot",
"fe37d511-99cb-4295-853b-6d484900a851"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"fe37d511-99cb-4295-853b-6d484900a851\",\n \"status\": \"queued\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:05:42.000000Z\"\n}"
},
{
"name": "Completed",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{base_url}}/api/shot/fe37d511-99cb-4295-853b-6d484900a851",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot",
"fe37d511-99cb-4295-853b-6d484900a851"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [],
"cookie": [],
"body": "{\n \"uuid\": \"fe37d511-99cb-4295-853b-6d484900a851\",\n \"status\": \"completed\",\n \"url\": \"https://example.com\",\n \"created_at\": \"2025-08-10T10:05:42.000000Z\",\n \"started_at\": \"2025-08-10T10:05:45.000000Z\",\n \"completed_at\": \"2025-08-10T10:06:12.000000Z\",\n \"result\": {\n \"image_data\": \"iVBORw0KGgoAAAANSUhEUgAAAHgAAAAyCAYAAACXpx/Y...\",\n \"download_url\": \"https://crawlshot.test/api/shot/fe37d511-99cb-4295-853b-6d484900a851/download\",\n \"mime_type\": \"image/webp\",\n \"format\": \"webp\",\n \"width\": 1920,\n \"height\": 1080,\n \"size\": 45678\n }\n}"
}
]
},
{
"name": "Download Screenshot File",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/shot/:uuid/download",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot",
":uuid",
"download"
],
"variable": [
{
"key": "uuid",
"value": "fe37d511-99cb-4295-853b-6d484900a851",
"description": "Job UUID"
}
]
},
"description": "Download the screenshot file directly. This endpoint returns the actual image file with appropriate headers for downloading."
},
"response": []
},
{
"name": "List Screenshot Jobs",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/api/shot",
"host": [
"{{base_url}}"
],
"path": [
"api",
"shot"
]
},
"description": "List all screenshot jobs with pagination. Optional endpoint for debugging and monitoring."
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}