Skip to main content

Professional Python SDK for FFData API

Project description

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
author = client.get_workshop_author(uid=1738283841, detail_level="full")

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

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)
print(player["meta"]["time_ms"])
print(player["meta"]["request_id"])

Workshop (Craftland)

Retrieve creator statistics and map information.

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

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": "0.2.0"   // SDK Version
  }
}

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffdata_client-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffdata_client-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file ffdata_client-0.2.0.tar.gz.

File metadata

  • Download URL: ffdata_client-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ffdata_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cf81e8c2d56157413c769a27a94f03ad42381425f725819b37c90a772b05d7aa
MD5 8af97514db4ca501fb2d4d3420c32c8e
BLAKE2b-256 e0f705f4c9425d1ea43010f778546ed921866d2d7fe4bef85f58dd687d806d65

See more details on using hashes here.

File details

Details for the file ffdata_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ffdata_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ffdata_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bbfd7a9b3e5310e158f025087d770d903abf869b2e3e172bdcce29277c91278
MD5 54e8570c68365d9b7c8de3e0918c8b52
BLAKE2b-256 bce79830726cbcd1a903269dad47b0340f24fb2885543eb975796fae8b32f607

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page