Save Market
save_marketCreate or update a saved market in the authenticated account from a query, countries and optional per-storefront seed terms. An existing name updates that market, adding storefronts or replacing seed configuration and rebuilding requested storefronts. Persists account configuration and queues background corpus collection using public App Store data. Requires write authorisation. Returns market_id, build status, affected storefronts and caveats; collection may still be pending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | What to call it. Defaults to `query`. Passing the name of a market this account already has ADDS the new storefronts to it rather than creating a second one. | |
| query | Yes | The phrase to build the market from, e.g. "AI calorie tracking". Used as the seed in every storefront unless `seeds` overrides it. | |
| seeds | No | Per-storefront seed terms, keyed by country code: {"de": ["kalorienzähler"]}. OPTIONAL, and optional per storefront. A storefront you leave out is not seeded from `query`: its terms are read off the localised listings of the leaders of the storefront that WAS phrased, and each one is searched there before it is kept — so it ends up with the local phrasing rather than an English phrase nobody types. Pass a storefront explicitly when you know the local phrase (to use the supplied local terms) or when you want to ask a different question there. Up to five terms each. | |
| countries | Yes | Storefronts to ask it in, ISO 3166-1 alpha-2 (e.g. ["US","DE"]). Each keeps its own corpus; nothing is blended across them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| slug | Yes | Its address in the console. | |
| status | Yes | `building` immediately after a save. A market is building while ANY storefront is; each one lands separately. A build that dies leaves the storefront `failed` (or `ready` with `failed_at` set when a previous corpus survives) — it never stays `building` for ever. | |
| caveats | Yes | What the caller needs to hear — that the build is not finished, or that a storefront was seeded from an English phrase. | |
| created | Yes | True for a new market, false when storefronts were added to one that already existed. | |
| market_id | Yes | Pass it to get_market to read the market once it has built. | |
| console_url | No | The market in the console. | |
| storefronts | Yes | Every storefront this market is now asked in, including ones it already had. | |
| added_storefronts | Yes | The ones this call added or rebuilt. |