{"id":39653903,"url":"https://github.com/hadrianl/ibapi","last_synced_at":"2026-01-18T09:14:07.134Z","repository":{"id":48505905,"uuid":"190116210","full_name":"hadrianl/ibapi","owner":"hadrianl","description":"Interactive Brokers API - GoLang Implement","archived":false,"fork":false,"pushed_at":"2023-09-27T04:06:18.000Z","size":254,"stargazers_count":125,"open_issues_count":11,"forks_count":59,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-06-18T17:13:07.905Z","etag":null,"topics":["api","gateway","golang","interactive-brokers"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hadrianl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-04T02:38:43.000Z","updated_at":"2024-05-16T08:28:40.000Z","dependencies_parsed_at":"2022-08-27T22:31:23.643Z","dependency_job_id":"ba9a63bb-adb1-445d-850e-a157a5b65d0c","html_url":"https://github.com/hadrianl/ibapi","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/hadrianl/ibapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadrianl%2Fibapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadrianl%2Fibapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadrianl%2Fibapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadrianl%2Fibapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadrianl","download_url":"https://codeload.github.com/hadrianl/ibapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadrianl%2Fibapi/sbom","scorecard":{"id":452554,"data":{"date":"2025-08-11","repo":{"name":"github.com/hadrianl/ibapi","commit":"4f647c0e9c16555a4a1e6daaab674d8a41206cc4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 6/16 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release-drafter.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-drafter.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/hadrianl/ibapi/release-drafter.yml/master?enable=pin","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T08:34:37.710Z","repository_id":48505905,"created_at":"2025-08-19T08:34:37.710Z","updated_at":"2025-08-19T08:34:37.710Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","gateway","golang","interactive-brokers"],"created_at":"2026-01-18T09:14:06.501Z","updated_at":"2026-01-18T09:14:07.106Z","avatar_url":"https://github.com/hadrianl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interactive Brokers API - GoLang Implement\n\n\u003cimg\nstyle=\"display: block; margin: 0 auto;\"\nsrc=\"http://interactivebrokers.github.io/tws-api/nav_iblogo.png\"\n/\u003e\n\n* Interactive Brokers API 9.80\n* pure golang Implement\n* Unofficial, use at you own risk\n\n## INSTALL\n\n`go get -u github.com/hadrianl/ibapi`\n\n---\n\n## USAGE\n\nImplement `IbWrapper` to handle datas delivered via tws or gateway, `Wrapper` in demo is a default implement that just output data to std.\n[Go to IbWrapper](https://github.com/hadrianl/ibapi/blob/83846bf1194bbdc4f039c8c66033f717e015e9fc/wrapper.go#L11)\n\n1. **implement** your own `IbWrapper`\n2. **connect** to TWS or Gateway\n3. **handshake** with TWS or Gateway\n4. **run** the loop\n5. do some **request**\n\n### Demo 1\n\n```golang\nimport (\n    . \"github.com/hadrianl/ibapi\"\n    \"time\"\n)\n\nfunc main(){\n    // internal api log is zap log, you could use GetLogger to get the logger\n    // besides, you could use SetAPILogger to set you own log option\n    // or you can just use the other logger  \n    log := GetLogger().Sugar()\n    defer log.Sync()\n    // implement your own IbWrapper to handle the msg delivered via tws or gateway\n    // Wrapper{} below is a default implement which just log the msg \n    ic := NewIbClient(\u0026Wrapper{})\n\n    // tcp connect with tws or gateway\n    // fail if tws or gateway had not yet set the trust IP\n    if err := ic.Connect(\"127.0.0.1\", 4002, 0);err != nil {\n        log.Panic(\"Connect failed:\", err)\n    }\n\n    // handshake with tws or gateway, send handshake protocol to tell tws or gateway the version of client\n    // and receive the server version and connection time from tws or gateway.\n    // fail if someone else had already connected to tws or gateway with same clientID\n    if err := ic.HandShake();err != nil {\n        log.Panic(\"HandShake failed:\", err)\n    }\n\n    // make some request, msg would be delivered via wrapper.\n    // req will not send to TWS or Gateway until ic.Run()\n    // you could just call ic.Run() before these\n    ic.ReqCurrentTime()\n    ic.ReqAutoOpenOrders(true)\n    ic.ReqAccountUpdates(true, \"\")\n    ic.ReqExecutions(ic.GetReqID(), ExecutionFilter{})\n\n    // start to send req and receive msg from tws or gateway after this\n    ic.Run()\n    \u003c-time.After(time.Second * 60)\n    ic.Disconnect()\n}\n\n```\n\n### Demo 2 with context\n\n```golang\nimport (\n    . \"github.com/hadrianl/ibapi\"\n    \"time\"\n    \"context\"\n)\n\nfunc main(){\n    var err error\n    SetAPILogger(zap.NewDevelopmentConfig()) // log is default for production(json encode, info level), set to development(console encode, debug level) here\n    log := GetLogger().Sugar()\n    defer log.Sync()\n    ibwrapper := \u0026Wrapper{}\n    ctx, _ := context.WithTimeout(context.Background(), time.Second*30)\n    ic := NewIbClient(ibwrapper)\n    ic.SetContext(ctx)\n    err = ic.Connect(\"127.0.0.1\", 4002, 0)\n    if err != nil {\n        log.Panic(\"Connect failed:\", err)\n    }\n\n    err = ic.HandShake()\n    if err != nil {\n        log.Panic(\"HandShake failed:\", err)\n    }\n\n    ic.ReqCurrentTime()\n    ic.ReqAutoOpenOrders(true)\n    ic.ReqAccountUpdates(true, \"\")\n    ic.ReqExecutions(ic.GetReqID(), ExecutionFilter{})\n\n    ic.Run()\n    err = ic.LoopUntilDone()  // block until ctx or ic is done\n    log.Info(err)\n}\n\n```\n\n---\n\n## Reference\n\n1. [Offical Document](https://interactivebrokers.github.io/tws-api/)\n2. [Order Types](https://www.interactivebrokers.com/en/index.php?f=4985)\n3. [Product](https://www.interactivebrokers.com/en/index.php?f=4599)\n4. [Margin](https://www.interactivebrokers.com/en/index.php?f=24176)\n5. [Market Data](https://www.interactivebrokers.com/en/index.php?f=14193)\n6. [Commissions](https://www.interactivebrokers.com/en/index.php?f=1590)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadrianl%2Fibapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadrianl%2Fibapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadrianl%2Fibapi/lists"}