API Documentation

Integrate ClaimCracker's fake news detection into your applications

Getting Started

Base URL and rate limits

https://harismusa-claimcracker.hf.space

All endpoints are rate-limited to protect the API. Headers returned with each response include:

  • X-RateLimit-Limit: Maximum requests allowed
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Time until reset

Predict Endpoint

Main endpoint for fake news detection

POST /predict

Analyzes text to determine if it contains fake news.

Request Body:

{
  "text": "string (required)"
}

Response Example:

{
  "prediction": "Real",
  "confidence": 0.95,
  "probabilities": {
    "Real": 0.95,
    "Fake": 0.05
  }
}

Rate Limit:

30 requests per minute

Error Handling

Understanding API error responses

All errors follow a consistent format:

{
  "detail": "Error message describing what went wrong"
}

Common Status Codes:

  • 400: Bad Request
  • 422: Validation Error
  • 429: Rate Limit Exceeded
  • 500: Internal Server Error

Model Performance

Understanding the AI model capabilities

  • Validation Accuracy: 96.03%
  • F1 Score: 0.9603
  • Inference Time: ~13.94ms/text
  • Response Time: <1s