title: How to get the price history of forex in TDAmeritrade API such as EUR/USD?
body: <p>I use the TD Ameritrade API as documented on the <a href="https://developer.tdameritrade.com/price-history/apis/get/marketdata/%7Bsymbol%7D/pricehistory" rel="nofollow noreferrer">API documentation</a>.</p>
  
  <p>The URL to get the price history contains the symbol of the asset to fetch.</p>
  
  <p><a href="https://i.stack.imgur.com/OTR7M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OTR7M.png" alt="enter image description here"></a></p>
  
  <p>The documentation says:</p>
  
  <blockquote>
    <p>Replace the <code>{symbol}</code> in the URL with the actual symbol</p>
  </blockquote>
  
  <p>It works well with stock symbols like GOOG or AAPL or FB.</p>
  
  <p>For example for AAPL, the url would be: <a href="https://api.tdameritrade.com/vi/marketdata/AAPL/pricehistory" rel="nofollow noreferrer">https://api.tdameritrade.com/vi/marketdata/AAPL/pricehistory</a></p>
  
  <p>But with symbols that contain a backslash like the <code>EUR/USD</code> spot, it does not work because the backslash is considered as an additional path to the URL
  So I get URL not found with <a href="https://api.tdameritrade.com/vi/marketdata/EUR/USD/pricehistory" rel="nofollow noreferrer">https://api.tdameritrade.com/vi/marketdata/EUR/USD/pricehistory</a></p>
  
  <p>Same with <code>EUR/CAD</code>, <code>EUR/GBP</code>, and other forex spots.
  How to fetch forex spot?</p>