Real-time data is not updated in webclient.
I want to know how to update api data in real time at the desired time.
Does the server require authentication? Does it return any error?
Are you fetching the data through the DAT output or via the python callback?
First of all, thank you for responding to the content.
This is my first time using webclient.
Only the api address was applied to the address.
The authentication you mentioned is not set.
I want to change the weather information as soon as it is updated using real-time API.
Which API call are you using here?
Some have time constraints on number of requests, and from what I can tell most require you to send a new request for new data, ie. they’re not streaming the weather data to you. So if you want more data you need to explicitly pulse request again.
It looks like it does authentication through its own API key, so no need for the parameter on the Web Client DAT’s authentication page. Do you have the API key included in your URL query parameters in the form appid={api_key}
?
Thank you for viewing again.
I used the following api. I received apikey and applied it. It was not automatically updated, so I updated it by clicking the webclient request from time to time. But this part was inconvenient. It would be nice if it automatically updates, but I don’t know how.
https://api.openweathermap.org/data/2.5/weather?q=London&appid=[{API key}]
You can use a Timer CHOP along with its python callbacks to automatically send a new request every N seconds. N can be specified using the length parameter. Cycle should be enabled and cycle limit disabled. Then the Web Client DAT’s request parameter can be pulsed in the onStart and onCycle callbacks. See toe file for example of sending a new request every 30 seconds.
webclient_periodic_request.toe (4.8 KB)
Alternatively, instead of pulsing the request parameter and having it use the DAT’s parameters, you can use the Web Client DAT’s python request method and supply all the arguments there. The main benefit of this is added flexibility and ease of use changing arguments or adding URL query parameters, for example.
Thank you for your thoughtful reply.
I’ll check again with what you’ve put together.