# Detect post insert & update

**URL:** <https://forum.ghost.org/t/detect-post-insert-update/8453>\
**Category:** Developer help\
**Created:** [July 29, 2019, 1:22pm UTC](https://forum.ghost.org/t/detect-post-insert-update/8453 "2019-07-29T13:22:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasilli](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vasilli](https://forum.ghost.org/u/vasilli)\
**Post date:** [July 29, 2019, 1:22pm UTC](https://forum.ghost.org/t/detect-post-insert-update/8453/1 "2019-07-29T13:22:11Z")

</div>

I use algolia as a search engine on my [site](https://noviello.it).

My goal is to automatically update the Algolia index without having to launch the script or having to use a cron.

Using GHOST APIs, is there a way to identify each post update or insert action?

This way, as soon as I identify an edit action I can start the server-side algolia script.

Thank you

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [July 29, 2019, 2:06pm UTC](https://forum.ghost.org/t/detect-post-insert-update/8453/2 "2019-07-29T14:06:20Z")

</div>

Hey @vasilli! I’ve found a couple of approaches you could try:

- There’s a project on GitHub that rebuilds every time a new post is published and hosts it on Netlify for Algolia to consume: [GitHub - mlbrgl/ghost-algolia: Provides integration between Ghost (CMS) and Algolia (Search as a Service)](https://github.com/mlbrgl/ghost-algolia)
- Also there’s a method of doing it with Zapier, using the Ghost API and webhooks [How to install Algolia for Ghost blogging platform - #8 by mlbrgl - Open Q&A - Algolia Community](https://discourse.algolia.com/t/how-to-install-algolia-for-ghost-blogging-platform/1201/8) (This might be better as there’s lest components to setup)

Hope this helps! Interested to see the results 👍

---

<div class="post-metadata">

**Author:** ![vasilli](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vasilli](https://forum.ghost.org/u/vasilli)\
**Post date:** [July 29, 2019, 11:50pm UTC](https://forum.ghost.org/t/detect-post-insert-update/8453/3 "2019-07-29T23:50:46Z")

</div>

> [@DavidDarnes](#):
>
> Also there’s a method of doing it with Zapier, using the Ghost API and webhooks [https://discourse.algolia.com/t/how-to-install-algolia-for-ghost-blogging-platform/1201/8](https://discourse.algolia.com/t/how-to-install-algolia-for-ghost-blogging-platform/1201/8) (This might be better as there’s lest components to setup)

Thanks a lot,  
I have just implemented this mechanism, really a nice method.  
With the insert it works perfectly.  
With the update I find some problems, it seems not to work, I have to do further tests.

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daviddarnes/32/3533_2.png) [@DavidDarnes](https://forum.ghost.org/u/DavidDarnes)\
**Post date:** [July 30, 2019, 10:14am UTC](https://forum.ghost.org/t/detect-post-insert-update/8453/4 "2019-07-30T10:14:57Z")

</div>

Pleased it’s working for you but keep us posted on your findings. I’m sure the Ghost community will appreciate it 🌈

---

<div class="post-metadata">

**Author:** ![vasilli](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vasilli](https://forum.ghost.org/u/vasilli)\
**Post date:** [July 30, 2019, 12:28pm UTC](https://forum.ghost.org/t/detect-post-insert-update/8453/5 "2019-07-30T12:28:17Z")

</div>

Of course, I briefly describe the steps to follow.

Once understood the mechanism is quite easy.

- create an account on [zapier](https://zapier.com/).
- from your zapier profile, connect with your **ghost blog** using the **zapier Admin API Key** found in **Integrations \> Zapier** from your ghost panel.
- accept the invitation from k`evin@algolia.com` to use the algolia with zapier [here](https://zapier.com/developer/invite/86446/a76609507dfbe1f6962f196544df438c/).
- follow the various steps to link your algolia account with the zapier account (previously connected with ghost).

It may be confusing to configure the app from the zapier panel, but after a few minutes you should be able to set everything up.

Really useful integration, but I still have to check the update if it works properly. With the insert there are no problems.

If you need more information just ask.
