Safely read and change a FreshStore affiliate site through its Site API, covering products, articles, redirects, click analytics and product feeds.
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Every FreshStore site has its own REST API at https://{site-domain}/api. Use this skill when the user asks you to work on their FreshStore site: add or edit products, write or schedule articles, fix redirects, read click analytics, or connect a product feed.
No FreshStore site yet? Start one at https://www.freshstore.com/?utm_source=skills.sh&utm_medium=listing
Full endpoint reference: https://guides.freshstore.com/article/729-freshstore-api OpenAPI 3.1 file (machine-readable): https://www.freshstore.com/developers/openapi
FRESHSTORE_SITE_URL: the site's own address, for example https://example.com (no trailing slash, no /api).FRESHSTORE_API_KEY: a key made in that site's admin. See references/setup.md.fsapi() {
local method="$1" route="$2"; shift 2
curl -sS -X "$method" "$FRESHSTORE_SITE_URL/api$route" \
-H "Authorization: Bearer $FRESHSTORE_API_KEY" \
-H "User-Agent: FreshStoreAgentSkill/1.0" \
-H "Content-Type: application/json" \
-w '\n[HTTP %{http_code}]\n' "$@"
}
fsapi GET /store/infoEvery call ends with its status line, for example [HTTP 200]. A 200 with the site name means you are connected. A 403 {"error":"Forbidden"} means the key is wrong, expired or for another site. An HTML 403 page means the request was blocked before it reached the site: check the User-Agent header.
Authorization: Bearer <key> and a named User-Agent (for example FreshStoreAgentSkill/1.0). Never send an empty or default library User-Agent.Content-Type: application/json. Responses are JSON, most wrapped in data.429, wait for the minute to roll over, then retry. In loops, pause about one second between calls.page and per_page (max 100). Follow links.next until it is null (redirects page by meta.total instead).503 with "reason": "installing" means the site is still being built. Wait for the Retry-After seconds.409 "upgrading, retry in a minute" is temporary: wait a minute and retry once. A 409 on a feed import means a run is already going: do not retry, wait for it.402 not_enough_chips means an AI call has no AI chips left. Stop and tell the user.GET the current record before any PATCH, and show the user what will change. Only send the fields that change."dry_run": false. Feed Preview writes nothing. Offer Health (GET /api/tools/offer-health) counts what Clean would delete. Run these first and show the result.POST /api/store/clean (Clean deletes),max_products over 20 counts), or any bulk redirect call,revenue and value are the price of the products clicked, not commission or confirmed sales. Say so when you report them.price_hidden: true must not have its price published anywhere.| Job | Reference |
|---|---|
| Get a key, pick scopes, errors, pagination | references/setup.md |
| List, add and edit products and offers | references/products.md |
| Write, schedule and update articles | references/articles.md |
| Find and fix redirects, retire an old catalog | references/redirects.md |
| Read click analytics | references/analytics.md |
| Connect and run a product feed | references/feeds.md |
For anything not covered here (pages and sections, design, settings, brands, categories, users), read the full reference at https://guides.freshstore.com/article/729-freshstore-api, or the OpenAPI file at https://www.freshstore.com/developers/openapi, before you call it.
GET /api/images/stock?query=... finds free stock photos.repository in the plugin manifest, or publish from a GitHub Action to verify it.