Skip to main content

Overview

The User Collections endpoints allow you to scrape and retrieve a user’s kit collection from FootballKitArchive. Collections are cached for 1 week after scraping.
User collections can contain large amounts of data. The API supports pagination to efficiently retrieve collection data.

Scrape User Collection

Start asynchronous scraping of a user’s collection from FootballKitArchive. If the collection is already cached, returns data immediately.

Path Parameters

integer
required
User ID from FootballKitArchive (found in the user’s profile URL)

Query Parameters

boolean
default:"false"
Force a fresh scrape by invalidating existing cache. Useful for getting updated collection data.

Response Codes

  • 200 OK - Collection found in cache, data returned immediately
  • 202 Accepted - Scraping started, use task_id to check status

Response (200 OK - Cached)

string
Status of the response: “cached”
object
Collection data object
boolean
Whether the scraping was successful
array
Array of kit entries in the collection
integer
Total number of kits in the collection
integer
Number of pages scraped from FootballKitArchive
object
Pagination information

Response (202 Accepted - Processing)

string
Status of the response: “processing”
string
Celery task ID for tracking the scraping job
string
Instructions for checking status

Usage Flow

  1. POST /api/user-collection/{userid}/scrape to start scraping
  2. If you receive 202 Accepted, wait approximately 60 seconds (scraping time depends on collection size)
  3. GET /api/user-collection/{userid} to retrieve paginated data
For large collections (500+ kits), scraping may take 2-3 minutes. The API respects rate limits to avoid overloading FootballKitArchive servers.

Get User Collection

Get a user’s collection from cache with pagination. Collection must be scraped first using the POST endpoint.

Path Parameters

integer
required
User ID from FootballKitArchive

Query Parameters

integer
default:"1"
Page number for pagination (minimum: 1)
integer
default:"20"
Number of items per page (minimum: 1, maximum: 100)

Response Codes

  • 200 OK - Collection found in cache, returns paginated data
  • 404 Not Found - Collection not found, suggest starting scraping first

Response (200 OK)

string
Status of the response: “ready”
object
Collection data object
boolean
Whether the scraping was successful
array
Array of kit entries for the current page
integer
Kit ID
string
Full name of the kit
string
URL-friendly slug for the kit
string
Club/team name
string
Season year
string
URL to the kit image
integer
Total number of kits in the collection
integer
Number of pages scraped from FootballKitArchive
object
User information (if available from scraping)
string
User’s display name
string
URL to user’s profile image
string
Twitter handle
string
Instagram handle
string
User’s profile description
integer
User’s points on FootballKitArchive
object
Pagination information
integer
Current page number
integer
Total number of pages
integer
Total number of kits
integer
Number of items per page
boolean
Whether there is a next page
boolean
Whether there is a previous page
integer
Next page number (null if no next page)
integer
Previous page number (null if no previous page)
string
ISO 8601 timestamp indicating when the cache expires

Response (404 Not Found)

string
Status of the response: “not_found”
string
Error message with instructions

Complete Example Workflow

Force Re-scrape

To get updated collection data with the latest kits and user information, use the force=true parameter. This invalidates the existing cache and performs a fresh scrape.
Force re-scraping should be used sparingly to avoid unnecessary load on FootballKitArchive servers. Collections are cached for 1 week.

Cache Duration

User collections are cached for 1 week (604,800 seconds) after scraping. After this period, a fresh scrape will be required.

Finding User IDs

To find a user’s ID on FootballKitArchive:
  1. Visit the user’s profile on FootballKitArchive
  2. Look at the URL: https://www.footballkitarchive.com/user/{userid}/
  3. The number in the URL is the user ID
Example: https://www.footballkitarchive.com/user/148184/ → User ID is 148184

Rate Limiting

The scraping process respects rate limits (minimum 2 seconds between requests) to avoid overloading FootballKitArchive servers. Large collections may take several minutes to scrape.

Ethical Considerations

This endpoint is designed for personal use and respects FootballKitArchive’s robots.txt and rate limits. Do not abuse this endpoint or scrape excessively.