Spaces:
Running
Running
Download api.html from CAGB058/xml-excel-data-explorer: direct link, hf CLI and curl.
- Browser
- Download file 7.54 kB
-
https://huggingface.co/spaces/CAGB058/xml-excel-data-explorer/resolve/main/api.html
- Command line
-
hf download hf://spaces/CAGB058/xml-excel-data-explorer/api.html
-
curl -L -o api.html https://huggingface.co/spaces/CAGB058/xml-excel-data-explorer/resolve/main/api.html
7.54 kB
| <html lang="es"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>API Documentation | XML Data Explorer</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <custom-header></custom-header> | |
| <main class="container mx-auto px-4 py-8"> | |
| <div class="max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden p-8"> | |
| <h1 class="text-3xl font-bold text-gray-900 mb-6">API Documentation</h1> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <div class="lg:col-span-2"> | |
| <!-- Endpoints --> | |
| <div class="space-y-6"> | |
| <!-- Upload Endpoint --> | |
| <div class="bg-gray-50 border border-gray-200 rounded-lg p-6"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-2">Upload XML/Excel</h2> | |
| <div class="flex items-center gap-2 mb-4"> | |
| <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">POST</span> | |
| <code class="text-sm bg-gray-100 px-2 py-1 rounded">/api/upload</code> | |
| </div> | |
| </div> | |
| <button class="copy-btn" data-clipboard-text="POST /api/upload"> | |
| <i data-feather="copy" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| <p class="text-gray-600 mb-4">Upload an XML or Excel file for processing.</p> | |
| <h3 class="font-medium text-gray-700 mb-2">Request Body</h3> | |
| <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto"> | |
| <pre class="text-gray-100 text-sm"><code>{ | |
| "file": "File object (XML/XLSX/CSV)" | |
| }</code></pre> | |
| </div> | |
| <h3 class="font-medium text-gray-700 mb-2">Success Response</h3> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-gray-100 text-sm"><code>{ | |
| "status": "success", | |
| "data": { | |
| "elements": 42, | |
| "levels": 3, | |
| "attributes": 15, | |
| "structure": "..." | |
| } | |
| }</code></pre> | |
| </div> | |
| </div> | |
| <!-- Export Endpoint --> | |
| <div class="bg-gray-50 border border-gray-200 rounded-lg p-6"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-2">Export Data</h2> | |
| <div class="flex items-center gap-2 mb-4"> | |
| <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">GET</span> | |
| <code class="text-sm bg-gray-100 px-2 py-1 rounded">/api/export/:format</code> | |
| </div> | |
| </div> | |
| <button class="copy-btn" data-clipboard-text="GET /api/export/:format"> | |
| <i data-feather="copy" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| <p class="text-gray-600 mb-4">Export processed data in various formats.</p> | |
| <h3 class="font-medium text-gray-700 mb-2">URL Parameters</h3> | |
| <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto"> | |
| <pre class="text-gray-100 text-sm"><code>{ | |
| "format": "xlsx|csv|json|xml" | |
| }</code></pre> | |
| </div> | |
| <h3 class="font-medium text-gray-700 mb-2">Success Response</h3> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-gray-100 text-sm"><code>{ | |
| Binary file of the requested format | |
| }</code></pre> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <!-- Quick Start --> | |
| <div class="bg-blue-50 border border-blue-200 rounded-lg p-6 mb-6"> | |
| <h2 class="text-xl font-semibold text-blue-800 mb-4">Quick Start</h2> | |
| <div class="space-y-4"> | |
| <div> | |
| <h3 class="font-medium text-blue-700 mb-1">Upload a file</h3> | |
| <pre class="bg-blue-100 text-blue-800 p-2 rounded text-sm overflow-x-auto"><code>curl -X POST -F "file=@data.xml" https://api.example.com/upload</code></pre> | |
| <button class="copy-btn mt-1" data-clipboard-text='curl -X POST -F "file=@data.xml" https://api.example.com/upload'> | |
| <i data-feather="copy" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| <div> | |
| <h3 class="font-medium text-blue-700 mb-1">Export as JSON</h3> | |
| <pre class="bg-blue-100 text-blue-800 p-2 rounded text-sm overflow-x-auto"><code>curl -o output.json https://api.example.com/export/json</code></pre> | |
| <button class="copy-btn mt-1" data-clipboard-text='curl -o output.json https://api.example.com/export/json'> | |
| <i data-feather="copy" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Authentication --> | |
| <div class="bg-gray-50 border border-gray-200 rounded-lg p-6"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-4">Authentication</h2> | |
| <p class="text-gray-600 mb-4">Our API uses API keys for authentication.</p> | |
| <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto"> | |
| <pre class="text-gray-100 text-sm"><code>Authorization: Bearer your_api_key</code></pre> | |
| </div> | |
| <button class="copy-btn" data-clipboard-text="Authorization: Bearer your_api_key"> | |
| <i data-feather="copy" class="w-4 h-4"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/header.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> |