WooCommerce Store API — Authentication — FetchLayer Docs
Documentation menu
FetchLayer FetchLayer API

Authentication

All requests use your FetchLayer API key as a Bearer token. Nothing is required from the store you are reading — no WooCommerce consumer key or consumer secret, no WordPress login, no plugin. Only what a storefront already publishes is read.

Sending requests

bash
curl -X POST https://api.fetchlayer.dev/woocommerce-stores/products \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"store":"example-shop.com","limit":30}'

Keep your key secret

Only use API keys in server-side code and rotate a key immediately if it is exposed.

Downloading product images

The image download endpoint is a GET, and carries the same Bearer header. Because the key travels in a header rather than the URL, a download URL cannot be shared without also sharing the key. Use the downloadUrl on an image verbatim — it already carries both the store and the url, and an image URL that does not belong to that store is rejected.

bash
curl -X GET "https://api.fetchlayer.dev/woocommerce-stores/media?store=example-shop.com&url=https%3A%2F%2Fexample-shop.com%2Fwp-content%2Fuploads%2Fcoastal-rain-shell.jpg" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Range: bytes=0-65535" \
  --output coastal-rain-shell.jpg

Authentication errors

A missing or invalid key returns HTTP 401.

json
{
  "error": "Invalid API key"
}