Where did you get the code from???
From the same company I got the API Key. While VERY POLITE, They basically said: Hey, you're lucky we provided you that (code), fix it yourself!
I thought it maybe came from ChatGPT
I'm under the impression that I'm downloading a stream and not a file. Albeit a very short one (all of 6 digits a dollar sign and a decimal). I may have my definitions wrong, but I think it supposed to be a stream because it changes all the time, I keep asking for the same information (What's the new price? What's the new price? What's the new price? What's the new price? What's the new price?) and it keeps sending the current price, as opposed to a file which is created (by them) and we download it once. Am I wrong about this?
You might want to take a step back.
DON'T try to load a string which you download directly into XMLDoc unless you are sure it is really XML data.
You haven't said anything about what service and how to use it.
For now, it's then best to just do a Showmessage(S) or Memo1.Lines.Text := S so you can see what's actually returned.
If you get the expected results... then you try to read it into XMLDoc.
Also show the relevant lines that produce those error.
The lines are posted in one of the replies above. But here they are again. All five errors. It's easy enough to list them again. Just hope the mods don't scold me for reposting the same stuff.
I didn't see anything about "Caption" there in those lines ?????
Next you do something like: XMLDoc.DocumentElement.ChildNodes[1].ChildNodes[2].ChildNodes[2]
Even in Delphi this would be bad programming because you don't know if the children are there (and how many).
So you could end up trying to access .Text from a NULL pointer.
It's best, when dealing with an XML, to do this element by element.
And only if you are sure the element you get is the correct one (and not null), go a step further.
But... finally... about the IXMLDocument... I think you got examples for Delphi. FPC doesn't have IXMLDocument and implements a completly different XML reading component.
So you need to let go of those lines for reading the XML, read the tutorials, and reprogram everything in your code relating to XML because the TDOMNode in FPC/laz2_DOM doesn't have .text as property, that's only in IXMLNode.
It does have TDOMNode.TextContent but you better read the tutorials first.
(for example section
https://wiki.lazarus.freepascal.org/XML_Tutorial#Reading_a_text_node).