I am very new in json.
There is a working function looking similar to
function TAktienkurse_holen.vonPrep_HistoryAlsJson(Ticker: string; abDatum:TDate=0): TJSONData;
const
* my keys *
var HttpClient: TFPHTTPClient; // Europäische Daten gibt es nur mit "ultimo"
JsonResponse: TJSONData; // Abo und das kostet 99 im Monat
URL: string;
Response: string;
datum: TDate;
begin
result:=nil;
HttpClient := TFPHTTPClient.Create(nil); // The program uses TFPHTTPClient to send a GET request
URL:= Base_Url + 'historical-price-full/' + Ticker + API_KEY;
// die Umstellung der Zuweisungen führte dazu, dass es nicht mehr funktionierte
Response := HttpClient.Get(URL); // Send GET request to fetch stock quote
JsonResponse := GetJSON(Response); // The GetJSON function parses the JSON response.
Result := JsonResponse; // diese Kombination funktioniert, die "Vereinfachung" nicht!
HttpClient.Free;
end;
This takes the data from one url and writes all of them to my database.
Unfortunately it only has US data.
If anybody needs it,
BASE_URL = '
https://financialmodelingprep.com/api/v3/'; works fine.
Back to my topic.
I need European stocks as well and I asked Alpha Vantage for it. In "response" are exactly the data I want to have. Unfortunately the result of the function is empty. The data are lost in the line
JsonResponse := GetJSON(Response);
As my whole logic is built on the work-on with json ad this code-interface and converting it to my own format and writing it in loops to my database, - I would prefer to fix this very line. Otherwise I can start again.
How do I write this very line differently?
Why does it work with the other service and not here?