Skip to content

Instantly share code, notes, and snippets.

View chrischattin's full-sized avatar
💪
Pumped

Chris Chattin chrischattin

💪
Pumped
View GitHub Profile
@chrischattin
chrischattin / tradestation_headless_auth.py
Last active March 18, 2019 18:15
Get an `access code` without running a webserver or interacting with a browser. Makes interacting with the Web API remotely more convenient.
import requests
import json
from urllib.parse import unquote
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
API_KEY = '*******' # Also called the `client_id`
SECRET_KEY = '*******'
REDIRECT_URI = 'http://localhost:8080' # Arbitrary for headless.
BASE_URL = 'https://sim-api.tradestation.com/v2'