> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alura.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Etsy Ads

> Get your shop's Etsy Ads campaign, read live from Etsy: whether it is running or paused, its bidding strategy and budget, and its results over a date range.

**Cost:** 1 API credit per live read.

> [!NOTE]
>
> 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`](https://docs.alura.io/errors/extension_offline); the [live status](https://docs.alura.io/api-reference/workspace/shops/live/get.md) can name a more specific connection problem. Errors cost no API credits. See [Chrome extension](https://docs.alura.io/api-reference/chrome-extension.md).

```bash
curl -G "https://api.alura.io/v1/workspace/ads" \
  -H "Authorization: Bearer $ALURA_API_KEY" \
  --data-urlencode "shop_id=22841907" \
  --data-urlencode "range=last_30" \
  --data-urlencode "expand=stats"
```

Needs the `ads:read` scope and the **Etsy Ads** workspace permission.

## What you get

| Field | What it says |
| - | - |
| `campaign` | `status` (`active` or `paused`), `strategy`, `daily_budget`, when it started (`created_at`) and when its strategy was last set (`strategy_updated_at`) |
| `advertised_listings` | How many listings the campaign advertises |
| `totals` | Impressions, clicks, click rate, spend, orders, revenue and ROAS over the range |

A shop that has never run Etsy Ads answers `campaign: null` with a `no_ads_campaign` notice, never a campaign of zeros.

## Choose the range

| You want | Use |
| - | - |
| Since the campaign started | `range=max` (the default) |
| The last 7, 30, 90 or 365 days | `range=last_7`, `last_30`, `last_90` or `last_365` |
| Exact days | `from` and `to`, both inclusive. `to` defaults to today. A `from` before the campaign started is moved to its start. |

`range` doesn't go with `from` or `to`: mixing them answers `400`. Days are Etsy's days, US Eastern for every shop. `range_applied` says what Etsy served: daily buckets up to 60 days, monthly beyond.

If Etsy fails on `range=max`, Alura retries once. If that fails too, the answer carries a `hint` to ask for `last_30`.

## Add more to the answer

`expand` takes a comma-separated list. Both options come within this call's charge.

| `expand=` | Adds |
| - | - |
| `stats` | The series, as [Get Etsy Ads stats](https://docs.alura.io/api-reference/workspace/ads/stats.md) gives it |
| `groups` | The shop's ad groups, as [List ad groups](https://docs.alura.io/api-reference/workspace/ads/groups/list.md) gives them. `null` with `ad_groups_not_enabled` for a shop Etsy has not turned them on for. |

`interval` and `compare` work as on [Get Etsy Ads stats](https://docs.alura.io/api-reference/workspace/ads/stats.md#get-daily-points-or-a-comparison).

## Limits

`429` [`live_rate_limited`](https://docs.alura.io/errors/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`.

With `interval=day`, each 60-day chunk Etsy answers is one live read. Reads that failed, and a call that could not read Etsy, are free. See [Credits and limits](https://docs.alura.io/api-reference/credits-and-limits.md).


## OpenAPI

````yaml /openapi.json get /v1/workspace/ads
openapi: 3.1.0
info:
  title: Alura API
  version: 1.0.0
  description: Etsy market research for scripts and AI assistants.
servers:
  - url: https://api.alura.io
security:
  - apiKey: []
paths:
  /v1/workspace/ads:
    get:
      summary: Get Etsy Ads
      description: >-
        Your shop's Etsy Ads campaign, read live from Etsy: whether it is
        running or paused, its bidding strategy, its daily budget, when it
        started and when its strategy was last set, how many listings it
        advertises, and its totals (impressions, clicks, click rate, spend,
        orders, revenue, ROAS) over the range. `range=max` (the default) covers
        the campaign's start to today; `last_7`, `last_30`, `last_90`,
        `last_365` or `from`/`to` (Etsy's days, US Eastern for every shop)
        narrow it, and `range_applied` says what Etsy served (daily buckets up
        to 60 days, monthly beyond). If Etsy fails on `max`, Alura retries once,
        then answers with a `hint` to ask for `last_30`. `expand=stats` adds the
        series (as `GET /v1/workspace/ads/stats`), free; `expand=groups` adds
        the shop's ad groups (as `GET /v1/workspace/ads/groups`; null with
        `ad_groups_not_enabled` for a shop Etsy has not turned them on for),
        within the call's credit. Live data needs Chrome open with the Alura
        extension and logged into the shop on Etsy: `extension_offline`,
        `etsy_not_logged_in` or `etsy_shop_mismatch` say which is missing;
        `live_rate_limited` when the shop had too many live reads (2 at a time,
        30 a minute). A shop that has never run Etsy Ads answers `campaign:
        null` with a `no_ads_campaign` notice. Needs the Etsy Ads workspace
        permission. Costs 1 API credit per live read: 1 per call, or 1 per
        60-day chunk Etsy answered with `interval=day`; reads that failed, and a
        call that could not read Etsy, are free.


        Cost: 1 API credit per live read.
      operationId: workspace.ads.get
      parameters:
        - name: shop_id
          in: query
          required: false
          description: >-
            The Etsy shop ID of one of the workspace's connected shops; optional
            when the workspace has one.
          schema:
            description: >-
              The Etsy shop ID of one of the workspace's connected shops;
              optional when the workspace has one.
            type: string
            pattern: ^[0-9]{1,20}$
            example: '22841907'
        - name: range
          in: query
          required: false
          description: >-
            `max` (default): since the campaign started; or `last_7`, `last_30`,
            `last_90` or `last_365`: the last 7, 30, 90 or 365 days to today, on
            Etsy's calendar (US Eastern for every shop). Not with `from`/`to`.
          schema:
            description: >-
              `max` (default): since the campaign started; or `last_7`,
              `last_30`, `last_90` or `last_365`: the last 7, 30, 90 or 365 days
              to today, on Etsy's calendar (US Eastern for every shop). Not with
              `from`/`to`.
            type: string
            enum:
              - max
              - last_7
              - last_30
              - last_90
              - last_365
        - name: from
          in: query
          required: false
          description: >-
            First day (inclusive), on Etsy's calendar (US Eastern for every
            shop). Not with `range`; a day before the campaign started is capped
            there.
          schema:
            type: string
            pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
            description: >-
              First day (inclusive), on Etsy's calendar (US Eastern for every
              shop). Not with `range`; a day before the campaign started is
              capped there.
        - name: to
          in: query
          required: false
          description: >-
            Last day (inclusive), on Etsy's calendar (US Eastern for every
            shop). Default today. Not with `range`.
          schema:
            type: string
            pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
            description: >-
              Last day (inclusive), on Etsy's calendar (US Eastern for every
              shop). Default today. Not with `range`.
        - name: interval
          in: query
          required: false
          description: >-
            `auto` (default): Etsy's own buckets, daily up to 60 days and
            monthly beyond; `day`: one point per day, read in chunks of 60 days,
            at most 13 (768 days; longer is 400 `range_too_long_for_interval`).
          schema:
            description: >-
              `auto` (default): Etsy's own buckets, daily up to 60 days and
              monthly beyond; `day`: one point per day, read in chunks of 60
              days, at most 13 (768 days; longer is 400
              `range_too_long_for_interval`).
            type: string
            enum:
              - auto
              - day
        - name: compare
          in: query
          required: false
          description: >-
            `previous_period` adds `compare`: the equal period just before. Not
            with `range=max`, nor with `interval=day` beyond 60 days.
          schema:
            description: >-
              `previous_period` adds `compare`: the equal period just before.
              Not with `range=max`, nor with `interval=day` beyond 60 days.
            type: string
            enum:
              - previous_period
        - name: fields
          in: query
          required: false
          description: >-
            Comma-separated dotted paths to return; `id`, `object` and `as_of`
            always come back.
          schema:
            type: string
        - name: expand
          in: query
          required: false
          description: 'Comma-separated related objects to include: `stats`, `groups`. Free.'
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            Alura-Credits-Cost:
              $ref: '#/components/headers/Alura-Credits-Cost'
            Alura-Credits-Remaining:
              $ref: '#/components/headers/Alura-Credits-Remaining'
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: workspace.ads
                  shop_id:
                    type: string
                    description: The Etsy shop ID, as a string.
                  campaign:
                    anyOf:
                      - type: object
                        properties:
                          status:
                            anyOf:
                              - type: string
                                enum:
                                  - active
                                  - paused
                              - type: 'null'
                            description: >-
                              `active` while the campaign runs, `paused` when
                              the seller stopped it; null when Etsy did not say.
                          strategy:
                            anyOf:
                              - type: string
                                enum:
                                  - efficient
                                  - lower_click_cost
                                  - greater_visibility
                              - type: 'null'
                            description: >-
                              The campaign's bidding strategy: `efficient`,
                              `lower_click_cost` or `greater_visibility`; null
                              with notice `campaign_strategy_unknown` when Etsy
                              reports none (the campaign never chose one; each
                              listing then has its own) or named one Alura does
                              not know yet.
                          daily_budget:
                            anyOf:
                              - type: object
                                properties:
                                  amount:
                                    type: string
                                    description: >-
                                      Decimal string with the currency's
                                      decimals.
                                  currency:
                                    type: string
                                    description: >-
                                      ISO 4217. Etsy Ads money (budget, spend,
                                      revenue) is `USD` for every shop, whatever
                                      the shop's own currency; a listing's price
                                      is in the currency Etsy names for it.
                                required:
                                  - amount
                                  - currency
                                additionalProperties: false
                                description: An amount of money.
                              - type: 'null'
                            description: >-
                              The daily budget, in US dollars; null when Etsy
                              did not give it.
                          created_at:
                            anyOf:
                              - type: string
                                description: ISO 8601, UTC.
                              - type: 'null'
                            description: >-
                              When the campaign started (the start of its
                              stats); null when Etsy did not say.
                          strategy_updated_at:
                            anyOf:
                              - type: string
                                description: ISO 8601, UTC.
                              - type: 'null'
                            description: >-
                              When the current strategy was set; null when Etsy
                              did not say.
                        required:
                          - status
                          - strategy
                          - daily_budget
                          - created_at
                          - strategy_updated_at
                        additionalProperties: false
                        description: The shop's Etsy Ads campaign.
                      - type: 'null'
                    description: >-
                      null when the shop has no Etsy Ads campaign (with a
                      `no_ads_campaign` notice), never a campaign of zeros.
                  range:
                    type: string
                    enum:
                      - max
                      - last_7
                      - last_30
                      - last_90
                      - last_365
                      - custom
                    description: >-
                      The range asked for: `max` (the default) is the campaign's
                      start to today, never "all time"; `custom` for
                      `from`/`to`.
                  range_applied:
                    anyOf:
                      - type: object
                        properties:
                          from:
                            type: string
                            description: >-
                              `YYYY-MM-DD`, on Etsy's calendar (US Eastern for
                              every shop).
                          to:
                            type: string
                            description: >-
                              `YYYY-MM-DD`, on Etsy's calendar (US Eastern for
                              every shop).
                          granularity:
                            anyOf:
                              - type: string
                                enum:
                                  - day
                                  - week
                                  - month
                                  - year
                              - type: 'null'
                            description: >-
                              The bucket size Etsy served, from the buckets'
                              spacing: daily up to 60 days, monthly from about
                              95; null when there is no series.
                        required:
                          - from
                          - to
                          - granularity
                        additionalProperties: false
                      - type: 'null'
                    description: >-
                      The window served, as Etsy stated it; null when nothing
                      was served (no campaign, or a window wholly before the
                      campaign started).
                  range_capped:
                    anyOf:
                      - type: boolean
                        description: >-
                          true when the window served is shorter than the one
                          asked for (`range_capped_reason` says why). `max` is
                          never capped.
                      - type: 'null'
                    description: As on the stats; null with `ads_stats_unavailable`.
                  range_capped_reason:
                    anyOf:
                      - type: string
                        enum:
                          - etsy_window
                          - before_data_start
                          - etsy_rolling_window
                      - type: 'null'
                    description: >-
                      `before_data_start`: asked from before the campaign
                      started; `etsy_window`: past today. null when not capped.
                  totals:
                    anyOf:
                      - type: object
                        properties:
                          impressions:
                            anyOf:
                              - type: integer
                              - type: 'null'
                            description: >-
                              Times the ads were shown; null when Etsy did not
                              give it.
                          clicks:
                            anyOf:
                              - type: integer
                              - type: 'null'
                            description: Clicks on the ads; null when Etsy did not give it.
                          click_rate:
                            description: >-
                              Clicks ÷ impressions (0.0162 for 1.62%), from the
                              counts; null when there were no impressions or a
                              count is unknown.
                            type:
                              - number
                              - 'null'
                          spend:
                            anyOf:
                              - type: object
                                properties:
                                  amount:
                                    type: string
                                    description: >-
                                      Decimal string with the currency's
                                      decimals.
                                  currency:
                                    type: string
                                    description: >-
                                      ISO 4217. Etsy Ads money (budget, spend,
                                      revenue) is `USD` for every shop, whatever
                                      the shop's own currency; a listing's price
                                      is in the currency Etsy names for it.
                                required:
                                  - amount
                                  - currency
                                additionalProperties: false
                                description: An amount of money.
                              - type: 'null'
                            description: >-
                              What the ads cost, in US dollars; null when Etsy
                              did not give it.
                          orders:
                            anyOf:
                              - type: integer
                              - type: 'null'
                            description: >-
                              Orders Etsy attributes to the ads; null when Etsy
                              did not give it.
                          revenue:
                            anyOf:
                              - type: object
                                properties:
                                  amount:
                                    type: string
                                    description: >-
                                      Decimal string with the currency's
                                      decimals.
                                  currency:
                                    type: string
                                    description: >-
                                      ISO 4217. Etsy Ads money (budget, spend,
                                      revenue) is `USD` for every shop, whatever
                                      the shop's own currency; a listing's price
                                      is in the currency Etsy names for it.
                                required:
                                  - amount
                                  - currency
                                additionalProperties: false
                                description: An amount of money.
                              - type: 'null'
                            description: >-
                              Revenue from those orders, in US dollars; null
                              when Etsy did not give it.
                          roas:
                            description: >-
                              Return on ad spend: revenue ÷ spend; null when
                              nothing was spent or either is unknown.
                            type:
                              - number
                              - 'null'
                        required:
                          - impressions
                          - clicks
                          - click_rate
                          - spend
                          - orders
                          - revenue
                          - roas
                        additionalProperties: false
                        description: The campaign over `range_applied`.
                      - type: 'null'
                    description: >-
                      The campaign over `range_applied`; null when the shop has
                      no campaign or Etsy served no stats
                      (`ads_stats_unavailable`), never zeros.
                  advertised_listings:
                    anyOf:
                      - type: integer
                      - type: 'null'
                    description: >-
                      How many listings the campaign advertises; null when Etsy
                      did not say.
                  notices:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: >-
                            `no_ads_campaign` (the shop has never run Etsy Ads),
                            `ads_stats_unavailable` (the campaign is there, but
                            Etsy returned no stats for it right now: the totals
                            are unknown), `ad_groups_unavailable` (with
                            `expand=groups`: Etsy returned no ad groups right
                            now, `groups` is null), `ad_groups_not_enabled`
                            (with `expand=groups`: Etsy has not turned ad groups
                            on for the shop, `groups` is null) `partial_series`
                            (some days could not be read: `missing` names them,
                            and the totals are null),
                            `campaign_strategy_unknown` (`campaign.strategy` is
                            null: Etsy reports none, or one Alura does not
                            know), or on `GET /v1/workspace/ads/listings`
                            `rows_unreadable` and `filtered_totals_unknown` (a
                            threshold is set and this page does not hold every
                            listing that passes it: `filtered_count` and
                            `filtered_totals` are null). New codes may be added.
                        shop_ids:
                          type: array
                          items:
                            type: string
                          description: The shops the notice is about.
                        detail:
                          type: string
                        missing:
                          anyOf:
                            - type: array
                              items:
                                type: object
                                properties:
                                  from:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                  to:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                required:
                                  - from
                                  - to
                                additionalProperties: false
                            - type: 'null'
                          description: >-
                            `partial_series`: the days asked for and not read;
                            null for other notices.
                      required:
                        - code
                        - shop_ids
                        - detail
                        - missing
                      additionalProperties: false
                  fetched_at:
                    type: string
                    description: >-
                      When Alura read it from Etsy: the oldest of the reads it
                      stands on, when it combines several.
                  source:
                    type: string
                    const: live
                    description: >-
                      Live Etsy data (needs Chrome open with the Alura
                      extension, logged into Etsy).
                  stats:
                    x-alura-expansion: stats
                    description: >-
                      With `expand=stats`: the stats of the same range with
                      their series (`workspace.ads_stats`); null with
                      `ads_stats_unavailable`.
                    anyOf:
                      - type: object
                        properties:
                          object:
                            type: string
                            const: workspace.ads_stats
                          shop_id:
                            type: string
                            description: The Etsy shop ID, as a string.
                          range:
                            type: string
                            enum:
                              - max
                              - last_7
                              - last_30
                              - last_90
                              - last_365
                              - custom
                            description: >-
                              The range asked for: `max` (the default) is the
                              campaign's start to today, never "all time";
                              `custom` for `from`/`to`.
                          range_applied:
                            anyOf:
                              - type: object
                                properties:
                                  from:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                  to:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                  granularity:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - day
                                          - week
                                          - month
                                          - year
                                      - type: 'null'
                                    description: >-
                                      The bucket size Etsy served, from the
                                      buckets' spacing: daily up to 60 days,
                                      monthly from about 95; null when there is
                                      no series.
                                required:
                                  - from
                                  - to
                                  - granularity
                                additionalProperties: false
                              - type: 'null'
                            description: >-
                              The window served, as Etsy stated it; null when
                              nothing was served (no campaign, or a window
                              wholly before the campaign started).
                          range_capped:
                            type: boolean
                            description: >-
                              true when the window served is shorter than the
                              one asked for (`range_capped_reason` says why).
                              `max` is never capped.
                          range_capped_reason:
                            anyOf:
                              - type: string
                                enum:
                                  - etsy_window
                                  - before_data_start
                                  - etsy_rolling_window
                              - type: 'null'
                            description: >-
                              `before_data_start`: asked from before the
                              campaign started; `etsy_window`: past today. null
                              when not capped.
                          interval:
                            type: string
                            enum:
                              - auto
                              - day
                            description: >-
                              `auto`: Etsy's own bucket size; `day`: one point
                              per day, read in chunks of 60 days.
                          series:
                            anyOf:
                              - type: array
                                items:
                                  type: object
                                  properties:
                                    date:
                                      type: string
                                      description: >-
                                        The bucket's first day (`granularity`
                                        says how long it is).
                                    impressions:
                                      anyOf:
                                        - type: integer
                                        - type: 'null'
                                      description: >-
                                        Times the ads were shown; null when Etsy
                                        did not give it.
                                    clicks:
                                      anyOf:
                                        - type: integer
                                        - type: 'null'
                                      description: >-
                                        Clicks on the ads; null when Etsy did
                                        not give it.
                                    click_rate:
                                      description: >-
                                        Clicks ÷ impressions (0.0162 for 1.62%),
                                        from the counts; null when there were no
                                        impressions or a count is unknown.
                                      type:
                                        - number
                                        - 'null'
                                    spend:
                                      anyOf:
                                        - type: object
                                          properties:
                                            amount:
                                              type: string
                                              description: >-
                                                Decimal string with the currency's
                                                decimals.
                                            currency:
                                              type: string
                                              description: >-
                                                ISO 4217. Etsy Ads money (budget, spend,
                                                revenue) is `USD` for every shop,
                                                whatever the shop's own currency; a
                                                listing's price is in the currency Etsy
                                                names for it.
                                          required:
                                            - amount
                                            - currency
                                          additionalProperties: false
                                          description: An amount of money.
                                        - type: 'null'
                                      description: >-
                                        What the ads cost, in US dollars; null
                                        when Etsy did not give it.
                                    orders:
                                      anyOf:
                                        - type: integer
                                        - type: 'null'
                                      description: >-
                                        Orders Etsy attributes to the ads; null
                                        when Etsy did not give it.
                                    revenue:
                                      anyOf:
                                        - type: object
                                          properties:
                                            amount:
                                              type: string
                                              description: >-
                                                Decimal string with the currency's
                                                decimals.
                                            currency:
                                              type: string
                                              description: >-
                                                ISO 4217. Etsy Ads money (budget, spend,
                                                revenue) is `USD` for every shop,
                                                whatever the shop's own currency; a
                                                listing's price is in the currency Etsy
                                                names for it.
                                          required:
                                            - amount
                                            - currency
                                          additionalProperties: false
                                          description: An amount of money.
                                        - type: 'null'
                                      description: >-
                                        Revenue from those orders, in US
                                        dollars; null when Etsy did not give it.
                                    roas:
                                      description: >-
                                        Return on ad spend: revenue ÷ spend;
                                        null when nothing was spent or either is
                                        unknown.
                                      type:
                                        - number
                                        - 'null'
                                  required:
                                    - date
                                    - impressions
                                    - clicks
                                    - click_rate
                                    - spend
                                    - orders
                                    - revenue
                                    - roas
                                  additionalProperties: false
                              - type: 'null'
                            description: >-
                              One point per bucket, oldest first; days that
                              could not be read are left out (a `partial_series`
                              notice names them). null when nothing was served.
                          totals:
                            anyOf:
                              - type: object
                                properties:
                                  impressions:
                                    anyOf:
                                      - type: integer
                                      - type: 'null'
                                    description: >-
                                      Times the ads were shown; null when Etsy
                                      did not give it.
                                  clicks:
                                    anyOf:
                                      - type: integer
                                      - type: 'null'
                                    description: >-
                                      Clicks on the ads; null when Etsy did not
                                      give it.
                                  click_rate:
                                    description: >-
                                      Clicks ÷ impressions (0.0162 for 1.62%),
                                      from the counts; null when there were no
                                      impressions or a count is unknown.
                                    type:
                                      - number
                                      - 'null'
                                  spend:
                                    anyOf:
                                      - type: object
                                        properties:
                                          amount:
                                            type: string
                                            description: >-
                                              Decimal string with the currency's
                                              decimals.
                                          currency:
                                            type: string
                                            description: >-
                                              ISO 4217. Etsy Ads money (budget, spend,
                                              revenue) is `USD` for every shop,
                                              whatever the shop's own currency; a
                                              listing's price is in the currency Etsy
                                              names for it.
                                        required:
                                          - amount
                                          - currency
                                        additionalProperties: false
                                        description: An amount of money.
                                      - type: 'null'
                                    description: >-
                                      What the ads cost, in US dollars; null
                                      when Etsy did not give it.
                                  orders:
                                    anyOf:
                                      - type: integer
                                      - type: 'null'
                                    description: >-
                                      Orders Etsy attributes to the ads; null
                                      when Etsy did not give it.
                                  revenue:
                                    anyOf:
                                      - type: object
                                        properties:
                                          amount:
                                            type: string
                                            description: >-
                                              Decimal string with the currency's
                                              decimals.
                                          currency:
                                            type: string
                                            description: >-
                                              ISO 4217. Etsy Ads money (budget, spend,
                                              revenue) is `USD` for every shop,
                                              whatever the shop's own currency; a
                                              listing's price is in the currency Etsy
                                              names for it.
                                        required:
                                          - amount
                                          - currency
                                        additionalProperties: false
                                        description: An amount of money.
                                      - type: 'null'
                                    description: >-
                                      Revenue from those orders, in US dollars;
                                      null when Etsy did not give it.
                                  roas:
                                    description: >-
                                      Return on ad spend: revenue ÷ spend; null
                                      when nothing was spent or either is
                                      unknown.
                                    type:
                                      - number
                                      - 'null'
                                required:
                                  - impressions
                                  - clicks
                                  - click_rate
                                  - spend
                                  - orders
                                  - revenue
                                  - roas
                                additionalProperties: false
                                description: The campaign over `range_applied`.
                              - type: 'null'
                            description: >-
                              null when nothing was served or some days could
                              not be read (`partial_series`), never a sum with
                              days missing.
                          compare:
                            anyOf:
                              - type: object
                                properties:
                                  from:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                  to:
                                    type: string
                                    description: >-
                                      `YYYY-MM-DD`, on Etsy's calendar (US
                                      Eastern for every shop).
                                  totals:
                                    anyOf:
                                      - type: object
                                        properties:
                                          impressions:
                                            anyOf:
                                              - type: integer
                                              - type: 'null'
                                            description: >-
                                              Times the ads were shown; null when Etsy
                                              did not give it.
                                          clicks:
                                            anyOf:
                                              - type: integer
                                              - type: 'null'
                                            description: >-
                                              Clicks on the ads; null when Etsy did
                                              not give it.
                                          click_rate:
                                            description: >-
                                              Clicks ÷ impressions (0.0162 for 1.62%),
                                              from the counts; null when there were no
                                              impressions or a count is unknown.
                                            type:
                                              - number
                                              - 'null'
                                          spend:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  amount:
                                                    type: string
                                                    description: >-
                                                      Decimal string with the currency's
                                                      decimals.
                                                  currency:
                                                    type: string
                                                    description: >-
                                                      ISO 4217. Etsy Ads money (budget, spend,
                                                      revenue) is `USD` for every shop,
                                                      whatever the shop's own currency; a
                                                      listing's price is in the currency Etsy
                                                      names for it.
                                                required:
                                                  - amount
                                                  - currency
                                                additionalProperties: false
                                                description: An amount of money.
                                              - type: 'null'
                                            description: >-
                                              What the ads cost, in US dollars; null
                                              when Etsy did not give it.
                                          orders:
                                            anyOf:
                                              - type: integer
                                              - type: 'null'
                                            description: >-
                                              Orders Etsy attributes to the ads; null
                                              when Etsy did not give it.
                                          revenue:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  amount:
                                                    type: string
                                                    description: >-
                                                      Decimal string with the currency's
                                                      decimals.
                                                  currency:
                                                    type: string
                                                    description: >-
                                                      ISO 4217. Etsy Ads money (budget, spend,
                                                      revenue) is `USD` for every shop,
                                                      whatever the shop's own currency; a
                                                      listing's price is in the currency Etsy
                                                      names for it.
                                                required:
                                                  - amount
                                                  - currency
                                                additionalProperties: false
                                                description: An amount of money.
                                              - type: 'null'
                                            description: >-
                                              Revenue from those orders, in US
                                              dollars; null when Etsy did not give it.
                                          roas:
                                            description: >-
                                              Return on ad spend: revenue ÷ spend;
                                              null when nothing was spent or either is
                                              unknown.
                                            type:
                                              - number
                                              - 'null'
                                        required:
                                          - impressions
                                          - clicks
                                          - click_rate
                                          - spend
                                          - orders
                                          - revenue
                                          - roas
                                        additionalProperties: false
                                        description: The campaign over `range_applied`.
                                      - type: 'null'
                                  series:
                                    anyOf:
                                      - type: array
                                        items:
                                          type: object
                                          properties:
                                            date:
                                              type: string
                                              description: >-
                                                The bucket's first day (`granularity`
                                                says how long it is).
                                            impressions:
                                              anyOf:
                                                - type: integer
                                                - type: 'null'
                                              description: >-
                                                Times the ads were shown; null when Etsy
                                                did not give it.
                                            clicks:
                                              anyOf:
                                                - type: integer
                                                - type: 'null'
                                              description: >-
                                                Clicks on the ads; null when Etsy did
                                                not give it.
                                            click_rate:
                                              description: >-
                                                Clicks ÷ impressions (0.0162 for 1.62%),
                                                from the counts; null when there were no
                                                impressions or a count is unknown.
                                              type:
                                                - number
                                                - 'null'
                                            spend:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    amount:
                                                      type: string
                                                      description: >-
                                                        Decimal string with the currency's
                                                        decimals.
                                                    currency:
                                                      type: string
                                                      description: >-
                                                        ISO 4217. Etsy Ads money (budget, spend,
                                                        revenue) is `USD` for every shop,
                                                        whatever the shop's own currency; a
                                                        listing's price is in the currency Etsy
                                                        names for it.
                                                  required:
                                                    - amount
                                                    - currency
                                                  additionalProperties: false
                                                  description: An amount of money.
                                                - type: 'null'
                                              description: >-
                                                What the ads cost, in US dollars; null
                                                when Etsy did not give it.
                                            orders:
                                              anyOf:
                                                - type: integer
                                                - type: 'null'
                                              description: >-
                                                Orders Etsy attributes to the ads; null
                                                when Etsy did not give it.
                                            revenue:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    amount:
                                                      type: string
                                                      description: >-
                                                        Decimal string with the currency's
                                                        decimals.
                                                    currency:
                                                      type: string
                                                      description: >-
                                                        ISO 4217. Etsy Ads money (budget, spend,
                                                        revenue) is `USD` for every shop,
                                                        whatever the shop's own currency; a
                                                        listing's price is in the currency Etsy
                                                        names for it.
                                                  required:
                                                    - amount
                                                    - currency
                                                  additionalProperties: false
                                                  description: An amount of money.
                                                - type: 'null'
                                              description: >-
                                                Revenue from those orders, in US
                                                dollars; null when Etsy did not give it.
                                            roas:
                                              description: >-
                                                Return on ad spend: revenue ÷ spend;
                                                null when nothing was spent or either is
                                                unknown.
                                              type:
                                                - number
                                                - 'null'
                                          required:
                                            - date
                                            - impressions
                                            - clicks
                                            - click_rate
                                            - spend
                                            - orders
                                            - revenue
                                            - roas
                                          additionalProperties: false
                                      - type: 'null'
                                required:
                                  - from
                                  - to
                                  - totals
                                  - series
                                additionalProperties: false
                              - type: 'null'
                            description: >-
                              With `compare=previous_period`: the equal period
                              just before `range_applied`; null otherwise.
                          notices:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: string
                                  description: >-
                                    `no_ads_campaign` (the shop has never run
                                    Etsy Ads), `ads_stats_unavailable` (the
                                    campaign is there, but Etsy returned no
                                    stats for it right now: the totals are
                                    unknown), `ad_groups_unavailable` (with
                                    `expand=groups`: Etsy returned no ad groups
                                    right now, `groups` is null),
                                    `ad_groups_not_enabled` (with
                                    `expand=groups`: Etsy has not turned ad
                                    groups on for the shop, `groups` is null)
                                    `partial_series` (some days could not be
                                    read: `missing` names them, and the totals
                                    are null), `campaign_strategy_unknown`
                                    (`campaign.strategy` is null: Etsy reports
                                    none, or one Alura does not know), or on
                                    `GET /v1/workspace/ads/listings`
                                    `rows_unreadable` and
                                    `filtered_totals_unknown` (a threshold is
                                    set and this page does not hold every
                                    listing that passes it: `filtered_count` and
                                    `filtered_totals` are null). New codes may
                                    be added.
                                shop_ids:
                                  type: array
                                  items:
                                    type: string
                                  description: The shops the notice is about.
                                detail:
                                  type: string
                                missing:
                                  anyOf:
                                    - type: array
                                      items:
                                        type: object
                                        properties:
                                          from:
                                            type: string
                                            description: >-
                                              `YYYY-MM-DD`, on Etsy's calendar (US
                                              Eastern for every shop).
                                          to:
                                            type: string
                                            description: >-
                                              `YYYY-MM-DD`, on Etsy's calendar (US
                                              Eastern for every shop).
                                        required:
                                          - from
                                          - to
                                        additionalProperties: false
                                    - type: 'null'
                                  description: >-
                                    `partial_series`: the days asked for and not
                                    read; null for other notices.
                              required:
                                - code
                                - shop_ids
                                - detail
                                - missing
                              additionalProperties: false
                          fetched_at:
                            type: string
                            description: >-
                              When Alura read it from Etsy: the oldest of the
                              reads it stands on, when it combines several.
                          source:
                            type: string
                            const: live
                            description: >-
                              Live Etsy data (needs Chrome open with the Alura
                              extension, logged into Etsy).
                        required:
                          - object
                          - shop_id
                          - range
                          - range_applied
                          - range_capped
                          - range_capped_reason
                          - interval
                          - series
                          - totals
                          - compare
                          - notices
                          - fetched_at
                          - source
                        additionalProperties: false
                      - type: 'null'
                  groups:
                    x-alura-expansion: groups
                    description: >-
                      With `expand=groups`: the shop's ad groups
                      (`workspace.ad_group`), by name; null when the shop has no
                      campaign, Etsy has ad groups off for it
                      (`ad_groups_not_enabled`) or did not return them
                      (`ad_groups_unavailable`), never an empty list for
                      unknown.
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            object:
                              type: string
                              const: workspace.ad_group
                            id:
                              type: string
                              description: The ad group's Etsy ID, as a string.
                            name:
                              type: string
                              description: The group's name.
                          required:
                            - object
                            - id
                            - name
                          additionalProperties: false
                      - type: 'null'
                required:
                  - object
                  - shop_id
                  - campaign
                  - range
                  - range_applied
                  - range_capped
                  - range_capped_reason
                  - totals
                  - advertised_listings
                  - notices
                  - fetched_at
                  - source
                additionalProperties: false
              example:
                object: workspace.ads
                shop_id: '22841907'
                campaign:
                  status: active
                  strategy: efficient
                  daily_budget:
                    amount: '5.00'
                    currency: USD
                  created_at: '2019-10-22T16:42:56.000Z'
                  strategy_updated_at: '2026-07-05T00:46:54.000Z'
                range: max
                range_applied:
                  from: '2019-10-22'
                  to: '2026-10-17'
                  granularity: month
                range_capped: false
                range_capped_reason: null
                totals:
                  impressions: 3318400
                  clicks: 45949
                  click_rate: 0.0138
                  spend:
                    amount: '10977.40'
                    currency: USD
                  orders: 1094
                  revenue:
                    amount: '27350.00'
                    currency: USD
                  roas: 2.49
                advertised_listings: 118
                notices: []
                fetched_at: '2026-10-17T12:00:00.000Z'
                source: live
        '400':
          description: Error. `range_too_long_for_interval` carries `max_days`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      max_days:
                        type: integer
                        description: The longest window served with `interval=day`.
        '401':
          $ref: '#/components/responses/Problem401'
        '402':
          $ref: '#/components/responses/Problem402'
        '403':
          $ref: '#/components/responses/Problem403'
        '404':
          description: Error. `not_found` carries `shop_id`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
        '405':
          $ref: '#/components/responses/Problem405'
        '409':
          description: >-
            Error. `etsy_not_logged_in` carries `shop_id`. `etsy_shop_mismatch`
            carries `shop_id`, `state`, `holder`, `last_served_at`, `action`.
            `holder_offline` carries `shop_id`, `state`, `holder`,
            `last_served_at`, `action`. `login_expired` carries `shop_id`,
            `state`, `holder`, `last_served_at`, `action`. `never_connected`
            carries `shop_id`, `state`, `holder`, `last_served_at`, `action`.
            `saved_shops_off` carries `shop_id`, `state`, `holder`,
            `last_served_at`, `action`. `etsy_refused` carries `shop_id`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
                      state:
                        description: >-
                          The shop's live state, the same as GET
                          /v1/workspace/live shows for it.
                        type: string
                        enum:
                          - login_expired
                          - etsy_shop_mismatch
                          - holder_offline
                          - never_connected
                          - saved_shops_off
                      holder:
                        description: >-
                          The browser the state is about; null when none holds
                          the shop, or it is not known.
                        anyOf:
                          - type: object
                            properties:
                              label:
                                type: string
                                description: >-
                                  The browser's name, as Settings lists it
                                  ("Chrome on macOS · 64NN").
                              last_seen_at:
                                description: >-
                                  When it was last online (ISO 8601); null when
                                  unknown.
                                type:
                                  - string
                                  - 'null'
                            required:
                              - label
                              - last_seen_at
                            additionalProperties: false
                          - type: 'null'
                      last_served_at:
                        description: >-
                          When a browser last served this shop (ISO 8601); null
                          when none did.
                        type:
                          - string
                          - 'null'
                      action:
                        description: What fixes it, in one sentence for the seller.
                        type: string
        '429':
          description: >-
            Error. `etsy_rate_limited` carries `shop_id`, `retry_after_seconds`.
            `live_rate_limited` carries `shop_id`, `retry_after_seconds`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
                      retry_after_seconds:
                        type: integer
                        minimum: 1
                        description: >-
                          Seconds to wait before retrying, the same as the
                          Retry-After header.
        '500':
          $ref: '#/components/responses/Problem500'
        '502':
          description: Error. `etsy_changed` carries `shop_id`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
        '503':
          description: >-
            Error. `extension_offline` carries `shop_id`. `etsy_challenge`
            carries `shop_id`. `etsy_unavailable` carries `shop_id`, `reason`.
            `live_data_paused` carries `shop_id`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
                      reason:
                        description: >-
                          A saved shop's browser context was busy; retry after
                          Retry-After.
                        type: string
                        const: shop_busy
        '504':
          description: Error. `upstream_timeout` carries `shop_id`, `hint`.
          content:
            application/problem+json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Problem'
                  - type: object
                    properties:
                      shop_id:
                        description: The Etsy shop ID Alura read for.
                        type: string
                      hint:
                        description: >-
                          After an Etsy-side failure on `range=max`, read again:
                          a shorter range that is likelier to answer.
                        type: object
                        properties:
                          range:
                            type: string
                            const: last_30
                        required:
                          - range
                        additionalProperties: false
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl "https://api.alura.io/v1/workspace/ads?shop_id=22841907" \
              -H "Authorization: Bearer $ALURA_API_KEY"
        - lang: typescript
          label: TypeScript
          source: >-
            const res = await
            fetch('https://api.alura.io/v1/workspace/ads?shop_id=22841907', {
              headers: {
                Authorization: `Bearer ${process.env.ALURA_API_KEY}`,
              },
            });

            console.log(await res.json());
        - lang: python
          label: Python
          source: |-
            import json
            import os
            import urllib.request

            request = urllib.request.Request(
                "https://api.alura.io/v1/workspace/ads?shop_id=22841907",
                headers={
                    "Authorization": f"Bearer {os.environ['ALURA_API_KEY']}",
                },
            )
            with urllib.request.urlopen(request) as response:
                print(json.load(response))
components:
  headers:
    Request-Id:
      description: '`req_` + ULID; quote it when reporting a problem.'
      schema:
        type: string
    Alura-Credits-Cost:
      description: API credits this call cost.
      schema:
        type: integer
    Alura-Credits-Remaining:
      description: >-
        API credits left in the workspace's monthly allowance, counting calls
        still in flight. Absent when it cannot be read right now.
      schema:
        type: integer
  schemas:
    Problem:
      type: object
      description: RFC 9457 problem details.
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        code:
          type: string
          description: A code from the error catalog; new codes may be added.
          x-extensible-enum:
            - invalid_request
            - unknown_parameter
            - invalid_cursor
            - cursor_window_exceeded
            - invalid_reference
            - id_type_mismatch
            - invalid_keyword
            - shop_id_required
            - listing_not_publishable
            - sales_window_not_covered
            - range_too_long_for_interval
            - target_not_available
            - unauthorized
            - credits_exhausted
            - plan_required
            - insufficient_scope
            - workspace_required
            - workspace_locked
            - your_shop_unavailable
            - writes_suspended
            - browser_refused
            - live_data_not_enabled
            - send_not_enabled
            - attachments_not_enabled
            - self_approval
            - role_required
            - impersonation_refused
            - recent_sign_in_required
            - etsy_scope_required
            - etsy_partner_required
            - not_found
            - not_collected
            - not_found_on_etsy
            - shop_opted_out
            - method_not_allowed
            - conflict
            - settings_conflict
            - settings_unreadable
            - optimize_settings_required
            - optimize_plan_changed
            - optimize_run_applied
            - optimize_run_applying
            - optimize_run_too_large
            - optimize_nothing_to_apply
            - optimize_nothing_to_revert
            - optimize_shop_busy
            - runs_unreadable
            - run_not_resumable
            - suggestion_not_pending
            - draft_sent
            - draft_dismissed
            - draft_sending
            - conversation_changed
            - key_limit_reached
            - etsy_not_logged_in
            - etsy_shop_mismatch
            - holder_offline
            - login_expired
            - never_connected
            - etsy_refused
            - extension_update_required
            - attachment_used
            - attachment_expired
            - attachment_unavailable
            - saved_shops_off
            - review_already_replied
            - insights_search_unavailable
            - reconnect_required
            - settings_not_fetched
            - listing_busy
            - settings_busy
            - shop_create_busy
            - idempotency_partial_unverifiable
            - listing_has_variations
            - listing_sold_out
            - changed_since
            - change_not_revertable
            - media_changed
            - text_changed
            - inventory_changed
            - base_unverifiable
            - listing_in_ab_test
            - activation_skipped
            - idempotency_processing
            - confirmation_required
            - test_shop_active_cap
            - write_outcome_unknown
            - margin_required
            - unprocessable
            - knowledge_limit_reached
            - status_required
            - listing_removed_on_etsy
            - optimize_run_expired
            - endpoint_removed
            - rate_limited
            - throttled
            - daily_credit_cap_exceeded
            - credits_reserved
            - fetch_limit_reached
            - write_rate_limited
            - sync_cooldown
            - shop_write_budget_exhausted
            - live_rate_limited
            - etsy_rate_limited
            - internal_error
            - write_misconfigured
            - etsy_changed
            - upstream_unavailable
            - extension_offline
            - etsy_unavailable
            - etsy_challenge
            - live_data_paused
            - live_data_unavailable
            - credits_unavailable
            - service_unavailable
            - fetch_unavailable
            - create_lock_unavailable
            - writes_paused
            - etsy_capacity
            - upstream_timeout
        detail:
          type: string
        suggestion:
          type: string
        retryable:
          type: boolean
        request_id:
          type: string
        upgrade_url:
          type: string
          format: uri
          description: 'credits_exhausted and plan_required: where to upgrade the plan.'
        credits_needed:
          type: integer
          description: 'API credit refusals: what the call needed.'
        credits_remaining:
          type: integer
          description: >-
            API credit refusals: what is left (of the month, or of the day for
            daily_credit_cap_exceeded).
        resets_at:
          type: string
          format: date-time
          description: >-
            credits_exhausted and daily_credit_cap_exceeded: when the limit
            resets.
      required:
        - type
        - title
        - status
        - code
        - detail
        - suggestion
        - retryable
        - request_id
  responses:
    Problem401:
      description: Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.alura.io/errors/unauthorized
            title: Unauthorized
            status: 401
            code: unauthorized
            detail: Unauthorized
            suggestion: 'Send a valid API key as `Authorization: Bearer alura_sk_...`.'
            retryable: false
            request_id: req_01JQ5W3H8M2N4P6R8T0V2X4Z6B
    Problem402:
      description: Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.alura.io/errors/credits_exhausted
            title: API credits exhausted
            status: 402
            code: credits_exhausted
            detail: API credits exhausted
            suggestion: Upgrade the plan or wait for the monthly reset.
            retryable: false
            request_id: req_01JQ5W3H8M2N4P6R8T0V2X4Z6B
    Problem403:
      description: Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.alura.io/errors/plan_required
            title: Plan required
            status: 403
            code: plan_required
            detail: Plan required
            suggestion: Upgrade the workspace plan to use this operation.
            retryable: false
            request_id: req_01JQ5W3H8M2N4P6R8T0V2X4Z6B
    Problem405:
      description: Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.alura.io/errors/method_not_allowed
            title: Method not allowed
            status: 405
            code: method_not_allowed
            detail: Method not allowed
            suggestion: Use one of the methods in the Allow header.
            retryable: false
            request_id: req_01JQ5W3H8M2N4P6R8T0V2X4Z6B
    Problem500:
      description: Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.alura.io/errors/internal_error
            title: Internal error
            status: 500
            code: internal_error
            detail: Internal error
            suggestion: Retry; if it keeps failing, report the request_id.
            retryable: true
            request_id: req_01JQ5W3H8M2N4P6R8T0V2X4Z6B
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'An API key: `Authorization: Bearer alura_sk_...`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.