Overview
The Football Kit Archive API uses standard HTTP status codes and returns consistent error responses in JSON format. All errors include adetail field with a human-readable error message.
Error Response Format
All error responses follow this structure:fkapi/api.py:178-183:
HTTP Status Codes
200 OK
Request succeeded. Returns the requested resource(s).400 Bad Request
Invalid request parameters or validation errors.Invalid Parameters
Invalid Color
Fromfkapi/api.py:834-836:
Invalid Design
Fromfkapi/api.py:858-861:
Invalid Season
Fromcore/exceptions.py:57-70:
Bulk Kit Errors
Fromfkapi/api.py:1358-1361:
401 Unauthorized
Missing or invalid API key (only when authentication is enabled).403 Forbidden
Rate limit exceeded. Fromcore/middleware.py:70-71:
404 Not Found
Requested resource does not exist.Kit Not Found
Fromcore/exceptions.py:25-38:
fkapi/api.py:236-250:
Club Not Found
Fromcore/exceptions.py:41-54:
500 Internal Server Error
Unexpected server error. Fromfkapi/api.py:253-264:
503 Service Unavailable
Database or cache connection failed. Fromfkapi/api.py:301-308:
Exception Classes
Fromcore/exceptions.py:
ScrapingError (Base Exception)
KitNotFoundError
404
ClubNotFoundError
404
InvalidSeasonError
400
RateLimitExceededError
403
ValidationError
400
Error Handling Examples
Python
JavaScript
Best Practices
1. Always Check Status Codes
2. Implement Retry Logic
3. Handle Rate Limits Gracefully
4. Log Errors
5. Provide User-Friendly Messages
Debugging Errors
Enable Debug Mode
In development, setDEBUG=True to get detailed error messages:
Check Server Logs
Test Error Handling
Related Documentation
Rate Limiting
Learn about rate limits and 403 errors
Authentication
Understand 401 authentication errors