npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ibkr-api-sdk

v1.0.0

Published

A Node.js SDK for Interactive Brokers API

Readme

IBKR API SDK

NPM Version License Node.js

Introduction

The IBKR API SDK provides a simple way to integrate with Interactive Brokers (IBKR) API for account management and ACH transfers. This SDK helps developers interact with IBKR's API for:

Account Creation
KYC Submission
Account Status Check
Add Bank Accounts
Delete Bank Accounts
ACH Fund Transfers


📦 Installation

To install the package via NPM, run:

npm install ibkr-api-sdk
Or using Yarn:
yarn add ibkr-api-sdk
🔧 Configuration

Before using the SDK, set up your environment variables in a .env file:
IBKR_BASE_URL=https://localhost:5000/v1/api
IBKR_API_KEY=your_api_key
IBKR_ACCOUNT_ID=your_account_id
🚀 Usage

Import the SDK and start making API calls.
1️⃣ Create an IBKR Account
const Ibkr = require("ibkr-api-sdk");

async function createAccount() {
  try {
    const response = await Ibkr.createAccount({
      firstName: "John",
      lastName: "Doe",
      email: "[email protected]"
    });
    console.log("Account Created:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

createAccount();
2️⃣ Submit KYC
async function submitKYC() {
  try {
    const response = await Ibkr.submitKYC({
      userId: "U1234567",
      documentType: "passport",
      documentNumber: "123456789",
      issueDate: "2023-01-01",
      expiryDate: "2033-01-01"
    });
    console.log("KYC Submitted:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

submitKYC();
3️⃣ Get Account Status
async function checkAccountStatus() {
  try {
    const response = await Ibkr.getAccountStatus();
    console.log("Account Status:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

checkAccountStatus();
4️⃣ Add a Bank Account
async function addBankAccount() {
  try {
    const response = await Ibkr.addBank({
      bankName: "Bank of America",
      accountNumber: "123456789",
      routingNumber: "987654321",
      accountType: "checking"
    });
    console.log("Bank Account Added:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

addBankAccount();
5️⃣ Delete a Bank Account
async function deleteBankAccount() {
  try {
    const response = await Ibkr.deleteBank("bank123");
    console.log("Bank Account Deleted:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

deleteBankAccount();
6️⃣ Perform an ACH Transfer
async function performACHTransfer() {
  try {
    const response = await Ibkr.achTransfer({
      amount: 1000,
      currency: "USD",
      recipientAccount: "recipient123"
    });
    console.log("ACH Transfer Successful:", response);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

performACHTransfer();
🛠 API Methods

Method	Description	Parameters
createAccount(data)	Create a new IBKR account	{ firstName, lastName, email }
submitKYC(data)	Submit KYC for verification	{ userId, documentType, documentNumber, issueDate, expiryDate }
getAccountStatus()	Retrieve IBKR account status	N/A
addBank(data)	Add a bank account	{ bankName, accountNumber, routingNumber, accountType }
deleteBank(bankId)	Remove a bank account	bankId
achTransfer(data)	Perform an ACH fund transfer	{ amount, currency, recipientAccount }
📌 Environment Variables

Variable Name	Description
IBKR_BASE_URL	The IBKR API base URL (e.g., https://localhost:5000/v1/api)
IBKR_API_KEY	Your IBKR API Key
IBKR_ACCOUNT_ID	Your IBKR Account ID
📖 IBKR API Documentation

Refer to the official IBKR API Documentation for more details:
🔗 IBKR API Docs
🔍 Troubleshooting

❓ "Unauthorized" Error
Check if IBKR Gateway/TWS is running.
Ensure API key is correct and permissions are enabled.
❓ "Invalid Account" Error
Verify your IBKR_ACCOUNT_ID is correct.
❓ Connection Refused
Restart IBKR Gateway:
killall ibgateway
./ibgateway
📄 License

This project is licensed under the MIT License.
👨‍💻 Contributors

Your Name - Developer
Contributors Welcome! If you'd like to improve this package, feel free to submit a PR!
⭐ Support & Contributions

💡 Found a bug? Have a feature request?
Submit an issue or PR on GitHub.
✅ If you find this package useful, please star this repository! 🌟

---

## **📌 How to Use It?**
1. Copy this **`README.md`** and place it inside your **NPM package root folder**.
2. After publishing, it will appear as the **package documentation** on **npmjs.com**.

---

## **🚀 Next Steps**
- ✅ **README.md completed**  
- ✅ **NPM package structure & implementation done**  
- 🔒 **OAuth Authentication (Optional, for better security)**  
- ✅ **Testing with Jest** (if needed)  

Would you like **unit tests** or **OAuth authentication** next? 🚀