API Documentation

Authentication

All API requests require an API key passed in the X-API-Key header.


curl -H "X-API-Key: your_api_key" \
     /api/v1/countries
                            

Countries

Get a list of supported countries and their metadata.


import requests

response = requests.get(
    '/api/v1/countries',
    headers={'X-API-Key': 'your_api_key'}
)

countries = response.json()
                            

Holidays

Retrieve holidays for a specific country and year.


fetch('/api/v1/holidays?country=US&year=2024', {
    headers: {
        'X-API-Key': 'your_api_key'
    }
})
.then(response => response.json())
.then(holidays => console.log(holidays));
                            

Rate Limiting

The API is rate limited to 100 requests per day per API key. Rate limit information is included in the response headers:

  • X-RateLimit-Limit: Maximum requests per day (100)
  • X-RateLimit-Remaining: Remaining requests for the day
  • X-RateLimit-Reset: Seconds until the rate limit resets

Error Handling

The API uses conventional HTTP response codes:

  • 200 - Success
  • 400 - Bad Request
  • 401 - Unauthorized
  • 404 - Not Found
  • 429 - Too Many Requests (Rate limit exceeded)