Skip to content

klou23/TastyTradeAPI

Repository files navigation

TastyTradeAPI

release license coverage
swift macOS iOS Linux

Overview

TastyTradeAPI is a Swift library that provides a seamless interface to interact with the TastyTrade brokerage API. It simplifies the process of accessing market data, managing accounts, and executing trades on the TastyTrade platform.

Table of Contents

Features

  • Easy authentication with TastyTrade servers
  • Data models for all supported API responses
  • Currently supported API routes:
    • Users and Sessions
    • Account Status
    • Balances and Positions
    • Transactions

Installation

Because TastyTradeAPI uses Async/Await to simplify API calls, TastyTradeAPI requires Swift 5.5+, and can run on the following platforms:

  • iOS 13.0+
  • macOS 10.15+
  • Linux

Installation steps:

  1. Open the project you want to add TastyTradeAPI to in Xcode.
  2. In the menu bar, select File > Add Package Dependencies...
  3. Paste the URL of this repository in the search field
  4. Choose the version or branch you want (latest release is recommended)
  5. Select the target to which you want to add TastyTradeAPI

Quick Start

Authentication

The first step to using TastyTradeAPI is setting up authentication. Authentication is done using your Tasty Trade credentials:

// Create auth object
let auth = TastyTradeAuth(
    login: "your-login-here",
    password: "your-password-here",
    rememberMe: true,
    sandbox: false
)
// Attempt to authenticate
try await auth.login()
// Tell TastyTradeAPI to use the new auth
TastyAPI.auth = auth

Making Requests

After setting up authentication, requests can be made very easily using the methods in TastyAPI:

// Get the trading status for an account
let status = try await TastyAPI.tradingStatus(accountNumber: "12345")

API Documentation

Complete documentation for TastyTradeAPI can be found here

About

A Swift library for the Tasty Trade API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages