{"id":38158162,"url":"https://github.com/sklinkert/igmarkets","last_synced_at":"2026-01-16T23:12:47.291Z","repository":{"id":57490519,"uuid":"125929886","full_name":"sklinkert/igmarkets","owner":"sklinkert","description":"Unofficial IG.com (former IG Markets) API client for Go/Golang","archived":false,"fork":false,"pushed_at":"2024-11-20T20:14:59.000Z","size":98,"stargazers_count":27,"open_issues_count":1,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-20T21:24:18.483Z","etag":null,"topics":["algo-trading","algorithmic-trading","bitcoin","broker","broker-api","brokerage","cfd","crypto","cryptocurrency","etf","forex","forex-trading","go","golang","ig","igmarkets","lightstreamer","quantitative-trading","stocks","trading"],"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/sklinkert.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}},"created_at":"2018-03-19T22:44:27.000Z","updated_at":"2024-11-20T20:14:58.000Z","dependencies_parsed_at":"2023-09-27T03:39:24.497Z","dependency_job_id":null,"html_url":"https://github.com/sklinkert/igmarkets","commit_stats":{"total_commits":71,"total_committers":6,"mean_commits":"11.833333333333334","dds":0.09859154929577463,"last_synced_commit":"401173ace766c7f361da7baba516d9329c3e68ca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sklinkert/igmarkets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Figmarkets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Figmarkets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Figmarkets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Figmarkets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sklinkert","download_url":"https://codeload.github.com/sklinkert/igmarkets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Figmarkets/sbom","scorecard":{"id":829812,"data":{"date":"2025-08-11","repo":{"name":"github.com/sklinkert/igmarkets","commit":"7f999822ac91351b8328578fb50569f49c8e3146"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"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":"Maintained","score":0,"reason":"1 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":"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":"Code-Review","score":2,"reason":"Found 5/19 approved changesets -- score normalized to 2","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.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: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/sklinkert/igmarkets/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sklinkert/igmarkets/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned 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":"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":"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":"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":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: branch 'master' does not require approvers","Warn: codeowners review is not required on branch 'master'","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 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"}}]},"last_synced_at":"2025-08-23T17:27:28.816Z","repository_id":57490519,"created_at":"2025-08-23T17:27:28.816Z","updated_at":"2025-08-23T17:27:28.816Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["algo-trading","algorithmic-trading","bitcoin","broker","broker-api","brokerage","cfd","crypto","cryptocurrency","etf","forex","forex-trading","go","golang","ig","igmarkets","lightstreamer","quantitative-trading","stocks","trading"],"created_at":"2026-01-16T23:12:43.050Z","updated_at":"2026-01-16T23:12:47.278Z","avatar_url":"https://github.com/sklinkert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# igmarkets - Unofficial IG Markets Trading API for Golang\n\nThis is an **unofficial** API for [IG Markets Trading REST API](https://labs.ig.com/rest-trading-api-reference). The StreamingAPI is not part of this project.\n\n**Disclaimer**: This library is not associated with IG Markets Limited or any of its affiliates or subsidiaries. If you use this library, you should contact them to make sure they are okay with how you intend to use it. Use this lib at your own risk.\n\nReference: https://labs.ig.com/rest-trading-api-reference\n\n## Currently supported endpoints\n\n### Lightstreamer\n\n- Create session, add subscription(control), bind session\n\n### Account\n\n- GET /accounts\n- GET /accounts/preferences\n\n### Session\n\n- POST /session (version 2 + 3)\n\n### Markets\n\n- GET /markets/{epic}\n- GET /markets?searchTerm=...\n\n### Client sentiment\n\n- GET /clientsentiment/{marketID}\n\n### Positions\n\n- POST /positions/otc\n- PUT /positions/otc/{dealId}\n- GET /positions\n- DELETE /positions\n- GET /confirms/{dealReference}\n\n### Workingorders\n- GET /workingorders\n- POST /workingorders/otc\n- DELETE /workingorders/otc/{dealId}\n\n### Prices\n\n- GET /prices/{epic}/{resolution}/{startDate}/{endDate}\n\n### Watchlists\n- POST /watchlists/ (Create watchlist)\n- GET /watchlists/{watchlistid}\n- DELETE /watchlists/{watchlistid} (Delete watchlist)\n\n- GET /watchlists (Get all watchlists)\n- PUT /watchlists/{watchlistid} (Add epic)\n- DELETE /watchlists/{watchlistid}/{epic} (Delete epic)\n\n### History\n\n- GET /history/activity\n- GET /history/transactions\n\n## Example\n\n```go\npackage main\n\nimport (\n\t    \"context\"\n        \"fmt\"\n        \"github.com/sklinkert/igmarkets\"\n        \"time\"\n)\n\nvar ig *igmarkets.IGMarkets\n\nfunc main() {\n\t    var ctx = context.Background()\n        ig = igmarkets.New(igmarkets.DemoAPIURL, \"APIKEY\", \"ACCOUNTID\", \"USERNAME/IDENTIFIER\", \"PASSWORD\")\n        if err := ig.Login(ctx); err != nil {\n                fmt.Println(\"Unable to login into IG account\", err)\n        }\n\n        // Get current open ask, open bid, close ask, close bid, high ask, high bid, low ask, and low bid\n        prices, _ := ig.GetPrice(ctx, \"CS.D.EURUSD.CFD.IP\")\n\n        fmt.Println(prices)\n\n        // Place a new order\n        order := igmarkets.OTCOrderRequest{\n                Epic:           \"CS.D.EURUSD.CFD.IP\",\n                OrderType:      \"MARKET\",\n                CurrencyCode:   \"USD\",\n                Direction:      \"BUY\",\n                Size:           1.0,\n                Expiry:         \"-\",\n                StopDistance:   \"10\", // Pips\n                LimitDistance:  \"5\",  // Pips\n                GuaranteedStop: true,\n                ForceOpen:      true,\n        }\n        dealRef, err := ig.PlaceOTCOrder(ctx, order)\n        if err != nil {\n                fmt.Println(\"Unable to place order:\", err)\n                return\n        }\n        fmt.Println(\"New order placed with dealRef\", dealRef)\n\n        // Check order status\n        confirmation, err := ig.GetDealConfirmation(ctx, dealRef.DealReference)\n        if err != nil {\n                fmt.Println(\"Cannot get deal confirmation for:\", dealRef, err)\n                return\n        }\n\n        fmt.Println(\"Order dealRef\", dealRef)\n        fmt.Println(\"DealStatus\", confirmation.DealStatus) // \"ACCEPTED\"\n        fmt.Println(\"Profit\", confirmation.Profit, confirmation.ProfitCurrency)\n        fmt.Println(\"Status\", confirmation.Status) // \"OPEN\"\n        fmt.Println(\"Reason\", confirmation.Reason)\n        fmt.Println(\"Level\", confirmation.Level) // Buy price\n\n        // List transactions\n        transactionResponse, err := ig.GetTransactions(ctx, \"ALL\", time.Now().AddDate(0, 0, -30).UTC()) // last 30 days\n        if err != nil {\n                fmt.Println(\"Unable to get transactions: \", err)\n        }\n        for _, transaction := range transactionResponse.Transactions {\n                fmt.Println(\"Found new transaction\")\n                fmt.Println(\"Epic:\", transaction.InstrumentName)\n                fmt.Println(\"Type:\", transaction.TransactionType)\n                fmt.Println(\"OpenDate:\", transaction.OpenDateUtc)\n                fmt.Println(\"CloseDate:\", transaction.DateUTC)\n                fmt.Println(\"OpenLevel:\", transaction.OpenLevel)\n                fmt.Println(\"CloseLevel:\", transaction.CloseLevel)\n                fmt.Println(\"Profit/Loss:\", transaction.ProfitAndLoss)\n\t}\n\n        // Example of getting client sentiment\n        sentiment, _ := ig.GetClientSentiment(ctx, \"F-US\") //Ford\n        fmt.Println(\"Sentiment example:\", sentiment)\n}\n```\n\nMore examples can be found [here](https://github.com/sklinkert/igmarkets/tree/master/examples).\n\n### LightStreamer API Subscription Example\n\n```go\n    var ctx = context.Background()\n\tfor {\n\t\ttickChan := make(chan igmarkets.LightStreamerTick)\n    err := igHandle.OpenLightStreamerSubscription(ctx, []string{\"CS.D.BITCOIN.CFD.IP\"}, tickChan)\n\t\tif err != nil {\n      log.WithError(err).Error(\"OpenLightStreamerSubscription() failed\")\n\t\t}\n\n\t\tfor tick := range tickChan {\n\t\t\tlog.Infof(\"tick: %+v\", tick)\n\t\t}\n\n\t\tlog.Infof(\"Server closed stream, restarting...\")\n  }\n```\n\nOutput:\n\n```\nINFO[0003] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:15 +0000 UTC Bid:18230.35 Ask:18266.35} \nINFO[0003] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:15 +0000 UTC Bid:18230.45 Ask:18266.45} \nINFO[0003] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:16 +0000 UTC Bid:18231.14 Ask:18267.14} \nINFO[0003] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:16 +0000 UTC Bid:18231.04 Ask:18267.04} \nINFO[0004] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:16 +0000 UTC Bid:18231.53 Ask:18267.53} \nINFO[0004] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:16 +0000 UTC Bid:18231.35 Ask:18267.35} \nINFO[0004] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:17 +0000 UTC Bid:18230.64 Ask:18266.64} \nINFO[0004] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:17 +0000 UTC Bid:18231.08 Ask:18267.08} \nINFO[0005] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:17 +0000 UTC Bid:18231.36 Ask:18267.36} \nINFO[0005] tick: {Epic:CS.D.BITCOIN.CFD.IP Time:2020-11-22 14:14:17 +0000 UTC Bid:18230.93 Ask:18266.93} \n```\n\n\n\n\n\n## TODOs\n\n- Write basic tests\n\nFeel free to send PRs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsklinkert%2Figmarkets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsklinkert%2Figmarkets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsklinkert%2Figmarkets/lists"}