Title: Update results when API data changes
Last modified: October 16, 2019

---

# Update results when API data changes

 *  Resolved [siamsa](https://wordpress.org/support/users/siamsa/)
 * (@siamsa)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/)
 * Is there any way to update or refresh the displayed data when the information
   in the endpoint changes? My use case is an online radio station displaying the
   currently playing track. I’m trying to update the artist/track information displayed
   on the website when the track changes in the audio stream.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fupdate-results-when-api-data-changes%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12041633)
 * Hi,
    try `[jsoncontentimporter url=https://cast02.siamsa.ie/public/radio_siamsa/
   api/live/nowplaying/radio_siamsa basenode=now_playing.song] {text}<img src={art}
   > [/jsoncontentimporter]`
 * Every time the wordpress-page is called (unless it is cached by a caching-plugin)
   the shortcode is executed, the URL retrieved and the info displayed.
 * Bernhard
 *  Thread Starter [siamsa](https://wordpress.org/support/users/siamsa/)
 * (@siamsa)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12042455)
 * Thanks for that Bernhard. This will certainly retrieve the data once the url 
   is retrieved.
 * However, in my scenario, the user leaves the page open to listen to an audio 
   stream. The endpoint data changes about every 3 minutes as the audio track changes.
   But the data displayed by the jsoncontentimporter template doesn’t update to 
   reflect the changed track data – it keeps the same data as when the url was initially
   retrieved.
 * Is there any way to poll the endpoint and update the displayed data when a change
   is detected?
 * I came across your other plugin “Auto Refresh API Ajax”, but I’m not sure that
   the two plugins integrate, or how they can be integrated.
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12044313)
 * see
    [http://api.json-content-importer.com/display-current-song-via-auto-refresh-api-ajax/](http://api.json-content-importer.com/display-current-song-via-auto-refresh-api-ajax/)
   for that 😉
 *  Thread Starter [siamsa](https://wordpress.org/support/users/siamsa/)
 * (@siamsa)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12047025)
 * Thanks again Bernhard.
 * Further question – does this permit only 1 data field (eg, song title) to be 
   updated?
 * In my case, I need to update 4 data fields (song title, artist, album title and
   album artwork) each time the audio track changes.
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12047770)
 * Hi, switch to the support of this plugin, please:
    [https://wordpress.org/plugins/auto-refresh-api-ajax/](https://wordpress.org/plugins/auto-refresh-api-ajax/)
 * Bernhard
    -  This reply was modified 6 years, 7 months ago by [berkux](https://wordpress.org/support/users/berkux/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Update results when API data changes’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [berkux](https://wordpress.org/support/users/berkux/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/update-results-when-api-data-changes/#post-12047770)
 * Status: resolved