# Tag that reads HTTP periodically

**URL:** <https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [February 23, 2024, 9:26pm UTC](https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296 "2024-02-23T21:26:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbg](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pbg](https://forum.inductiveautomation.com/u/pbg)\
**Post date:** [February 23, 2024, 9:26pm UTC](https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296/1 "2024-02-23T21:26:53Z")

</div>

Hi! I have API's and essentially want a tag version to represent a piece of data from each one. Lets say all my API's have a dint and I want to assign that dint to a tag every few seconds or so, which is easy enough to do in a script

```auto
url = "http://**/api/get_dint"
client = system.net.httpClient()
response = client.get(url)

```

but there's no such thing as a script tag and I wouldn't know how to get this info to a tag without using the change value or something along those lines and of course this isn't really possible using an expression as far as I know.

My goal is too just read from the API every few seconds or so, is there anyone who has had a similar situation and has an idea?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 23, 2024, 9:30pm UTC](https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296/2 "2024-02-23T21:30:43Z")

</div>

Put your HTTP calls into a timer script that writes the results into memory tags?

---

<div class="post-metadata">

**Author:** ![pbg](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pbg](https://forum.inductiveautomation.com/u/pbg)\
**Post date:** [February 23, 2024, 9:51pm UTC](https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296/3 "2024-02-23T21:51:03Z")

</div>

I thought of that but I thought it wouldn't be dynamic enough in terms of adding/removing API's (although its doable) but mostly if I wanted this tag to be part of UDT - that would also be difficult right

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 23, 2024, 10:10pm UTC](https://forum.inductiveautomation.com/t/tag-that-reads-http-periodically/86296/4 "2024-02-23T22:10:55Z")

</div>

Put your entire API call logic into the project script library (in your gateway scripting project). Use an expression tag with `runScript` to run your API call function and output the result to that tag, inside the UDT. Optionally, parameterize which function gets called in `runScript` via your UDT.
