SDKs
Native SDKs for every stack.
Typed clients for Python, Node.js, Go, and Ruby. Install in seconds, query in minutes.
Python
v2.4.1Install
pip install cacheUsage
from cache import Client
client = Client(api_key="sk_live_...")
# List recent transactions
transactions = client.transactions.list(
account_id="acc_8f3k2j1",
limit=10
)
for txn in transactions:
print(f"{txn.date}: {txn.merchant} - ${abs(txn.amount)}")Node.js
v3.1.0Install
npm install @usecache/nodeUsage
import { Cache } from '@usecache/node';
const client = new Cache({ apiKey: 'sk_live_...' });
// List recent transactions
const transactions = await client.transactions.list({
accountId: 'acc_8f3k2j1',
limit: 10,
});
transactions.forEach((txn) => {
console.log(`${txn.date}: ${txn.merchant} - $${Math.abs(txn.amount)}`);
});Go
v1.8.3Install
go get github.com/usecache/cache-goUsage
package main
import (
"fmt"
"github.com/usecache/cache-go"
)
func main() {
client := cache.New("sk_live_...")
// List recent transactions
txns, _ := client.Transactions.List(&cache.ListParams{
AccountID: "acc_8f3k2j1",
Limit: 10,
})
for _, txn := range txns {
fmt.Printf("%s: %s - $%.2f\n", txn.Date, txn.Merchant, -txn.Amount)
}
}Ruby
v1.5.2Install
gem install cacheUsage
require 'cache'
client = Cache::Client.new(api_key: 'sk_live_...')
# List recent transactions
transactions = client.transactions.list(
account_id: 'acc_8f3k2j1',
limit: 10
)
transactions.each do |txn|
puts "#{txn.date}: #{txn.merchant} - $#{txn.amount.abs}"
end