{"openapi":"3.1.0","info":{"title":"AdTrendLab API","version":"1.1.0","description":"AdTrendLab indexes Shopify stores and their Meta (Facebook and Instagram) ad creatives. Find stores with search_shops / new_stores, open one with get_shop (or several with get_shops), find ads with search_ads and open them with get_ad / get_ads, and see how a store's creatives split by hook, angle and offer with creative_breakdown. Products that ads link to: search_products / get_product / shop_products. Facebook pages behind the ads: search_advertisers. The weekly breakouts report: weekly_report. The workspace: list_tracked_brands, brand_changes, brand_history, track_brand, list_favorites, list_saved_searches. account_status shows the plan and how many calls are left this month (it is free). Results carry a `url` on adtrendlab.com to cite. Only Meta ads are covered, not TikTok or Google. AI creative labels are model classifications of ad text with a confidence; an absent label means the model was unsure, not that the trait is missing. Values are omitted (null) when the index has no measurement: treat null as \"not measured\", never as zero.\n\nEvery operation is also an MCP tool at https://adtrendlab.com/api/mcp. Authenticate with a workspace API key from Settings → API (Pro and Business) as a bearer token. Each successful call counts one of the month's calls; refused calls and account_status are free. Operations also accept GET with the arguments as query parameters (arrays comma-separated).","contact":{"email":"hello@adtrendlab.com","url":"https://adtrendlab.com"}},"servers":[{"url":"https://adtrendlab.com"}],"security":[{"apiKey":[]}],"paths":{"/api/v1/search_shops":{"post":{"operationId":"search_shops","summary":"Search shops","description":"Search the Shopify store index by keyword, category, country, language, traffic, catalogue size or live ad count. A keyword also matches the words in a store’s live ads. Returns matching stores with their metrics, each traffic figure labelled with the source it was measured from.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Free-text match on store name or domain."},"country":{"type":"string","description":"Two-letter country code, e.g. US or GB. Includes stores registered elsewhere that sell to that country."},"language":{"type":"string","description":"Two-letter language code of the store (its ads, description or storefront), e.g. en, ja, de."},"category":{"type":"string","description":"Category name, e.g. \"Beauty & Fitness\". Use list_categories for valid values."},"minProducts":{"type":"integer","description":"Only stores with at least this many products in their catalogue.","minimum":0},"maxProducts":{"type":"integer","description":"Only stores with at most this many products.","minimum":0},"minMonthlyVisits":{"type":"integer","description":"Only stores with at least this many SimilarWeb-measured monthly visits (unmeasured stores are excluded).","minimum":0},"maxMonthlyVisits":{"type":"integer","description":"Only stores with at most this many measured monthly visits.","minimum":0},"minGrowthPct":{"type":"number","description":"Only stores whose measured month-over-month visits growth is at least this percentage, e.g. 50."},"maxGrowthPct":{"type":"number","description":"Only stores whose measured growth is at most this percentage."},"minAvgPriceUsd":{"type":"number","minimum":0,"description":"Only stores whose average product price is at least this (US dollars)."},"maxAvgPriceUsd":{"type":"number","minimum":0,"description":"Only stores whose average product price is at most this."},"openedAfter":{"type":"string","description":"Only stores Shopify says were created on or after this date, YYYY-MM-DD."},"theme":{"type":"string","description":"Shopify theme name the storefront declares, e.g. \"Dawn\"."},"sortBy":{"type":"string","enum":["traffic","similarwebRank","growth","ads","products","newest"],"description":"Ranking field. Defaults to traffic, which is SimilarWeb visits measured for the exact store host; growth is SimilarWeb’s measured month-over-month change. For both, stores the crawl has not reached yet rank last, keeping their index order underneath rather than dropping out of the results."},"limit":{"type":"integer","description":"Number of results, 1-50. Defaults to 10.","minimum":1,"maximum":50},"page":{"type":"integer","description":"Page of results, from 1. Use nextPage from the previous result.","minimum":1,"maximum":100}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalInIndex":{"description":"Stores matching the filters, or null when not counted."},"count":{"description":"Stores in this page."},"nextPage":{"description":"Page number for the next results, or null."},"trafficNote":{"description":"How to read monthlyVisits and trafficSource, for every shop below."},"shops":{"description":"Stores with traffic, live ads, catalogue size and a url to cite."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/get_shop":{"post":{"operationId":"get_shop","summary":"Get a shop","description":"Full detail for one store: SimilarWeb traffic (visits, month-over-month, measured history, global/country/category rank, engagement, traffic-source mix, top countries and keywords) where the crawl has reached it, plus catalogue, live ad count and category. Accepts the shop id from search_shops or a bare domain.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id (shp_…) or domain (example.com)."}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"found":{"description":"false when no store matches."},"shop":{"description":"The store summary with traffic history and a url to cite."},"similarweb":{"description":"SimilarWeb detail, or null when the crawl has not reached the store."},"catalogue":{"description":"Best-selling products."},"recentCreatives":{"description":"Up to 8 recent ad creatives."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/find_similar_shops":{"post":{"operationId":"find_similar_shops","summary":"Find similar shops","description":"Stores in the same category with the nearest traffic level to a given store.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id or domain to find lookalikes for."},"limit":{"type":"integer","description":"How many to return, 1-20. Defaults to 6.","minimum":1,"maximum":20}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/get_shops":{"post":{"operationId":"get_shops","summary":"Get several shops","description":"Up to 10 stores by id or domain in one call (one call is metered, not one per store), for comparing them side by side: traffic with its monthly history, live ads, catalogue size and category. `missing` lists the ones not in the index. Use get_shop for one store’s full SimilarWeb detail and recent creatives.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shops":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10,"description":"Shop ids (shp_…) or domains."}},"required":["shops"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"description":"Stores found."},"shops":{"description":"The stores, in the order asked."},"missing":{"description":"Inputs that matched no store."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/search_ads":{"post":{"operationId":"search_ads","summary":"Search ad creatives","description":"Search indexed Meta (Facebook and Instagram) ad creatives by keyword, store, media type, country, language, start date, days running, call to action, number of copies or AI creative label. Returns ads still running at their last crawl; set includeStopped to add ads that have stopped. Each ad carries its landing URL, format, placements, a video link when it is a video, and `labels` (null when unlabeled). AI labels (hook, angle, funnel stage, offer, urgency) are model classifications of the ad text, each with a confidence from 0 to 1. A label is absent when the model was not confident enough, and absence is not evidence of anything: it does not mean the ad has no hook or no offer. They are judgments, not measurements of performance.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Free-text match on ad copy, headline or advertiser."},"shop":{"type":"string","description":"Only ads of this store: domain (example.com) or shop id (shp_…)."},"mediaType":{"type":"string","enum":["image","video"],"description":"Creative format."},"country":{"type":"string","description":"Two-letter country code the ad targets."},"language":{"type":"string","description":"Two-letter language code of the ad copy, e.g. en, ja, de."},"startedFrom":{"type":"string","description":"Only ads that started on or after this date, YYYY-MM-DD."},"startedTo":{"type":"string","description":"Only ads that started on or before this date, YYYY-MM-DD."},"minDaysRunning":{"type":"integer","description":"Only ads running for at least this many days (long-running ads are usually the profitable ones).","minimum":1,"maximum":3650},"maxDaysRunning":{"type":"integer","description":"Only ads running for at most this many days.","minimum":1,"maximum":3650},"minCopies":{"type":"integer","description":"Only creatives the advertiser runs as at least this many ad copies (duplicates signal scaling).","minimum":1,"maximum":1000},"callToAction":{"type":"array","items":{"type":"string","enum":["shop_now","learn_more","see_details","order_now","get_offer","sign_up","apply_now","book","get_quote","message","watch_more","app","contact"]},"description":"Call-to-action buttons (OR)."},"hook":{"type":"array","items":{"type":"string","enum":["pain_point","benefit","offer","social_proof","curiosity","story","product_intro"]},"description":"Only creatives the model labeled with one of these hooks (OR within the list). Unlabeled creatives are excluded."},"angle":{"type":"array","items":{"type":"string","enum":["problem_solution","quality","value_price","health_wellness","convenience","identity_style","gifting","sustainability","novelty"]},"description":"Only creatives the model labeled with one of these angles (OR within the list). Unlabeled creatives are excluded."},"funnelStage":{"type":"array","items":{"type":"string","enum":["awareness","consideration","conversion","retention"]},"description":"Only creatives the model labeled with one of these funnel stages (OR within the list). Unlabeled creatives are excluded."},"offer":{"type":"array","items":{"type":"string","enum":["percent_off","amount_off","bundle","free_shipping","free_gift","sale_event","none"]},"description":"Only creatives the model labeled with one of these offer types (OR within the list). Unlabeled creatives are excluded."},"urgency":{"type":"boolean","description":"true = only creatives the model judged to use urgency."},"includeStopped":{"type":"boolean","description":"true = also return ads that have stopped running. Default false: running ads only."},"sortBy":{"type":"string","enum":["relevance","newest","longest","active"],"description":"relevance (default), newest, longest (running longest first) or active (advertisers with the most active ads)."},"limit":{"type":"integer","description":"Number of results, 1-50. Defaults to 12.","minimum":1,"maximum":50},"page":{"type":"integer","description":"Page of results, from 1. Use nextPage from the previous result.","minimum":1,"maximum":100}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"totalInIndex":{"description":"Ads matching the filters, or null when not counted."},"count":{"description":"Ads in this page."},"nextPage":{"description":"Page number for the next results, or null."},"ads":{"description":"Ad creatives with copy, landing URL, labels and a url to cite."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/get_ad":{"post":{"operationId":"get_ad","summary":"Get an ad creative","description":"Everything the index records about one ad creative, including its AI labels. AI labels (hook, angle, funnel stage, offer, urgency) are model classifications of the ad text, each with a confidence from 0 to 1. A label is absent when the model was not confident enough, and absence is not evidence of anything: it does not mean the ad has no hook or no offer. They are judgments, not measurements of performance.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"adId":{"type":"string","description":"Creative id from search_ads."}},"required":["adId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/get_ads":{"post":{"operationId":"get_ads","summary":"Get several ad creatives","description":"Up to 20 ad creatives by id in one call (one call is metered, not one per ad). `missing` lists ids the index does not hold. AI labels (hook, angle, funnel stage, offer, urgency) are model classifications of the ad text, each with a confidence from 0 to 1. A label is absent when the model was not confident enough, and absence is not evidence of anything: it does not mean the ad has no hook or no offer. They are judgments, not measurements of performance.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"adIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":20,"description":"Creative ids from search_ads."}},"required":["adIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"description":"Ads found."},"ads":{"description":"The creatives, in the order asked."},"missing":{"description":"Ids not in the index."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/creative_breakdown":{"post":{"operationId":"creative_breakdown","summary":"Creative breakdown for a shop","description":"How one store's ad creatives split by AI label: counts per hook, angle, funnel stage, offer and urgency, plus how many of its creatives carry any label (`labeled`) out of all indexed (`total`). Compute shares against `labeled`, not `total`. AI labels (hook, angle, funnel stage, offer, urgency) are model classifications of the ad text, each with a confidence from 0 to 1. A label is absent when the model was not confident enough, and absence is not evidence of anything: it does not mean the ad has no hook or no offer. They are judgments, not measurements of performance.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id (shp_…) or domain (example.com)."},"country":{"type":"string","description":"Two-letter country code, to limit to creatives targeting that country."},"days":{"type":"integer","description":"Only creatives that started within the last N days.","minimum":1,"maximum":3650}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/search_products":{"post":{"operationId":"search_products","summary":"Search advertised products","description":"Search Shopify products that Meta ads link to (the Products page): by keyword, shop country, store language, category, price in US dollars, publish date, shop traffic, installed app, theme or number of ads. Default order is relevance: most active ads first, newest campaigns among equals. Products are Shopify products that Meta ads in our index link to. activeAds / totalAds count the ads we have indexed for that product (a lower bound, not Meta’s full total); price, images and publish date come from the store’s own public product feed. There are no sales, revenue or spend figures.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Words that must all appear in the product title, shop name or domain, in any order."},"country":{"type":"array","items":{"type":"string"},"description":"Shop countries, two-letter codes (OR), e.g. [\"US\",\"GB\"]."},"language":{"type":"array","items":{"type":"string"},"description":"Store languages, two-letter codes (OR), e.g. [\"ja\"]."},"category":{"type":"array","items":{"type":"string"},"description":"Shop category names (OR). Use list_categories for valid names."},"excludeCategory":{"type":"array","items":{"type":"string"},"description":"Leave out shops in these categories."},"minPriceUsd":{"type":"number","minimum":0,"description":"Lowest price in US dollars."},"maxPriceUsd":{"type":"number","minimum":0,"description":"Highest price in US dollars."},"publishedWithinDays":{"type":"integer","description":"Only products the store published within the last N days.","minimum":1,"maximum":3650},"publishedFrom":{"type":"string","description":"Only products published on or after this date, YYYY-MM-DD."},"publishedTo":{"type":"string","description":"Only products published on or before this date, YYYY-MM-DD."},"shopOpenedWithinDays":{"type":"integer","description":"Only shops opened within the last N days.","minimum":1,"maximum":3650},"minShopVisits":{"type":"integer","description":"Shops with at least this many SimilarWeb monthly visits (unmeasured shops are excluded).","minimum":0},"maxShopVisits":{"type":"integer","description":"Shops with at most this many SimilarWeb monthly visits.","minimum":0},"minActiveAds":{"type":"integer","description":"At least this many active ads link to the product.","minimum":0},"maxActiveAds":{"type":"integer","description":"At most this many active ads.","minimum":0},"minTotalAds":{"type":"integer","description":"At least this many ads in total (active and stopped).","minimum":0},"apps":{"type":"array","items":{"type":"string"},"description":"Shops with any of these apps installed (OR), by app name."},"themes":{"type":"array","items":{"type":"string"},"description":"Shops on any of these Shopify themes (OR), by theme name."},"sortBy":{"type":"string","enum":["relevance","published","price","visits","active_ads","total_ads"],"description":"relevance (default), published, price (USD), visits (shop traffic), active_ads or total_ads."},"order":{"type":"string","enum":["desc","asc"],"description":"Sort direction for every sort but relevance. Defaults to desc."},"limit":{"type":"integer","description":"Number of results, 1-50. Defaults to 12.","minimum":1,"maximum":50},"offset":{"type":"integer","description":"Skip this many results, for the next page.","minimum":0,"maximum":5000}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/get_product":{"post":{"operationId":"get_product","summary":"Get an advertised product","description":"One advertised product: its price, images and publish date from the store, the shop behind it, and the ad creatives in our index that link to it (with AI labels). Accepts the product key from search_products or the product’s URL on the store. Products are Shopify products that Meta ads in our index link to. activeAds / totalAds count the ads we have indexed for that product (a lower bound, not Meta’s full total); price, images and publish date come from the store’s own public product feed. There are no sales, revenue or spend figures.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"string","description":"Product key (<store_id>:<handle>) from search_products, or the product URL, e.g. https://shop.com/products/handle."},"adLimit":{"type":"integer","description":"How many of its ads to return, 0-30. Defaults to 10.","minimum":0,"maximum":30}},"required":["product"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/shop_products":{"post":{"operationId":"shop_products","summary":"Advertised products of a shop","description":"The products of one store that Meta ads in our index link to, most active ads first. Products are Shopify products that Meta ads in our index link to. activeAds / totalAds count the ads we have indexed for that product (a lower bound, not Meta’s full total); price, images and publish date come from the store’s own public product feed. There are no sales, revenue or spend figures.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id (shp_…) or domain (example.com)."},"limit":{"type":"integer","description":"How many products, 1-50. Defaults to 20.","minimum":1,"maximum":50}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/list_categories":{"post":{"operationId":"list_categories","summary":"List categories","description":"Every store category the index uses, for passing to search_shops.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/trending_categories":{"post":{"operationId":"trending_categories","summary":"Trending categories","description":"Store categories ranked by total creative (ad) count in the current index snapshot.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","description":"How many categories, 1-50. Defaults to 15.","minimum":1,"maximum":50}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/list_tracked_brands":{"post":{"operationId":"list_tracked_brands","summary":"List tracked brands","description":"Brands this workspace tracks, with their latest recorded metrics.","tags":["brandtrackers.read"],"x-required-scope":"brandtrackers.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/brand_changes":{"post":{"operationId":"brand_changes","summary":"Tracked brand changes","description":"Metrics that moved between the last two recordings of each tracked brand. Empty until a brand has at least two recordings. Pass `since` (the `asOf` of your previous call) to get only what moved after it, for a scheduled check.","tags":["brandtrackers.read"],"x-required-scope":"brandtrackers.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","description":"How many changes, 1-100. Defaults to 25.","minimum":1,"maximum":100},"since":{"type":"string","description":"Only changes recorded after this time (ISO 8601 date or timestamp), e.g. the asOf of the previous call."}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"asOf":{"description":"Pass as `since` next time to see only newer changes."},"count":{"description":"Changes returned."},"awaitingBaseline":{"description":"Tracked brands with only one recording so far."},"changes":{"description":"Metric moves, biggest first."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/track_brand":{"post":{"operationId":"track_brand","summary":"Track a brand","description":"Add a store to this workspace's brandtracker so its metrics are recorded on a schedule.","tags":["brandtrackers.write"],"x-required-scope":"brandtrackers.write","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id or domain to track."}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/untrack_brand":{"post":{"operationId":"untrack_brand","summary":"Stop tracking a brand","description":"Remove a store from this workspace's brandtracker.","tags":["brandtrackers.write"],"x-required-scope":"brandtrackers.write","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"string","description":"Shop id (from list_tracked_brands) or domain of the tracked store."}},"required":["shopId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/brand_history":{"post":{"operationId":"brand_history","summary":"Tracked brand history","description":"Every recording of one tracked brand, oldest first: monthly visits (with its source), live ads, products, average price and creatives held. Use it to chart a competitor over time.","tags":["brandtrackers.read"],"x-required-scope":"brandtrackers.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"string","description":"Shop id or domain of a tracked store (see list_tracked_brands)."},"limit":{"type":"integer","description":"Most recent recordings to return, 1-365. Defaults to 90.","minimum":1,"maximum":365}},"required":["shop"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"found":{"description":"false when the store is not tracked."},"brand":{"description":"The tracked store."},"recordings":{"description":"Snapshots, oldest first."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/new_stores":{"post":{"operationId":"new_stores","summary":"New Shopify stores","description":"Recently launched Shopify stores (by Shopify’s own creation date) or the ones AdTrendLab’s discovery found most recently, with traffic, ad counts and top products. Good for spotting new competitors and fresh dropshipping stores early.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["launched","found"],"description":"launched (default): by Shopify creation date. found: by when our discovery found the store."},"days":{"type":"integer","description":"Launched within this many days of the newest launch in the index. Defaults to 30. (launched only)","minimum":1,"maximum":365},"country":{"type":"string","description":"Two-letter country code of the store."},"withAdsOnly":{"type":"boolean","description":"true = only stores running Meta ads."},"sortBy":{"type":"string","enum":["newest","traffic","ads"],"description":"Defaults to newest."},"page":{"type":"integer","description":"Page of 50 results, from 1.","minimum":1,"maximum":200}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"description":"Stores matching (counted up to 10,000)."},"totalIsMinimum":{"description":"true when counting stopped at 10,000."},"nextPage":{"description":"Page number for the next 50, or null."},"stores":{"description":"Stores with launch date, traffic, ads and top products."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/search_advertisers":{"post":{"operationId":"search_advertisers","summary":"Search advertisers","description":"Facebook pages that run the ads in the index: live and total ad counts, ads launched in the last 14 days, page likes, the countries their ads target, their landing pages and the store they point at.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Words in the page name or its store."},"country":{"type":"string","description":"Two-letter country code their ads target."},"language":{"type":"string","description":"Two-letter language code of their ads."},"minLiveAds":{"type":"integer","description":"At least this many live ads.","minimum":0},"minLaunched14d":{"type":"integer","description":"At least this many ads launched in the last 14 days (scaling now).","minimum":0},"minLikes":{"type":"integer","description":"At least this many page likes.","minimum":0},"sortBy":{"type":"string","enum":["live","followers","launched"],"description":"live ads (default), followers (page likes) or launched (last 14 days)."},"limit":{"type":"integer","description":"Number of results, 1-24. Defaults to 12.","minimum":1,"maximum":24},"page":{"type":"integer","description":"Page of results, from 1.","minimum":1,"maximum":100}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"description":"Pages matching, or null."},"nextPage":{"description":"Next page number, or null."},"advertisers":{"description":"Facebook pages with ad counts and their store."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/weekly_report":{"post":{"operationId":"weekly_report","summary":"Weekly breakouts report","description":"AdTrendLab’s weekly report: stores scaling their ads, fastest-growing stores by measured traffic, ad-count peaks, newest stores, breakout niches and their products. Each section says which source and period its figure comes from.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"week":{"type":"string","pattern":"^\\d{4}-w\\d{2}$","description":"ISO week like \"2026-w45\". Omit for the latest."}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"found":{"description":"false when no report exists for that week."},"week":{"description":"ISO week."},"publishedAt":{"description":"When it was published."},"url":{"description":"Public page to cite."},"report":{"description":"Sections with their stores and figures."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/list_favorites":{"post":{"operationId":"list_favorites","summary":"List saved favorites","description":"The shops, ads or products the signed-in user saved in AdTrendLab (newest first), with their current data.","tags":["favorites.read"],"x-required-scope":"favorites.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["shop","ad","product"],"description":"What kind of favorites."},"limit":{"type":"integer","description":"How many, 1-50. Defaults to 20.","minimum":1,"maximum":50}},"required":["type"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"type":{"description":"The kind listed."},"totalSaved":{"description":"How many of this kind are saved."},"items":{"description":"The saved items with current data."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/list_saved_searches":{"post":{"operationId":"list_saved_searches","summary":"List saved product searches","description":"The product-search filters the signed-in user saved on the Products page, with a link that reopens each one.","tags":["favorites.read"],"x-required-scope":"favorites.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"description":"Saved searches."},"searches":{"description":"Name, the filter query string and a link."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}},"/api/v1/account_status":{"post":{"operationId":"account_status","summary":"Account status and usage","description":"This workspace’s plan, how many AI connector / API calls it has used and has left this month, and when they reset. Free: it does not count as a call. Check it before a long multi-step task.","tags":["discovery.read"],"x-required-scope":"discovery.read","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"The tool result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"plan":{"description":"Plan id."},"callsAllowed":{"description":"false when calls are refused right now; message says why."},"monthlyCallLimit":{"description":"Calls a month (null = unlimited)."},"callsUsedThisMonth":{"description":"Calls used."},"callsRemaining":{"description":"Calls left."},"resetsOn":{"description":"Date the allowance resets."},"trialEndsAt":{"description":"When the trial ends, if on one."}}}}}}}},"400":{"$ref":"#/components/responses/Refused"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PlanRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/Limited"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Workspace API key (ml_live_…) from Settings → API."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Machine-readable code."},"message":{"type":"string","description":"What went wrong, in words to show the user."}}}},"responses":{"Refused":{"description":"The arguments were refused; message says how to correct them. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PlanRequired":{"description":"The workspace has no plan with API access, or is on its trial. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key lacks the scope this operation needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Limited":{"description":"Rate limit (600 a minute) or the monthly allowance is used up. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}