# Update content via cronjob, fetch content from other site

**URL:** <https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631>\
**Category:** Questions\
**Tags:** v2\
**Created:** [September 27, 2017, 8:32am UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631 "2017-09-27T08:32:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benbesen](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@benbesen](https://forum.getkirby.com/u/benbesen)\
**Post date:** [September 27, 2017, 8:32am UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631/1 "2017-09-27T08:32:38Z")

</div>

Hi all,  
I was wondering if it’s possible to populate/update my kirby content via cronjob. I’m try this because I’m pulling content from bandsintown for multiple artists. To get all the content I need todo multiple api requests on page load which is not ideal. So my idea was todo this automatically on the server side and store all the data in kirby.

Any ideas or thoughts?  
Thanks  
Ben

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 27, 2017, 8:34am UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631/2 "2017-09-27T08:34:23Z")

</div>

Your cron job can call a script or you could call a [route URL](https://getkirby.com/docs/developer-guide/advanced/routing) that does the content updating.

---

<div class="post-metadata">

**Author:** ![benbesen](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@benbesen](https://forum.getkirby.com/u/benbesen)\
**Post date:** [September 27, 2017, 8:59am UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631/3 "2017-09-27T08:59:09Z")

</div>

Thanks for the quick reply!  
You mean call a script within the kirby installation or how would that work?  
Calling a route would make sense, but would the whole updating “code block” be in the config.php then?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 27, 2017, 9:09am UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631/4 "2017-09-27T09:09:07Z")

</div>

The best option is the route, as it allows you to use Kirby’s API.

The route does not have to contain the complete code, you can call a function in the action that does the heavy lifting. Routes can also live in a plugin file, the only difference is that you can’t use `c::set()` but `kirby()->set()`

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:32pm UTC](https://forum.getkirby.com/t/update-content-via-cronjob-fetch-content-from-other-site/8631/5 "2025-02-06T17:32:05Z")

</div>


