How to use Yahoo Finance API in C++?

  api, c++, libcurl, wininet, yahoo-finance

I want to create a connaction between my c++ programm and the Yahoo Finance API.
I have some few exp in c++ so pleace correct me if I am wrong in some points.
Is it possible to connact with any programming language to a API or is it depending from the API creater.
My thoughs how API’s work: I am sending a request to the API through a URL with a APIkey(for the authentication) and some parameter strings for additional info. And the respond from the API is then a string with my requested data.

On the Yahoo Finance Web there is a example exactly how i thought it should be but for python, that looks pretty simple:

import requests

url = "https://rest.yahoofinanceapi.com/v6/finance/quote"

querystring = {"symbols":"AAPL,BTC-USD,EURUSD=X"}

headers = {
    'x-api-key': "YOUR-PERSONAL-API-KEY"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

I was looking for that kind of requests.request() funktions in the wininet header and libcurl library. I found some funktions like InternetOpenUrl() that Open the URL but not more. Is there a funktion that does exactly the same things like the python version above? Or do guys know some Lib that can do that Job?

Source: Windows Questions C++

LEAVE A COMMENT