-
-
Save anthonymorast/e2030b089661a041ba2c67e5d34b5abb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Document FMPCloudAPI::getStockQuote(const std::string& symbol) const | |
{ | |
std::vector<std::string> symbols { symbol }; | |
return getStockQuote(symbols); | |
} | |
Document FMPCloudAPI::getStockQuote(const std::vector<std::string>& symbols) const | |
{ | |
if(symbols.size() > 50) | |
throw FMPCloudAPIError("ERROR (getStockQuote(vector)): Too many symbols. The maximum number of symbols is 50."); | |
std::string url = _baseUrl + "v3/quote/" + _toCommaDelimited(symbols) + "?apikey=" + _apiKey; | |
return _getNoCache(url, "quote"); | |
} | |
Document FMPCloudAPI::getAvailableCrypto() | |
{ | |
std::string url = _baseUrl + "v3/symbol/available-cryptocurrencies?apikey=" + _apiKey; | |
return _returnFromAndUpdateCache(url, "available crypto", "available_crypto", LONG); | |
} | |
Document FMPCloudAPI::getCryptoPrices() const | |
{ | |
std::string url = _baseUrl + "v3/quotes/crypto?apikey=" + _apiKey; | |
return _getNoCache(url, "crypto_quotes"); | |
} | |
Document FMPCloudAPI::getAvailableForex() | |
{ | |
std::string url = _baseUrl + "v3/symbol/available-forex-currency-pairs?apikey=" + _apiKey; | |
return _returnFromAndUpdateCache(url, "available crypto", "available_crypto", LONG); | |
} | |
Document FMPCloudAPI::getAllForexPrices() const | |
{ | |
std::string url = _baseUrl + "v3/quotes/forex?apikey=" + _apiKey; | |
return _getNoCache(url, "forex_quotes_all"); | |
} | |
Document FMPCloudAPI::getAllForexTick() const | |
{ | |
std::string url = _baseUrl + "v3/fx?apikey=" + _apiKey; | |
return _getNoCache(url, "all_forex_ohlc"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment