Integration Patterns
Common API workflows with step-by-step examples for building integrations against the Simple Product Feeds API.
Pattern 1: Check all feeds’ latest status
Get a snapshot of every feed and its most recent run.
Step 1: List all feeds.
curl https://app.simpleproductfeeds.com/v1/feeds \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Step 2: For each feed, get the latest run.
curl https://app.simpleproductfeeds.com/v1/feeds/feed_1/runs/latest \
-H "Authorization: Bearer spf_live_sk_your_key_here"
The response includes status (completed or failed), completed_at, and has_output. A feed with no completed runs returns 404.
Pattern 2: Add a rule and regenerate
Add a transformation rule to a specific feed, then regenerate the feed without re-fetching from Shopify.
Step 1: Create the rule.
curl -X POST https://app.simpleproductfeeds.com/v1/feeds/feed_1/rules \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"rule": {"type": "set_value", "target": "brand", "value": "My Brand"}}'
Step 2: Trigger a regeneration (re-applies transformations to existing product data).
curl -X POST https://app.simpleproductfeeds.com/v1/extracts \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"type": "regenerate"}'
The regeneration runs asynchronously. Poll the extract or use webhooks to know when it completes.
Pattern 3: Monitor extract completion via polling
Trigger a full extract and poll until it completes, then check the latest run for a specific feed.
Step 1: Trigger the extract.
curl -X POST https://app.simpleproductfeeds.com/v1/extracts \
-H "Authorization: Bearer spf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"type": "full"}'
Save the id from the response (e.g., ext_568).
Step 2: Poll until complete.
curl https://app.simpleproductfeeds.com/v1/extracts/ext_568 \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Check the status field. Poll every 10-30 seconds until status is completed or failed.
| Status | Meaning |
|---|---|
pending | Queued, waiting to start. |
running | Fetching products from Shopify. |
completed | Done. All feeds have been regenerated. |
failed | Error occurred. Check error_details. |
Step 3: Get the latest run for your feed.
curl https://app.simpleproductfeeds.com/v1/feeds/feed_1/runs/latest \
-H "Authorization: Bearer spf_live_sk_your_key_here"
If status is completed and has_output is true, the feed file is ready at the feed’s URL.
Step 4 (optional): Download the feed output.
curl https://app.simpleproductfeeds.com/v1/feeds/feed_1/runs/latest/download \
-H "Authorization: Bearer spf_live_sk_your_key_here"
Returns a presigned S3 URL valid for 300 seconds.