Skip to main content

Foxbit Python SDK

This is the official SDK provided by Foxbit for interacting with our APIs using Python.

Prerequisites

  • Python 3.9 or higher
  • pip

Installation

Install the SDK using pip:

pip install foxbit-group-rest-api

How to Use

To start using the SDK, import the desired API module and call its methods:

from foxbit_group.rest_api import ApiClient
from foxbit_group.rest_api.api import MarketDataApi

with ApiClient() as client:
    market_data_api = MarketDataApi(client)

    currencies = market_data_api.list_currencies()
    print("Currencies:", currencies)

For public endpoints that don't require authentication, you can use the SDK without any configuration.

Authentication

For authenticated endpoints, instantiate a Configuration object with your API credentials and pass it to ApiClient:

from foxbit_group.rest_api import ApiClient, Configuration
from foxbit_group.rest_api.api import TradingApi
from foxbit_group.rest_api.models import CreateOrderRequest, OrderMarket

# Initialize the configuration with your API key and secret
config = Configuration(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
)

with ApiClient(config) as client:
    trading_api = TradingApi(client)

    # CreateOrderRequest wraps one of the concrete order types
    # (OrderMarket, OrderLimit, OrderInstant, OrderStop, OrderStopLimit)
    order = trading_api.create_order(
        create_order_request=CreateOrderRequest(
            OrderMarket(
                side="BUY",
                type="MARKET",
                market_symbol="btcbrl",
                quantity="1",
            )
        )
    )
    print("Order created:", order)

The SDK will automatically:

  1. Generate the current timestamp
  2. Create the request signature using your API secret (HMAC-SHA256)
  3. Add the required headers to each request:
    • X-FB-ACCESS-KEY: Your API key
    • X-FB-ACCESS-TIMESTAMP: Current timestamp
    • X-FB-ACCESS-SIGNATURE: Signature generated from your API secret

Your api_secret is only used locally to sign requests; it is never sent over the wire.

Note on retries: the signature and timestamp are computed once, when the request is serialized. If you enable transport-level retries (Configuration(retries=...)), a retried attempt replays the original timestamp and may be rejected as expired. Prefer retrying at the call site (call the SDK method again) so each attempt is signed afresh.

Error Handling

API errors raise typed exceptions, all inheriting from ApiException:

from foxbit_group.rest_api import ApiClient, Configuration
from foxbit_group.rest_api.api import TradingApi
from foxbit_group.rest_api.exceptions import ApiException, UnauthorizedException

config = Configuration(api_key="YOUR_API_KEY", api_secret="YOUR_API_SECRET")

with ApiClient(config) as client:
    try:
        orders = TradingApi(client).list_orders()
    except UnauthorizedException:
        print("Invalid credentials or rejected signature")
    except ApiException as e:
        print(f"API error: {e.status} - {e.body}")

Documentation for API Endpoints

You can find detailed documentation for each API endpoint in the Foxbit API Documentation.

Each API class has its own page, with an example per method:

Documentation for Models

About This SDK

This SDK was automatically generated using OpenAPI Generator.


Note: This SDK is actively maintained by the Foxbit team. For more information, visit https://foxbit.com.br.

Metadata

Release files for foxbit-group-rest-api 0.1.2

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

Source distribution (sdist)

Source distribution for foxbit-group-rest-api 0.1.2
File Size Uploaded
foxbit_group_rest_api-0.1.2.tar.gz 100.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foxbit-group-rest-api 0.1.2
File Interpreter ABI Platform
foxbit_group_rest_api-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 441.3 kB

Release files / foxbit_group_rest_api-0.1.2.tar.gz

Download URL foxbit_group_rest_api-0.1.2.tar.gz
Size 100.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5e14f14362fb6a634930563729e3ce43f8376b5b30f24d6111c1be87b3bb602c
BLAKE2b-256 checksum
How to use checksums
e5f00596daf4f35d2517061017d1b11418609ce762a15efed39a216f410870ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / foxbit_group_rest_api-0.1.2-py3-none-any.whl

Download URL foxbit_group_rest_api-0.1.2-py3-none-any.whl
Size 340.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45482542aa2eb16d5de2e5758ebf1907ed23d7cf2650b56a1b3ef625c409c9bb
BLAKE2b-256 checksum
How to use checksums
392a015a467d46811cf3ab149ee8c66811e457882df000c6f4f6ca28636d3ddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.2 This release

2 release files

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