{"id":34048201,"url":"https://github.com/vilhelmhilding/igapy","last_synced_at":"2026-03-17T16:36:05.876Z","repository":{"id":301748550,"uuid":"1010210642","full_name":"vilhelmhilding/igapy","owner":"vilhelmhilding","description":"A modern, fully featured Python wrapper for IG’s REST and streaming trading APIs – built for quant developers and algo traders. Includes CLI, full test coverage, and production-ready design.","archived":false,"fork":false,"pushed_at":"2025-06-28T16:04:37.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T06:27:45.424Z","etag":null,"topics":["algorithmic-trading","api-wrapper","ig-markets","market-data","quantitative-finance","trading","trading-api"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/igapy/","language":"Python","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/vilhelmhilding.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,"zenodo":null}},"created_at":"2025-06-28T15:32:59.000Z","updated_at":"2025-06-30T09:14:31.000Z","dependencies_parsed_at":"2025-06-28T16:06:57.003Z","dependency_job_id":"cfdc5a75-d8d5-438d-b455-cbfad7acbc8c","html_url":"https://github.com/vilhelmhilding/igapy","commit_stats":null,"previous_names":["vilhelmhilding/igapy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vilhelmhilding/igapy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilhelmhilding%2Figapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilhelmhilding%2Figapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilhelmhilding%2Figapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilhelmhilding%2Figapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vilhelmhilding","download_url":"https://codeload.github.com/vilhelmhilding/igapy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilhelmhilding%2Figapy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30627199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: 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":["algorithmic-trading","api-wrapper","ig-markets","market-data","quantitative-finance","trading","trading-api"],"created_at":"2025-12-14T00:01:52.596Z","updated_at":"2026-03-17T16:36:05.867Z","avatar_url":"https://github.com/vilhelmhilding.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# igapy – IG API Wrapper\n\n\u003c!-- [![Downloads](https://static.pepy.tech/badge/igapy)](https://pepy.tech/project/igapy) --\u003e\n[![PyPI version](https://img.shields.io/pypi/v/igapy.svg)](https://pypi.org/project/igapy)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Python versions](https://img.shields.io/pypi/pyversions/igapy.svg)](https://pypi.org/project/igapy)\n[![CI](https://github.com/vilhelmhilding/igapy/actions/workflows/python-ci.yml/badge.svg)](https://github.com/vilhelmhilding/igapy/actions)\n[![codecov](https://codecov.io/gh/vilhelmhilding/igapy/branch/main/graph/badge.svg)](https://codecov.io/gh/vilhelmhilding/igapy)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA complete, modern, production-ready Python wrapper for the IG REST and streaming API.\n\n---\n\n## Why igapy?\n\n**igapy** is an unofficial, open source Python client for IG's REST and streaming API. It is designed for quant developers, algo traders, and anyone who wants a robust, well-documented and production-ready interface to IG's trading platform. The project aims to be a reference implementation for clean API wrappers in Python.\n\n- 100% endpoint coverage (REST \u0026 streaming)\n- Modern, type-annotated, PEP8/Black-formatted codebase\n- CLI for all public API endpoints\n- Full test suite and CI/CD\n- No unnecessary complexity – easy to read, extend, and audit\n\n---\n\n## Features\n\n- Full REST API coverage (session, accounts, markets, orders, prices, watchlists, sentiment, history, costs, operations)\n- WebSocket streaming client with reconnect, ping, custom subscription management\n- Authentication (session management, token handling, account switching, encryption keys)\n- Market data retrieval (search, details, bulk, navigation)\n- Order management (positions, working orders, confirmations)\n- Client sentiment access (single, related, batch)\n- Historical prices (multiple date/resolution variants)\n- Account preferences management\n- Watchlist management (create, modify, delete, add/remove markets)\n- Command-line interface (CLI)\n- GitHub Actions CI workflow\n- Unit tests with pytest (90 tests, 100% coverage)\n- PEP8-compliant, Black-formatted codebase\n\n---\n\n## Quickstart\n\n### Install\n\n```bash\npip install igapy\n```\n\n### Python Example\n\n```python\nfrom igapy import IGClient, Accounts, Markets\n\nclient = IGClient(\n    api_key=\"YOUR_API_KEY\",\n    username=\"YOUR_USERNAME\",\n    password=\"YOUR_PASSWORD\",\n    is_demo=True\n)\nclient.login()\n\naccounts = Accounts(client).list_accounts()\nprint(accounts)\n\n# Search for Apple stock (AAPL)\napple_search = Markets(client).search_markets(\"APPLE\")\nprint(apple_search)\n\n# Get details for the first Apple market found (if any)\nif apple_search and apple_search[\"markets\"]:\n    apple_epic = apple_search[\"markets\"][0][\"epic\"]\n    apple_details = Markets(client).get_market_details(apple_epic)\n    print(apple_details)\n```\n\n### CLI Example\n\n```bash\n# List accounts\nigapy accounts list --api-key KEY --username USER --password PASS --demo\n\n# Get market details\nigapy markets get-details --api-key KEY --username USER --password PASS --demo --epic IX.D.FTSE.DAILY.IP\n\n# Create order\nigapy orders create --api-key KEY --username USER --password PASS --demo --order '{\"epic\":\"IX.D.FTSE.DAILY.IP\",\"expiry\":\"DFB\",\"direction\":\"BUY\",\"size\":1,\"orderType\":\"MARKET\",\"currencyCode\":\"GBP\"}'\n\n# Get prices\nigapy prices get --api-key KEY --username USER --password PASS --demo --epic IX.D.FTSE.DAILY.IP\n\n# Get transactions for type and period\nigapy history transactions-period --api-key KEY --username USER --password PASS --demo --transaction-type ALL --last-period MONTH\n\n# Get cost history\nigapy costs history --api-key KEY --username USER --password PASS --demo --from-date 2024-01-01 --to-date 2024-06-01\n```\n\n### Streaming Example\n\n```python\nfrom igapy import IGClient, IGStreamingClient\nimport time\n\nclient = IGClient(\n    api_key=\"YOUR_API_KEY\",\n    username=\"YOUR_USERNAME\",\n    password=\"YOUR_PASSWORD\",\n    is_demo=False\n)\nclient.login()\n\ndef on_chart_tick(data):\n    print(\"Chart tick update:\", data)\n\n# IGStreamingClient supports automatic reconnect and re-subscription on connection loss.\n# You can control this with the 'reconnect' and 'reconnect_delay' parameters.\nstream = IGStreamingClient(client, reconnect=True, reconnect_delay=5)\nstream.start()\nstream.subscribe_chart_tick(\n    epic = \"CS.D.BITCOIN.CFD.IP\",\n    fields=[\"BID\", \"OFR\", \"UTM\"],\n    callback=on_chart_tick\n)\n\ntry:\n    while True:\n        time.sleep(1)\nexcept KeyboardInterrupt:\n    print(\"Stopping streaming...\")\n    stream.stop()\n```\n\n---\n\n## API Documentation\n\n- [IG REST API Reference](https://labs.ig.com/rest-trading-api-reference.html)\n\n---\n\n## Development \u0026 Contribution\n\n- Clone repo, create a virtualenv, install with `pip install -e .[dev]`\n- Run tests: `pytest`\n- Lint: `flake8 src/igapy tests`\n- Format: `black src/igapy tests`\n\nPull requests and issues are welcome!\n\n---\n\n## Project Structure\n\n```\n.\n├── LICENSE\n├── pyproject.toml\n├── MANIFEST.in\n├── README.md\n├── .gitignore\n├── .github/\n│   └── workflows/\n│       └── python-ci.yml\n├── src/\n│   └── igapy/\n│       ├── __init__.py\n│       ├── cli.py\n│       ├── client.py\n│       ├── session.py\n│       ├── accounts.py\n│       ├── markets.py\n│       ├── prices.py\n│       ├── orders.py\n│       ├── sentiment.py\n│       ├── history.py\n│       ├── repeat.py\n│       ├── watchlists.py\n│       ├── costs.py\n│       ├── operations.py\n│       ├── streaming.py\n│       ├── exceptions.py\n│       └── utils.py\n└── tests/\n    ├── conftest.py\n    ├── test_accounts.py\n    ├── test_cli.py\n    ├── test_client.py\n    ├── test_costs.py\n    ├── test_exceptions.py\n    ├── test_history.py\n    ├── test_markets.py\n    ├── test_operations.py\n    ├── test_orders.py\n    ├── test_prices.py\n    ├── test_repeat.py\n    ├── test_sentiment.py\n    ├── test_session.py\n    ├── test_streaming.py\n    ├── test_utils.py\n    └── test_watchlists.py\n```\n\n---\n\n## Code Style\n\n- PEP8 via flake8\n- Black formatting\n- Type annotations and docstrings for all public classes/methods\n\n---\n\n## Continuous Integration\n\n- GitHub Actions: `.github/workflows/python-ci.yml`\n- Coverage via pytest-cov\n\n---\n\n## License\n\nMIT License – see [LICENSE](LICENSE) file for details.\n\n---\n\n## Contact\n\nhi@vilhelmhilding.com\n\n---\n\n*This project is not affiliated with or endorsed by IG Group. Use at your own risk.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilhelmhilding%2Figapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvilhelmhilding%2Figapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilhelmhilding%2Figapy/lists"}