"Using an existing API" implies that there are a lot of specifics that you aren't sharing that would help in answering your question.
A general answer:
Look at everything in the p5.js reference under IO > Input. You can periodically trigger any of the to inject add / replace data in your sketch. Lots of options.
Answers
"Using an existing API" implies that there are a lot of specifics that you aren't sharing that would help in answering your question.
A general answer:
Look at everything in the p5.js reference under IO > Input. You can periodically trigger any of the to inject add / replace data in your sketch. Lots of options.
https://p5js.org/reference/#group-IO
You can stream earthquake data, space station data (its position 4 example), weather data, twitter, flicker, etc.
Do you want to generate your own data?
Kf