user5844: I just spent a few days trying to find a way to access account data from a smart contract using only plutus. Turns out IOG has yet to put that functionality in (at least that's how I understand it) but I no I can get info from the node and therefore from a service like blockfrost.
How do I get that data and have it update regularly until the contract validates?

user6763: You can't call API services directly from the smart contract, and this is not something that the "IOG has yet to put that functionality in";
the same behaviour is not possible in any other smart contract programming language for security reasons.
with that being said there are a few options you could use:
get the data from the off-chain (bad)
you could get the data from the Redeemer; so that the user is telling you the information you need.
this approach is bad because the user could send any redeemer to the script, and you have no way to check the information is true
as an example say you want to access the history of the past user transactions
the user can easily omit (or add) some transactions and you have no way to check that is true.
since ANYONE can write off-chain code to interact with the smart contract you cannot trust the input form the redeemer
Implement an Oracle
You could write a smart contract that keeps on a recognizable UTxO the data you need as Datum; then include that UTxO in the tx input of the smart contract you need the data for.
this way you access the data you need by reading any datum from the input.
now the trust is put only in the person that is able to update the oracle, and no longer in ANYONE in the world
the Plutus Pioneer Program, iteration #2, lesson 6 might help to have a better idea about Oracles

5844: <p>I just spent a few days trying to find a way to access account data from a smart contract using only plutus. Turns out IOG has yet to put that functionality in (at least that's how I understand it) but I no I can get info from the node and therefore from a service like blockfrost.</p>
<p>How do I get that data and have it update regularly until the contract validates?</p>
 6763: <p>You can't call API services directly from the smart contract, and this is not something that the &quot;IOG has yet to put that functionality in&quot;;</p>
<p>the same behaviour is not possible in any other smart contract programming language for security reasons.</p>
<p>with that being said there are a few options you could use:</p>
<h1>get the data from the off-chain (bad)</h1>
<p>you could get the data from the Redeemer; so that the user is telling you the information you need.</p>
<p>this approach is bad because the user could send any redeemer to the script, and you have no way to check the information is true</p>
<p>as an example say you want to access the history of the past user transactions</p>
<p>the user can easily omit (or add) some transactions and you have no way to check that is true.</p>
<p>since ANYONE can write off-chain code to interact with the smart contract you cannot trust the input form the redeemer</p>
<h1>Implement an Oracle</h1>
<p>You could write a smart contract that keeps on a recognizable UTxO the data you need as Datum; then include that UTxO in the tx input of the smart contract you need the data for.</p>
<p>this way you access the data you need by reading any datum from the input.</p>
<p>now the trust is put only in the person that is able to update the oracle, and no longer in ANYONE in the world</p>
<p>the <a href="https://www.youtube.com/watch?v=U7DCPLqolds&amp;list=PLNEK_Ejlx3x28gErogJ6iITWcvL3JdpQB&amp;index=2" rel="nofollow noreferrer">Plutus Pioneer Program, iteration #2, lesson 6</a> might help to have a better idea about Oracles</p>
