Skip to main content

Overview

FKAPI provides powerful search functionality for finding kits by keyword, club, season, and competition. FootyCollect wraps these capabilities through the FKAPIClient to enable seamless kit discovery.

Search Methods

Search Kits by Keyword

The primary search method for finding kits across the Football Kit Archive:
Implementation (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:
Implementation (client.py:400-403):

Search Brands

Find kits by manufacturer brand:
Fallback Strategy (client.py:436-458): If the direct brand search endpoint is unavailable, the client falls back to extracting brands from kit search results:
The fallback strategy may return incomplete results compared to the direct API endpoint. It’s best used when FKAPI’s brand endpoint is temporarily unavailable.

Search Competitions

Find kits by competition (league, tournament):
Fallback Strategy (client.py:460-484): Similar to brand search, competition search has a fallback that extracts competitions from kit results.

Search Parameters

All search methods accept a keyword 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

The search functionality is exposed through proxy endpoints for frontend use:

Get Club Seasons

Once you have a club ID, fetch available seasons:
Implementation (client.py:405-408):

Get Club Kits by Season

Find all kits for a specific club and season:
Implementation (client.py:410-416):

Get Kit Details

Fetch complete details for a specific kit:
Implementation (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

Combine multiple search methods for refined results:

Search with Caching Control

Error Handling Best Practices

Always handle potential None returns and empty results:

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