
function get_option_chain(ticker::AbstractString)
    kwargs = (; symbol = ticker, toDate="2022-01-01")

    uri = construct_api("marketdata/chains", kwargs)
    @show uri
    head = ["Authorization" => "Bearer "*AUTH_KEY.ACCESS_TOKEN]
    # Authorization is a header
    return @pipe HTTP.get(uri, head).body |>
                 JSON3.read  # |> _[Symbol(ticker)]

end

# GET OPTION CHAIN FOR TESLA TO END OF THE YEAR
#GET /v1/marketdata/chains?apikey=LNTJ7SD2D3UP4POVFACAOT608AROD38K&symbol=TSLA&toDate=2022-01-01 HTTP/1.1
# Accept:
# */*
# Accept-Encoding:
# gzip
# Accept-Language:
# en-US
# Authorization:
# Bearer ByvEO4hay1hC..............
# Host:
# api.tdameritrade.com
# NS-Proxy-Client-IP:
# 67.168.170.195
# sec-ch-ua:
# Chromium";v="88
# sec-ch-ua-mobile:
# ?0
# Sec-Fetch-Dest:
# empty
# Sec-Fetch-Mode:
# cors
# Sec-Fetch-Site:
# same-site
# User-Agent:
# Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML
# X-Forwarded-For:
# 10.152.4.23
# X-Forwarded-Port:
# 59002
# X-Forwarded-Proto:
# http





#RESPONSE
# HTTP/1.1 200 OK
# Access-Control-Allow-Headers:
# origin
# Access-Control-Allow-Methods:
# GET
# Access-Control-Allow-Origin:
# https://developer.tdameritrade.com
# Access-Control-Max-Age:
# 3628800
# Cache-Control:
# no-cache
# Connection:
# keep-alive
# Content-Encoding:
# gzip
# Content-Security-Policy:
# frame-ancestors 'self'
# Content-Type:
# application/json;charset=UTF-8
# Date:
# Thu, 25 Feb 2021 03:32:22 GMT
# Strict-Transport-Security:
# max-age=31536000; includeSubDomains
# Transfer-Encoding:
# chunked
# Vary:
# Accept-Encoding
# X-Application-Context:
# application:8080
# X-Content-Type-Options:
# nosniff
# X-Frame-Options:
# SAMEORIGIN
# X-Xss-Protection:
# 1; mode=block
# {
#   "symbol": "TSLA",
#   "status": "SUCCESS",
#   "underlying": null,
#   "strategy": "SINGLE",
#   "interval": 0,
#   "isDelayed": false,
#   "isIndex": false,
#   "interestRate": 0.1,
#   "underlyingPrice": 738.475,
#   "volatility": 29,
#   "daysToExpiration": 0,
#   "numberOfContracts": 4660,
#   "callExpDateMap": {
#     "2021-02-26:2": {
#       "200.0": [
#         {
#           "putCall": "CALL",
#           "symbol": "TSLA_022621C200",
#           "description": "TSLA Feb 26 2021 200 Call (Weekly)",
#           "exchangeName": "OPR",
#           "bid": 541.15,
