{"id":18005635,"url":"https://github.com/areed1192/tradestation-python-api","last_synced_at":"2025-03-26T10:32:13.823Z","repository":{"id":48808769,"uuid":"271405662","full_name":"areed1192/tradestation-python-api","owner":"areed1192","description":"A Python Client library for the TradeStation API.","archived":false,"fork":false,"pushed_at":"2021-07-10T21:46:54.000Z","size":16,"stargazers_count":107,"open_issues_count":11,"forks_count":57,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-21T15:42:28.341Z","etag":null,"topics":["api","finance","python","tradestation","tradestation-api","trading"],"latest_commit_sha":null,"homepage":"","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/areed1192.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}},"created_at":"2020-06-10T23:23:00.000Z","updated_at":"2025-02-20T19:30:56.000Z","dependencies_parsed_at":"2022-09-15T06:05:35.862Z","dependency_job_id":null,"html_url":"https://github.com/areed1192/tradestation-python-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftradestation-python-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftradestation-python-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftradestation-python-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Ftradestation-python-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areed1192","download_url":"https://codeload.github.com/areed1192/tradestation-python-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245637227,"owners_count":20648112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","finance","python","tradestation","tradestation-api","trading"],"created_at":"2024-10-30T00:20:55.380Z","updated_at":"2025-03-26T10:32:13.489Z","avatar_url":"https://github.com/areed1192.png","language":"Python","funding_links":["https://www.patreon.com/sigmacoding"],"categories":[],"sub_categories":[],"readme":"# Tradestation Python API\n\nA Python Client library for the TradeStation API.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [What's in the API](#whats-in-the-api)\n- [Requirements](#requirements)\n- [API Key \u0026 Credentials](#api-key-and-credentials)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Features](#features)\n- [Documentation \u0026 Resources](#documentation-and-resources)\n- [Support These Projects](#support-these-projects)\n\n## Overview\n\nThe unofficial Python API client library for TradeStation allows individuals with TradeStation accounts to manage trades, pull historical and real-time data, manage their accounts, create and modify orders all using the Python programming language.\n\nTo learn more about the TradeStation API, please refer to the [official documentation](https://developer.tdameritrade.com/apis).\n\n## What's in the API\n\n- Authentication - access tokens, refresh tokens, request authentication.\n- Accounts \u0026 Trading\n- Symbols\n- Index\n- Orders\n- Paper Trading\n- Quotes\n- Transaction History\n\n## Requirements\n\nThe following requirements must be met to use this API:\n\n- A TradeStation account, you'll need your account password and account number to use the API.\n- A TradeStation Developer API Key\n- A Redirect URI, sometimes called Redirect URL\n- Python 3.8 or later.\n\n## API Key and Credentials\n\nEach TradeStation API request requires a TradeStation Developer API Key, a consumer ID, an account password, an account number, and a redirect URI. API Keys, consumer IDs, and redirect URIs are generated from the TradeStation developer portal. To set up and create your TradeStation developer account, please refer to the [official documentation](https://developer.tdameritrade.com/content/phase-1-authentication-update-xml-based-api).\n\nAdditionally, to authenticate yourself using this library, you will need to provide your account number and password for your main TradeStation account.\n\n**Important:** Your account number, an account password, consumer ID, and API key should be kept secret.\n\n## Installation\n\n```bash\npip install -e .\n```\n\n## Usage\n\nThis example demonstrates how to login to the API and demonstrates sending a request using the `quotes`, and `stream_bars_start_date` endpoint, using your API key.\n\n```python\n# Import the client\nfrom ts.client import TradeStationClient\n\n# Create the Client.\nts_client = TradeStationClient(\n    username=\"USERNAME\",\n    client_id=\"CLIENT_ID\",\n    client_secret=\"CLIENT_SECRET\",\n    redirect_uri=\"REDIRECT_URI\",\n    paper_trading=\"PAPER_TRADING\"\n)\n\n# Get quotes for Oil Futures.\nts_client.quotes(symbols=['@CL'])\n\n# Stream quotes for Amazon.\nts_client.stream_quotes_changes(symbols=['AMZN'])\n\n# Stream bars for a certain date.\nts_client.stream_bars_start_date(\n    symbol='AMZN',\n    interval=5,\n    unit='Minute',\n    start_date='02-25-2020',\n    session='USEQPreAndPost'\n)\n```\n\n## Features\n\n### Authentication Workflow Support\n\nAutomatically will handle the authentication workflow for new users, returning users, and users with expired tokens (refresh token or access token).\n\n### Request Validation\n\nFor certain requests, in a limited fashion, it will help validate your request when possible. For example, when using the `get_bars` endpoint, it will automatically validate that the market you're requesting data from is one of the valid options.\n\n## Documentation and Resources\n\n- [Overview](https://tradestation.github.io/api-docs/#section/Overview)\n- [Paper Trading](https://tradestation.github.io/api-docs/#section/Overview/SIM-vs-LIVE)\n- [Authentication](https://tradestation.github.io/api-docs/#section/Authentication)\n\n## Support these Projects\n\n**Patreon:**\nHelp support this project and future projects by donating to my [Patreon Page](https://www.patreon.com/sigmacoding). I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.\n\n**YouTube:**\nIf you'd like to watch more of my content, feel free to visit my YouTube channel [Sigma Coding](https://www.youtube.com/c/SigmaCoding).\n\n**Hire Me:**\nIf you have a project, you think I can help you with feel free to reach out at coding.sigma@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Ftradestation-python-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareed1192%2Ftradestation-python-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Ftradestation-python-api/lists"}