{"id":30701210,"url":"https://github.com/binance/binance-fix-connector-python","last_synced_at":"2026-03-11T13:38:53.978Z","repository":{"id":292134387,"uuid":"953721241","full_name":"binance/binance-fix-connector-python","owner":"binance","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-02T12:10:11.000Z","size":57,"stargazers_count":9,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-03T01:41:37.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/binance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-24T00:59:04.000Z","updated_at":"2026-02-02T12:10:39.000Z","dependencies_parsed_at":"2025-05-08T10:43:42.205Z","dependency_job_id":"e4662192-c16e-4c39-a00a-d5de91f14be1","html_url":"https://github.com/binance/binance-fix-connector-python","commit_stats":null,"previous_names":["binance/binance-fix-connector-python"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/binance/binance-fix-connector-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-fix-connector-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-fix-connector-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-fix-connector-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-fix-connector-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binance","download_url":"https://codeload.github.com/binance/binance-fix-connector-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binance%2Fbinance-fix-connector-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"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":[],"created_at":"2025-09-02T13:16:33.879Z","updated_at":"2026-03-11T13:38:53.972Z","avatar_url":"https://github.com/binance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binance FIX API Connector in Python\n\nThis is a simple Python library that provides access to Binance Financial Information eXchange (FIX) [SPOT messages](https://github.com/binance/binance-spot-api-docs/blob/master/fix-api.md#message-components) using the FIX protocol. \nIt allows you to perform key operations such as placing orders, canceling orders, and querying current limit usage.\n\n## Prerequisites\n\nBefore using or testing the library, ensure that the necessary dependencies are installed. You can do this by running the following command:\n```\npip install binance-fix-connector\n```\n\n**Notes:**\n- FIX API only support Ed25519 keys. Please refer to this [tutorial](https://www.binance.com/en/support/faq/how-to-generate-an-ed25519-key-pair-to-send-api-requests-on-binance-6b9a63f1e3384cf48a2eedb82767a69a) for setting up an Ed25519 key pair on the mainnet, and this one for the [testnet](https://testnet.binance.vision/).\n- Ensure that your API key has the appropriate Fix API permissions for the Testnet environment before you begin testing.\n\n## Example\n\nAll the FIX messages can be created with the `BinanceFixConnector` class. The following example demonstrates how to create a simple order using the FIX API:\n```python\nimport time\n\nfrom binance_fix_connector.fix_connector import create_order_entry_session\nfrom binance_fix_connector.utils import get_api_key, get_private_key\nfrom constants import (\n    path,\n    FIX_OE_URL,\n    INSTRUMENT,\n    ORD_REJECT_REASON,\n    ORD_STATUS,\n    ORD_TYPES,\n    SIDES,\n    TIME_IN_FORCE,\n)\n\n# Credentials\nAPI_KEY, PATH_TO_PRIVATE_KEY_PEM_FILE = get_api_key(path)\n\nclient_oe = create_order_entry_session(\n    api_key=API_KEY,\n    private_key=get_private_key(PATH_TO_PRIVATE_KEY_PEM_FILE),\n    endpoint=FIX_OE_URL,\n)\nclient_oe.retrieve_messages_until(message_type=[\"A\"])\n\nexample = \"This example shows how to place a single order. Order type LIMIT.\\nCheck https://github.com/binance/binance-spot-api-docs/blob/master/fix-api.md#newordersingled for additional types.\"\nclient_oe.logger.info(example)\n\n# PLACING SIMPLE ORDER\nmsg = client_oe.create_fix_message_with_basic_header(\"D\")\nmsg.append_pair(38, 1)  # ORD QTY\nmsg.append_pair(40, 2)  # ORD TYPE\nmsg.append_pair(11, str(time.time_ns()))  # CL ORD ID\nmsg.append_pair(44, 730)  # PRICE\nmsg.append_pair(54, 2)  # SIDE\nmsg.append_pair(55, INSTRUMENT)  # SYMBOL\nmsg.append_pair(59, 1)  # TIME IN FORCE\nclient_oe.send_message(msg)\n\n\nresponses = client_oe.retrieve_messages_until(message_type=[\"8\"])\nresp = next(\n    (x for x in responses if x.message_type.decode(\"utf-8\") == \"8\"),\n    None,\n)\nclient_oe.logger.info(\"Parsing response Execution Report (8) for an order LIMIT type.\")\n\ncl_ord_id = None if not resp.get(11) else resp.get(11).decode(\"utf-8\")\norder_qty = None if not resp.get(38) else resp.get(38).decode(\"utf-8\")\nord_type = None if not resp.get(40) else resp.get(40).decode(\"utf-8\")\nside = None if not resp.get(54) else resp.get(54).decode(\"utf-8\")\nsymbol = None if not resp.get(55) else resp.get(55).decode(\"utf-8\")\nprice = None if not resp.get(44) else resp.get(44).decode(\"utf-8\")\ntime_in_force = None if not resp.get(59) else resp.get(59).decode(\"utf-8\")\ncum_qty = None if not resp.get(14) else resp.get(14).decode(\"utf-8\")\nlast_qty = None if not resp.get(32) else resp.get(32).decode(\"utf-8\")\nord_status = None if not resp.get(39) else resp.get(39).decode(\"utf-8\")\nord_rej_reason = None if not resp.get(103) else resp.get(103).decode(\"utf-8\")\nerror_code = None if not resp.get(25016) else resp.get(25016).decode(\"utf-8\")\ntext = None if not resp.get(58) else resp.get(58).decode(\"utf-8\")\n\n\nclient_oe.logger.info(f\"Client order ID: {cl_ord_id}\")\nclient_oe.logger.info(f\"Symbol: {symbol}\")\nclient_oe.logger.info(\n    f\"Order -\u003e Type: {ORD_TYPES.get(ord_type, ord_type)} | Side: {SIDES.get(side, side)} | TimeInForce: {TIME_IN_FORCE.get(time_in_force,time_in_force)}\",\n)\nclient_oe.logger.info(\n    f\"Price: {price} | Quantity: {order_qty} | cum qty: {cum_qty} | last qty: {last_qty}\"\n)\nclient_oe.logger.info(\n    f\"Status: {ORD_STATUS.get(ord_status,ord_status)} | Msg: {ORD_REJECT_REASON.get(ord_rej_reason,ord_rej_reason)}\",\n)\nclient_oe.logger.info(f\"Error code: {error_code} | Reason: {text}\")\n\n\n# LOGOUT\nclient_oe.logger.info(\"LOGOUT (5)\")\nclient_oe.logout()\nclient_oe.retrieve_messages_until(message_type=[\"5\"])\nclient_oe.logger.info(\n    \"Closing the connection with server as we already sent the logout message\"\n)\nclient_oe.disconnect()\n```\n\nPlease look at [`examples`](./examples) folder to test the examples.\nTo try the examples, follow the indications written on the [`examples/config.ini.example`](./examples/config.ini.example) file.\n\n## Documentation\n\nFor more information, have a look at the Binance documentation on [Fix API](https://developers.binance.com/docs/binance-spot-api-docs/fix-api).\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinance%2Fbinance-fix-connector-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinance%2Fbinance-fix-connector-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinance%2Fbinance-fix-connector-python/lists"}