Skip to main content

FFData Python SDK

Docs Discord GitHub Built by FFData


Python SDK for accessing Free Fire player data and Craftland information via the professional FFData API.


Installation

pip install ffdata-client

Quick Start

from ffclient import FFClient

# Initialize client (Default points to https://ffdata-api.onrender.com)
client = FFClient(api_key="your_api_key")

# Fetch player data with specific detail level
# Supported detail_levels: "basic", "detailed", "full"
player = client.get_player(uid=1738283841, detail_level="detailed")

# Fetch workshop author info (Craftland)
author = client.get_workshop_author(uid=1738283841, detail_level="full")

# Fetch clan info (Guild)
clan = client.get_clan(clan_id=3022208474, detail_level="basic")

print(player["data"]["nickname"])
print(author["data"])
print(clan["data"]["clan_name"])

# Check cached credit balance
print(f"Remaining balance: {client.credits_left}")

Detailed Usage

Player API

Retrieve real-time player statistics and regional data.

player = client.get_player(
    uid=2726416993,
    detail_level="detailed" # options: "basic", "detailed", "full"
)

# Access primary data
print(player["data"])

# Access metadata (Time, Request ID, Version, Credits Left)
print(player["meta"]["time_ms"])
print(player["meta"]["request_id"])
print(player["meta"]["credits_left"])

Workshop (Craftland)

Retrieve creator statistics and map information.

author = client.get_workshop_author(uid=2726416993, detail_level="basic")
print(author["data"]["likes"])

Clan Info (Guild)

Retrieve clan standings, rosters, and levels.

clan = client.get_clan(clan_id=3022208474, detail_level="detailed")
print(clan["data"]["clan_name"])

Configuration

Custom configuration for private endpoints or specialized debugging.

client = FFClient(
    api_key="your_api_key",
    base_url="https://ffdata-api.onrender.com",  # optional override
    debug="basic",  # options: "off", "basic", "verbose"
    timeout=15,
    max_retries=3
)

Response Format

The SDK returns a unified response structure for all endpoints:

{
  "data": { 
    "uid": 2726416993,
    "nickname": "...",
    ...
  },
  "meta": {
    "time_ms": 120,      // Latency in milliseconds
    "request_id": "...", // Global tracing ID
    "fallback": false,   // True if served from circuit-breaker cache
    "version": "1.0.0",  // SDK Version
    "credits_left": 490, // Account credits left
    "credits_used": 5    // Request cost
  }
}

Error Handling

The SDK maps HTTP errors to descriptive Python exceptions.

from ffclient import AuthError, RateLimitError, InsufficientCreditsError

try:
    client.get_player(uid=2726416993)

except AuthError:
    print("Invalid API key or session expired")

except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")

except InsufficientCreditsError:
    print("Your account balance is 0. Please top up.")

except Exception as e:
    print(f"An unexpected error occurred: {e}")

Features

  • Resilience: Built-in adaptive circuit breakers and jiterred retries.
  • Unified Schema: Consistent data + meta structure across all calls.
  • Metadata Insight: High-resolution latency tracking (time_ms) and request_id for debugging.
  • Performance: Persistent connection pooling and memory-safe LRU caching.
  • Detail Levels: Granular control over response payload size.

License

MIT

Metadata

Release files for ffdata-client 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffdata-client 1.0.0
File Size Uploaded Provenance Actions
ffdata_client-1.0.0.tar.gz 10.2 kB Without provenance Details for ffdata_client-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ffdata-client 1.0.0
File Interpreter ABI Platform Actions
ffdata_client-1.0.0-py3-none-any.whl Python 3 none any Details for ffdata_client-1.0.0-py3-none-any.whl

Total release size: 18.6 kB

Release files / ffdata_client-1.0.0.tar.gz

Download URL ffdata_client-1.0.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
17d7feb5830e9ac10ff27c5d3a96655fb5ded27c395144fa259c1da8ac34b029
BLAKE2b-256 checksum
How to use checksums
eebd0d1f01fe0a610ef4196699b7f84c570270cda6e9171a42e6e6fec528dcf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / ffdata_client-1.0.0-py3-none-any.whl

Download URL ffdata_client-1.0.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3216c751190688b687b318cfb678077e4e77c0c915cee8b0a44a54b5f8572e6
BLAKE2b-256 checksum
How to use checksums
441e57eff0d4278b74f8619e2dbcc22327d472d48e4dd1cea3d813ee8cd96583
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for ffdata-client 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page