Overview
FKAPI provides powerful search functionality for finding kits by keyword, club, season, and competition. FootyCollect wraps these capabilities through theFKAPIClient to enable seamless kit discovery.
Search Methods
Search Kits by Keyword
The primary search method for finding kits across the Football Kit Archive:client.py:423-434):
The
search_kits() method automatically handles FKAPI unavailability by returning an empty list instead of raising an exception. Always check for empty results in your code.Search Clubs
Search for clubs to find their kits by season:client.py:400-403):
Search Brands
Find kits by manufacturer brand:client.py:436-458):
If the direct brand search endpoint is unavailable, the client falls back to extracting brands from kit search results:
Search Competitions
Find kits by competition (league, tournament):client.py:460-484):
Similar to brand search, competition search has a fallback that extracts competitions from kit results.
Search Parameters
Keyword Search
All search methods accept akeyword parameter:
string
required
The search query string. Supports partial matches and multiple words.Examples:
"arsenal"- Finds all Arsenal kits"barcelona home"- Finds Barcelona home kits"2023"- Finds kits from 2023 season
Minimum Query Length
Proxy endpoints enforce minimum query lengths to prevent excessive API calls:- Kit search: Minimum 3 characters
- Brand search: Minimum 2 characters
- Competition search: Minimum 2 characters
Response Format
Kit Search Response
Kit search returns a list of kit objects with the following structure:Club Search Response
Using Search in FootyCollect
Frontend Kit Search
The search functionality is exposed through proxy endpoints for frontend use:Get Club Seasons
Once you have a club ID, fetch available seasons:client.py:405-408):
Get Club Kits by Season
Find all kits for a specific club and season:client.py:410-416):
Get Kit Details
Fetch complete details for a specific kit:client.py:418-421):
The
get_kit_details() method can return None if FKAPI is unavailable. Always check for None before using the result.Complete Search Workflow
Here’s how to implement a complete kit search flow:Advanced Search Patterns
Multi-Stage Search
Combine multiple search methods for refined results:Search with Caching Control
Error Handling Best Practices
Rate Limiting Considerations
All search methods are subject to rate limiting:- Client-side: 100 requests per minute
- Proxy endpoints: 100 requests per hour per IP
Use caching effectively to stay within rate limits. Most search queries are cached for 1 hour by default.
Next Steps
- Learn about bulk operations for importing multiple kits
- Review the FKAPI overview for architecture details
- Explore proxy endpoints for frontend integration