Skip to main content
cURL
Cost: 1 API credit per live read.
Needs the seller’s Chrome open somewhere, with the Alura extension and signed in to Etsy for this shop. The script or agent can run on another computer. An offline extension answers extension_offline; the live status can name a more specific connection problem. Errors cost no API credits. See Chrome extension.
Needs the ads:read scope and the Etsy Ads workspace permission. The preview is kept 30 minutes (expires_at), and Get optimizer run reads it. To carry it out, use Apply optimizer run.

Choose what to plan

The strategy is overrides.strategy, else the saved optimizer settings, else the default. basis says which one ran. A strategy that judges listings against break-even needs the shop’s margin, saved or sent as overrides.margin_pct. Without it the answer is 422 margin_required. break_even_roas comes from that margin and Etsy’s fees for the shop’s country.

Large shops take several requests

One request makes at most 27 live reads (pages, stats and search terms), because a shop has 30 live Etsy reads a minute. While more is left:
  1. The answer is status: scanning, with scan (how far it got) and continuation.
  2. Wait scan.retry_after_s, then send {"continuation": "..."} alone.
  3. Repeat until the same id answers status: preview, with the plan of the whole shop.
Continue a scan

What gets planned

The shop’s advertised listings are read live from Etsy, highest spend first, until no remaining listing can match or 60 pages of 50 are read (3000 listings, as Alura’s Etsy Ads page reads). Past that, coverage.complete is false with scan_truncated. The highest-spend listings come first, and capped says when more matched.

Read the plan

projected_monthly_spend_freed is the paused listings’ spend as 30 days: spend freed, not guaranteed cash saved.
Spend Etsy didn’t report is never added as 0. It is counted in spend_unknown_count, and above 0 the amount is a lower bound. Listings with a number or protection Alura couldn’t read are counted in coverage.unjudgeable, never judged as zero.

Search terms

With target: search_terms, Alura reads the search terms of at most 150 advertised listings (coverage.search_terms), each over Etsy’s last 31 days (period). More than 150 sets coverage.complete: false with scan_truncated. Terms already off count in already_off. A plan holds at most 7 terms by default, which is what one apply sends.

Limits

429 live_rate_limited means the shop had too many live reads: more than 2 at a time or 30 a minute. Wait for Retry-After. Each page, the campaign’s stats and each listing’s search terms is one live read, up to 27 a request. A request that could not read Etsy is free. See Credits and limits.

Authorizations

Authorization
string
header
required

An API key: Authorization: Bearer alura_sk_....

Body

application/json
continuation
string

A scanning preview's continuation: reads more of its shop, then plans. Sent alone.

Required string length: 1 - 80
Pattern: ^[A-Za-z0-9_-]{1,80}$
shop_id
string

The Etsy shop ID of one of the workspace's connected shops; optional when the workspace has one. A shop outside the workspace is 404.

Pattern: ^[0-9]{1,20}$
target
enum<string>

What to optimize: listings (pause or lower the click cost of advertised listings) or search_terms (turn a search term off for one listing, Etsy's per-listing "irrelevant" toggle: the search-terms strategy of the settings, else Keyword Saver). Required unless continuation is sent.

Available options:
listings,
search_terms
listing_ids
string[]

Plan only for these listings (at most 100); the whole shop is still scanned, and coverage.listing_ids_not_scanned names any the scan did not reach (for search_terms: any whose terms were not read).

Required array length: 1 - 100 elements
Pattern: ^[0-9]{1,20}$
period
enum<string>

The stats period the rules judge: last_30_days, last_3_months, last_12_months or all_time (Etsy's last 730 days, as Alura's Etsy Ads page). Default: the strategy's own period.

Available options:
last_30_days,
last_3_months,
last_12_months,
all_time
overrides
object

Response

OK

object
string
required
Allowed value: "workspace.ads_optimize_run"
id
string
required

The run ID: GET /v1/workspace/ads/optimize/runs/{id} reads it while it is kept.

status
string
required

preview: planned only; nothing was changed on Etsy.

Allowed value: "preview"
shop_id
string
required
target
enum<string>
required
Available options:
listings,
search_terms
created_at
string
required

ISO 8601, UTC.

expires_at
string
required

When the preview is dropped: after it, its GET is 410 optimize_run_expired.

basis
enum<string>
required

Where the strategy came from: explicit (overrides.strategy), saved (the optimizer settings), default (Budget Saver, or Keyword Saver for search terms: no settings saved).

Available options:
explicit,
saved,
default
strategy
object
required

The strategy the plan used (the shape of a strategy in the optimizer settings), with the run's period and action cap.

period
object
required

The days judged, on Etsy's calendar (US Eastern); for search terms, the window their numbers cover (Etsy's rolling last 31 days and today).

margin_pct
number | null
required

The shop margin the plan used; null when none is saved or given.

break_even_roas
number | null
required

The shop margin's break-even ROAS: below it, ads lose money at this margin. A floor: a listing's own can be higher. null without a margin, when it is unknown, or when no ROAS breaks even at this margin.

actions
object[]
required

The planned changes, highest spend first.

held_back
object[]
required

What the rules matched but a guardrail held back (codes of kind guardrail, except run_cap: capped_count counts those), highest spend first, at most 20 (the held_back notice counts them all). Nothing here is changed by an apply; a seller who wants them acted on changes the strategy's guardrails.

capped
boolean
required

true when more listings matched than the action cap: the highest-spend ones were kept.

max_actions_capped
boolean
required

true when the strategy's own action cap (or the default) was above what one apply sends (120 listings, 7 search terms), so this preview planned at most that; send overrides.max_actions to plan more (preview only: an apply sends no more). The saved settings are unchanged.

capped_count
integer
required

Listings (or search terms) that matched beyond the cap (0 when not capped).

projected_monthly_spend_freed
object | null
required

The paused listings' (or turned-off terms') spend over the period, as 30 days: ad spend freed, not guaranteed cash saved (the daily budget is shared, so Etsy may spend it on other listings). Only spend Etsy reported is added: with spend_unknown_count above 0 this is a lower bound (at least this much). In US dollars (Etsy Ads money for every shop); null when it is unknown.

spend_unknown_count
integer
required

Paused listings whose spend Etsy didn't report: left out of projected_monthly_spend_freed, never added as 0, so above 0 that amount is "at least".

coverage
object
required
notices
object[]
required
plan_hash
string
required

The plan's hash (its actions and everything they were decided on). Send it with the apply (plan_hash): the apply is refused, nothing sent, unless it is still this plan.

fetched_at
string | null
required

When Alura read the scan from Etsy; null when nothing was read.

source
string
required
Allowed value: "live"