Skip to main content
FootyCollect integrates with the Football Kit Archive via FKAPI (Football Kit Archive API) to provide a seamless search-and-add workflow for cataloging your collection. This integration automatically populates item metadata including club, season, competition, brand, and design information.

What is FKAPI?

FKAPI is a RESTful API service that provides access to the Football Kit Archive database, which contains thousands of football kits from clubs around the world. It serves as the primary data source for kit metadata when adding items to your FootyCollect collection.
FKAPI is an optional dependency. FootyCollect works without FKAPI, but you’ll need to enter all item details manually. With FKAPI running, you get automatic metadata population and search capabilities.

Key Features

  • Club search: Search for clubs by name
  • Season lookup: Get available seasons for each club
  • Kit catalog: Browse kits by club and season
  • Kit details: Retrieve complete kit information including colors, design, competitions, and images
  • Bulk operations: Fetch multiple kits in a single request

How FKAPI Integrates with FootyCollect

The integration works through a client-service architecture:

FKAPIClient

The FKAPIClient class handles all communication with the FKAPI service:

Circuit Breaker

Prevents cascading failures by temporarily blocking requests after repeated failures

Rate Limiting

Maximum 100 requests per minute to protect the API

Retry Logic

Automatic retry with exponential backoff for failed requests

Response Caching

1-hour cache for search results and kit details

Configuration

Set these environment variables to enable FKAPI integration:
.env

Search Workflow

1. Search for Clubs

When creating a new item, start by searching for a club:

2. Get Club Seasons

Once you select a club, fetch available seasons:

3. Browse Kits for Season

Select a season to see available kits:

4. Get Kit Details

Retrieve complete metadata for the selected kit:
Kit details are cached for 1 hour by default. Set use_cache=False if you need fresh data:

Automatic Metadata Population

When you select a kit from FKAPI, FootyCollect automatically populates:

Club Information

  • Club name
  • Club logo (downloaded and stored locally)
  • Country

Season Data

  • Season year (e.g., “2023-24”)
  • Start and end dates

Kit Details

  • Kit type (Home, Away, Third, Goalkeeper, etc.)
  • Brand name and logo
  • Main color and secondary colors
  • Design pattern (Stripes, Plain, Hoops, etc.)

Competitions

  • Associated leagues and tournaments
  • Competition logos
The FKAPIKitProcessor service handles kit data processing:
This ensures all related entities (clubs, brands, competitions) are created in your local database if they don’t already exist.

Advanced Features

Bulk Kit Fetching

Fetch multiple kits in a single API call:
Bulk endpoint supports 2-30 slugs per request. Requests with fewer than 2 or more than 30 slugs will be rejected or truncated.

User Collection Scraping

Import your entire collection from Football Kit Archive:
This asynchronous operation:
  1. Scrapes your Football Kit Archive collection
  2. Processes each kit through FKAPI
  3. Creates corresponding items in FootyCollect
  4. Downloads and optimizes kit images

Alternative Search Methods

If FKAPI is unavailable, the client falls back to alternative methods:

Error Handling & Resilience

Circuit Breaker Pattern

Prevents overwhelming a failing FKAPI service:
States:
  • Closed: Normal operation, all requests allowed
  • Open: Service failing, requests blocked for timeout period
  • Half-Open: Testing if service recovered

Retry with Exponential Backoff

Stale Cache Fallback

If FKAPI is unavailable, FootyCollect serves stale cached data:
When FKAPI is completely unavailable and cache is empty, you’ll need to enter item details manually. The system gracefully degrades to manual entry mode.

Benefits of FKAPI Integration

Time Savings

Automatically populate 10+ fields with a single kit selection

Data Accuracy

Official data from Football Kit Archive ensures correct details

Consistency

Standardized club names, brands, and competitions across all items

Rich Metadata

Access to competitions, design patterns, and color information

Logo Downloads

Automatic download of club and brand logos

Bulk Import

Import entire collections from Football Kit Archive

API Endpoints

Running FKAPI Locally

To enable FKAPI integration in development:
  1. Clone the FKAPI repository:
  2. Follow FKAPI setup instructions to start the service
  3. Configure FootyCollect environment:
  4. Restart FootyCollect to enable integration
For production deployments, run FKAPI as a separate service and configure the FKA_API_IP to point to your FKAPI server.