SDKs

Client libraries for integrating with the Fathom(x) Multi-Currency Crypto Data API

We provide official open-source SDKs (client libraries) for popular programming languages to make integrating with the Fathom(x) API faster and more reliable. These clients handle authentication, error handling, and provide typed responses.

Our SDKs are regularly updated and follow semantic versioning principles, ensuring we won’t introduce breaking changes in minor or patch releases.

Official SDKs

$npm install @fathomx/sdk
># or
>yarn add @fathomx/sdk

Quick Start Examples

Node.js/TypeScript

1import { FathomXClient } from "fathomx";
2
3const client = new FathomXClient({ token: "YOUR_TOKEN" });
4await client.addresses.transactions("BTC", "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", {
5 limit: "10",
6 offset: "0",
7});
8
9// Get transactions for a cryptocurrency address
10const transactions = await client.addresses.transactions('BTC', 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh', {
11 limit: 10,
12 offset: 0
13});
14
15// Get the balance of a Bitcoin address
16const balance = await client.addresses.balance('BTC', 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh');
17
18// Get supported currencies
19const currencies = await client.currencies.get();

Python

1from fathomx import FathomXClient
2
3fx = FathomXClient(
4 token="YOUR_TOKEN",
5)
6fx.addresses.transactions(
7 currency="BTC",
8 address="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
9 limit="10",
10 offset="0",
11)

Ruby

1fx = FathomX::Client.new(token: "YOUR_AUTH_TOKEN")
2
3transactions = fx.addresses.transactions(
4 currency: "BTC",
5 address: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
6)

Go

1package main
2
3import (
4 "context"
5 "fmt"
6 "github.com/fathomx/fathomx-go"
7)
8
9func main() {
10 client := fathomx.NewClient("your-jwt-token") // Optional
11
12 // Get Dogecoin transactions
13 transactions, err := client.GetTransactions(context.Background(), &fathomx.GetTransactionsRequest{
14 Currency: "DOGE",
15 Address: "DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L",
16 Limit: fathomx.Int(10),
17 })
18
19 if err != nil {
20 panic(err)
21 }
22
23 fmt.Printf("Found %d transactions\n", len(transactions.Transactions))
24}

Authentication

All SDKs support optional Bearer token authentication for higher rate limits:

1// With authentication (higher rate limits)
2const client = new FathomXClient({
3 bearerToken: 'your-jwt-token'
4});
5
6// Without authentication (lower rate limits)
7const client = new FathomXClient();

Error Handling

Our SDKs provide structured error handling for common API errors:

  • INVALID_ADDRESS: The provided address format is invalid
  • UNSUPPORTED_CURRENCY: The currency ticker is not supported
  • INVALID_LIMIT: Limit parameter must be between 1 and 100
  • BACKEND_ERROR: Server-side error occurred

Rate Limiting

The SDKs automatically handle rate limiting and provide retry mechanisms with exponential backoff for failed requests.