API Documentation

Base URL: https://saifisvibin-volaris-pdf-tool.hf.space
GET /api/docs

API documentation page showing all available endpoints.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/docs
GET POST /api/predict

No description

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/predict
GET /api/device-info

API endpoint to get device information.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/device-info
POST /api/upload

Handle multiple PDF file uploads with background processing.

Example Request:
POST https://saifisvibin-volaris-pdf-tool.hf.space/api/upload
GET /api/progress/<task_id>

Get progress for a processing task.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/progress/<task_id>
GET /api/pdf-list

Get list of processed PDFs.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/pdf-list
GET /api/pdf-details/<path:pdf_stem>

Get detailed information about a processed PDF.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/pdf-details/<path:pdf_stem>
GET /output/<path:filename>

Serve output files (PDFs, images, markdown).

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/output/<path:filename>
POST /api/delete

Delete a processed PDF directory by stem (JSON or form body).

Example Request:
POST https://saifisvibin-volaris-pdf-tool.hf.space/api/delete
GET POST /api/delete/<path:stem>

Alternate endpoint to delete using URL path, for clients avoiding bodies.

Example Request:
GET https://saifisvibin-volaris-pdf-tool.hf.space/api/delete/<path:stem>

Quick Examples

Python Example
import requests
import time

# Get device info
response = requests.get('https://saifisvibin-volaris-pdf-tool.hf.space/api/device-info')
print(response.json())

# Upload a PDF
files = {'files[]': open('document.pdf', 'rb')}
data = {'extraction_mode': 'both'}  # or 'images' or 'markdown'
response = requests.post('https://saifisvibin-volaris-pdf-tool.hf.space/api/upload', files=files, data=data)
task_id = response.json()['task_id']

# Check progress
while True:
    progress = requests.get(f'https://saifisvibin-volaris-pdf-tool.hf.space/api/progress/{task_id}').json()
    print(f"Progress: {progress['progress']}% - {progress['message']}")
    if progress['status'] == 'completed':
        break
    time.sleep(0.5)

# Get results
results = progress['results']
for result in results:
    print(f"Processed: {result['filename']}")
    print(f"  Figures: {result['figures_count']}")
    print(f"  Tables: {result['tables_count']}")
cURL Example
# Get device info
curl https://saifisvibin-volaris-pdf-tool.hf.space/api/device-info

# Upload a PDF
curl -X POST https://saifisvibin-volaris-pdf-tool.hf.space/api/upload \
  -F "files[]=@document.pdf" \
  -F "extraction_mode=both"

# Check progress (replace TASK_ID)
curl https://saifisvibin-volaris-pdf-tool.hf.space/api/progress/TASK_ID

# List processed PDFs
curl https://saifisvibin-volaris-pdf-tool.hf.space/api/pdf-list

API Endpoints Overview

Method Endpoint Description
GET /api/docs API documentation page showing all available endpoints.
GET POST /api/predict No description
GET /api/device-info API endpoint to get device information.
POST /api/upload Handle multiple PDF file uploads with background processing.
GET /api/progress/<task_id> Get progress for a processing task.
GET /api/pdf-list Get list of processed PDFs.
GET /api/pdf-details/<path:pdf_stem> Get detailed information about a processed PDF.
GET /output/<path:filename> Serve output files (PDFs, images, markdown).
POST /api/delete Delete a processed PDF directory by stem (JSON or form body).
GET POST /api/delete/<path:stem> Alternate endpoint to delete using URL path, for clients avoiding bodies.