Skip to content
Menu

Keep products in sync

Send every change, run a full sync once a day, and what happens if your sync stops.

SeekGist searches the products you send it. When a product changes in your store, send the change, and once a day send everything. Then search always matches your shop, and products you removed do not stay in the results.

On OpenCart, WooCommerce or Magento? The SeekGist module does all of this for you: it sends a product when you save it, runs a cron job every 5 minutes, and does a full sync once a day. Just keep the module's cron job running. See the OpenCart, WooCommerce or Magento 2 guide.

The rest of this page is for stores that call the API from their own server.

1. Send every change

When a product is saved, when stock or a price changes, and when a product is deleted, call POST /v1/products/batch from your server with your secret key:

curl -X POST https://api.seekgist.com/v1/products/batch \
  -H "Authorization: Bearer $SEEKGIST_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: change-42-0001" \
  -d '{"upsert": [{"id": "42", "name": {"en": "Example Shirt"}, "price": "19.00", "currency": "USD"}], "delete": ["id-123"]}'
  • Up to 1,000 products per call (upsert and delete together).
  • Send an Idempotency-Key. If you retry the same call, the work is not done twice.
  • A product sent again with no change costs nothing and is not indexed again.

The example product is made up.

2. Run a full sync once a day

Once a day, a cron job sends all your products. Use the same sync_id on every batch of this sync. On the last batch, also send sync_complete: true and replace_all: true. SeekGist then removes the products you did not send in this sync.

{"upsert": [...], "sync_id": "nightly-run-118"}
{"upsert": [...], "sync_id": "nightly-run-118", "sync_complete": true, "replace_all": true}

If a sync sends no products at all, nothing is removed.

Example crontab line (every day at 03:00):

0 3 * * *  php /path/to/seekgist-full-sync.php

The same with Node.js or Python:

0 3 * * *  node /path/to/seekgist-full-sync.mjs
0 3 * * *  python3 /path/to/seekgist_full_sync.py

3. If sending every change is hard

Some stores cannot call SeekGist each time a product is saved. Then run a second cron job every 5 to 15 minutes that sends the products changed since its last run, and keep the daily full sync:

*/10 * * * *  php /path/to/seekgist-send-changes.php
0 3 * * *     php /path/to/seekgist-full-sync.php

Use an SDK

The SDKs split your products into batches of up to 1,000, send an Idempotency-Key with each batch and retry on errors. A full sync is one call:

LanguageInstallFull sync
JavaScript / Node.jsnpm install @seekgist/sdkclient.upsertProducts(products, { replaceAll: true })
Pythonpip install seekgistclient.upsert_products(products, replace_all=True)
PHPcomposer require seekgist/seekgist-php$client->upsertProducts($products, ['replace_all' => true])

With replace_all, the SDK sends the sync_id on every batch and sync_complete with replace_all on the last one. See the JavaScript, Python and PHP pages.

If your sync stops

If your store did a full sync and then nothing arrives for more than 26 hours, we email the store owners and show a warning on every dashboard page. The usual cause is a cron job that stopped, or a module that was turned off or has new keys.

What to check:

  1. On a module store: open the SeekGist module page in your store admin and press Test connection.
  2. Check that your cron job runs (for example crontab -l on your server, or your host's cron page).
  3. On a custom store: check the job that calls POST /v1/products/batch, and its logs.

The Catalog page of the dashboard shows the time of the last automatic sync and the last full sync. Stores that only upload files in the dashboard are not checked.