{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper",
    "description": "Scrape Google Trends for keywords or topic IDs: interest over time, interest by region, related queries and related topics as flat rows, or current Trending Now searches per country. Compare up to five terms on one 0-100 scale. Filter by country, time range, category and property.",
    "version": "0.1",
    "x-build-id": "siRZJFwaCXgcbq5fp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~google-trends-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-google-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/axiomworks~google-trends-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-google-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/axiomworks~google-trends-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-google-trends-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchTerms": {
            "title": "Keywords or topic IDs",
            "type": "array",
            "description": "Search keywords or topic IDs, e.g. [\"bitcoin\"] or [\"/m/05p0rrx\"]. No API default: explore requires these or startUrls; both add jobs. Ignored in trendingNow. compareTerms groups up to five; geos overrides geo. All targets share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed input fails validation.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Dataset mode explore or trendingNow",
            "enum": [
              "explore",
              "trendingNow"
            ],
            "type": "string",
            "description": "Choose explore (default) for outputs using searchTerms or startUrls, or trendingNow for RSS using trendingGeos. trendingNow ignores explore terms, URLs and filters. All targets and outputs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed input fails validation.",
            "default": "explore"
          },
          "compareTerms": {
            "title": "Compare terms in groups of five",
            "type": "boolean",
            "description": "Compare searchTerms in explore mode: false (default) requests each separately; true groups up to five with a shared relative scale. Groups are independent, not normalized across groups. startUrls already define their own groups; ignored in trendingNow. All groups share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED.",
            "default": false
          },
          "startUrls": {
            "title": "Explore URLs to parse",
            "type": "array",
            "description": "Add explore jobs from URL objects, e.g. [{\"url\":\"https://trends.google.com/trends/explore?q=iphone&geo=GB&date=now%207-d\"}]. Default [] adds none. Requires explore; combines with searchTerms. q, geo and date override geo/timeRange for each URL; UI URLs are never fetched. All jobs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed URLs fail validation.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "geo": {
            "title": "Explore country or subregion code",
            "type": "string",
            "description": "Set an explore country/subregion, e.g. US or US-CA; default \"\" requests worldwide. Applies to searchTerms unless geos is nonempty; a startUrls geo parameter overrides it. Ignored in trendingNow, which uses trendingGeos. All locations share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed codes fail validation.",
            "default": ""
          },
          "geos": {
            "title": "Explore country or subregion codes",
            "type": "array",
            "description": "Request searchTerms in each explore location, e.g. [\"US\",\"GB\",\"US-CA\"]. Default [] uses geo; nonempty overrides geo. Does not override startUrls geo parameters; ignored in trendingNow. All locations, terms and outputs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed codes fail validation.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "timeRange": {
            "title": "Relative period or custom date pair",
            "type": "string",
            "description": "Choose an explore period: now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m (default), today 5-y, all, or YYYY-MM-DD YYYY-MM-DD. startUrls date overrides it; ignored in trendingNow. All periods and outputs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed ranges fail validation.",
            "default": "today 12-m"
          },
          "outputs": {
            "title": "Explore datasets to return",
            "type": "array",
            "description": "Select explore datasets: interestOverTime, interestByRegion, relatedQueries, relatedTopics. Default (or []) requests all four; ignored in trendingNow. Requires searchTerms or startUrls. relatedTopics is best effort and may be empty. All selected outputs and targets share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED.",
            "items": {
              "type": "string",
              "enum": [
                "interestOverTime",
                "interestByRegion",
                "relatedQueries",
                "relatedTopics"
              ]
            },
            "default": [
              "interestOverTime",
              "interestByRegion",
              "relatedQueries",
              "relatedTopics"
            ]
          },
          "category": {
            "title": "Google Trends category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Filter explore by a nonnegative Google category ID, e.g. 7 for Finance. Default 0 includes all categories. Used with searchTerms and startUrls; ignored in trendingNow. All filtered targets and outputs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed IDs fail validation.",
            "default": 0
          },
          "property": {
            "title": "Search property web images news shopping or YouTube",
            "enum": [
              "",
              "web",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Select web (default; \"\" also means web), images, news, froogle (Shopping), or youtube. Filters explore searchTerms and startUrls; ignored in trendingNow. All filtered targets and outputs share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; unknown choices fail validation.",
            "default": "web"
          },
          "regionResolution": {
            "title": "Region granularity auto country region metro or city",
            "enum": [
              "auto",
              "COUNTRY",
              "REGION",
              "DMA",
              "CITY"
            ],
            "type": "string",
            "description": "Choose auto (default: Google chooses), COUNTRY, REGION, DMA (US metros), or CITY. Applies only when explore outputs includes interestByRegion; availability depends on geo/geos or startUrls. Ignored for other outputs and trendingNow. All regions share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; unknown choices fail validation.",
            "default": "auto"
          },
          "trendingGeos": {
            "title": "Trending Now country codes",
            "type": "array",
            "description": "Choose country codes for trendingNow, e.g. [\"US\",\"GB\",\"DE\"]. Default [\"US\"] requests the US RSS feed; ignored in explore. Uses these countries instead of geo/geos and ignores explore filters. RSS can return fewer rows than requested. All countries share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed codes fail validation.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum dataset rows across the run",
            "minimum": 1,
            "type": "integer",
            "description": "Cap dataset rows across all terms, comparison groups, URLs, countries and outputs. Positive integer, default 1000. Applies to both modes; comparisons can produce multiple rows per time point. Stops saving at this shared limit; skipped targets appear in RUN_SUMMARY. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed limits fail validation.",
            "default": 1000
          },
          "language": {
            "title": "Google label language code",
            "type": "string",
            "description": "Set Google label language, e.g. en-US (default) or de. Used in explore requests and topic lookups in both modes; does not change supplied terms or RSS news language. Works with timezoneOffset for explore labels. All targets share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed language codes fail validation.",
            "default": "en-US"
          },
          "timezoneOffset": {
            "title": "Timezone offset (minutes)",
            "type": "integer",
            "description": "Set integer Google tz minutes from -1440 to 1440; default 0 uses UTC, e.g. 300 for UTC-5. Used with language for explore buckets and topic lookups; not an IANA timezone or RSS publication-time conversion. All targets share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; malformed offsets fail validation.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy settings for Google requests",
            "type": "object",
            "description": "Configure Google requests in both modes. Default uses Apify RESIDENTIAL proxy. Temporary blocks retry with backoff on a fresh session; no CAPTCHA solving. Applies to all targets independently of filters; all targets share maxItems. Bad, blocked or empty targets yield 0 items and SUCCEEDED; RUN_SUMMARY reports persistent blocks.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "trendingMinTraffic": {
            "title": "Minimum trending traffic",
            "minimum": 0,
            "type": "integer",
            "description": "Keep Trending Now RSS rows whose approxTrafficNumber lower bound is at least this number. Default 0 disables filtering. Rows with missing traffic are excluded when enabled; explore mode ignores this field. Filters apply before the shared maxItems limit.",
            "default": 0
          },
          "trendingMaxAgeHours": {
            "title": "Maximum publication age in hours",
            "minimum": 0,
            "type": "number",
            "description": "Keep Trending Now RSS rows published within this many hours of the run. Default 0 disables filtering. Uses pubDate, not the trend start time. Missing publication dates are excluded when enabled; explore mode ignores this field.",
            "default": 0
          },
          "resolveTrendingTopics": {
            "title": "Resolve Trending Now topics",
            "type": "boolean",
            "description": "Look up Knowledge Graph topicTitle, topicType and topicMid for each Trending Now title. Default true preserves topic lookup. Set false for RSS-only runs with fewer upstream requests; topic fields can then be absent. Explore topic lookup is unchanged.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}