Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The example on Bun demonstrates how to perform OAuth 1.0a authentication. It can help you obtain the LST (Live Session Token).

You must provide several required files or keys.

Required Files

Filename Description Format
key/consumer_key.txt Your Consumer Key Plain text
key/token.txt Your access token Plain text
key/secret.txt Your access token secret Plain text
key/dhparam.pem Diffie–Hellman key PEM format
key/private_encryption.pem Private encryption key PEM format
key/private_signature.pem Private signature key PEM format

To run

bun run index.ts

init session

https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/#ssodh-init

curl -X POST "https://api.ibkr.com/v1/api/iserver/auth/ssodh/init" \
     -H "Accept: */*" \
     -H "Accept-Encoding: gzip,deflate" \
     -H "Connection: keep-alive" \
     -H "Host: api.ibkr.com" \
     -H "User-Agent: bun/1.0" \
     -H "Content-Type: application/json" \
     -H "Authorization: Oauth <OAUTH_HEADER>" \
     -d '{"publish": true, "compete": true}'

OAUTH_HEADER

Key Description Source
oauth_consumer_key Your 9-character consumer key key/consumer_key
oauth_token Your Access Token key/token
oauth_signature_method Must be HMAC-SHA256 Must be HMAC-SHA256 (Used with LST for signing)
oauth_timestamp Current Unix timestamp Current Unix timestamp (seconds)
oauth_nonce Random 16-byte hex string Random 16-byte hex string
oauth_signature The cryptographic signature Generated using LST as the Key to sign the request via HMAC-SHA256.
realm 'limited_poa' or 'test_realm' 'limited_poa' for real account, 'test_realm' for paper account

About

IBKR web API and how to obtain a Live Session Token。 bun & rust

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages