FABLE Core API Routes

Base URL: https://fable.toolforge.org/

Find Aliases

POST /api/core/find_aliases

Synchronously find new URLs for broken links. Uses caching to return previously processed URLs immediately.

Full URL: https://fable.toolforge.org/api/core/find_aliases

Request:

[
  {
    "netloc_dir": "domain.com",
    "urls": [
      "http://domain.com/page1",
      "http://domain.com/page2"
    ]
  }
]

Response:

[
  {
    "netloc_dir": "domain.com",
    "aliases": [
      [
        "http://domain.com/page1",
        ["Page Title"],
        "http://domain.com/new-page1",
        ["match_type"]
      ]
    ]
  }
]

Start Alias Task

POST /api/core/start_alias_task

Asynchronously process URLs. If all URLs are cached, returns completed status immediately. Otherwise, processes new URLs in background.

Full URL: https://fable.toolforge.org/api/core/start_alias_task

Request:

[
  {
    "netloc_dir": "domain.com",
    "urls": ["http://domain.com/page1"]
  }
]

Response (if cached):

{
  "task_id": "uuid", 
  "status": "completed",
  "created_at": "2024-12-04T01:15:33.967Z"
}

Response (if processing needed):

{
  "task_id": "uuid", 
  "status": "pending",
  "created_at": "2024-12-04T01:15:33.967Z"
}

Task Status

GET /api/core/task_status/{task_id}

Check status of an async task.

Full URL: https://fable.toolforge.org/api/core/task_status/{task_id}

Response (while processing):

{
  "task_id": "uuid",
  "status": "pending",
  "created_at": "2024-12-04T01:15:33.967Z",
  "completed_at": null,
  "result": null,
  "error": null
}

Response (when completed):

{
  "task_id": "uuid",
  "status": "completed",
  "created_at": "2024-12-04T01:15:33.967Z",
  "completed_at": "2024-12-04T01:15:49.157Z",
  "result": [
    {
      "netloc_dir": "domain.com",
      "aliases": [
        {
          "source_url": "http://domain.com/page1",
          "titles": ["Page Title"],
          "target_url": "http://domain.com/new-page1",
          "match_types": ["match_type"]
        }
      ]
    }
  ],
  "error": null
}

Response (if failed):

{
  "task_id": "uuid",
  "status": "failed",
  "created_at": "2024-12-04T01:15:33.967Z",
  "completed_at": "2024-12-04T01:15:49.157Z",
  "result": null,
  "error": "Error message describing what went wrong"
}

System Status

GET /api/core/status

Check system initialization status. Indicates whether the heavy ML models (Similar object and AliasFinder) are loaded and ready.

Full URL: https://fable.toolforge.org/api/core/status

Response (when ready):

{
  "status": "ready",
  "message": "System is fully initialized and ready"
}

Response (if initialization failed):

{
  "status": "error",
  "message": "System initialization failed - some features may not work"
}

Health Check

GET /api/core/health

Check API server health status.

Full URL: https://fable.toolforge.org/api/core/health

Response:

{
  "status": "healthy"
}

Test DOM Distiller

GET /api/core/test_domdistiller

Test the DOM distiller functionality with a sample URL.

Full URL: https://fable.toolforge.org/api/core/test_domdistiller

Optional Query Parameter:

  • url - Custom URL to test (defaults to a sample URL if not provided)

Response:

{
  "title": "Extracted page title",
  "content": "Extracted page content..."
}

Usage Notes

  • Authentication: All endpoints are public and do not require authentication
  • Timeouts: No request timeouts - processing can take as long as needed
  • Rate Limiting: No rate limiting currently implemented
  • CORS: Configured for cross-origin requests

Local Development

For local development, replace the base URL with: http://localhost:8000/

Example: http://localhost:8000/api/core/status