{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Trends Scraper: Compare Terms, Trending Now",
    "description": "Google Trends for people and AI agents: compare up to 5 terms on one scale over time and by region, with related queries and a rising or falling summary per term; plus every search trending now in a country, with volume, category and the news behind it.",
    "version": "0.2",
    "x-build-id": "OGIDVOYd9gvCsCdVZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pinescore~google-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pinescore-google-trends",
        "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/pinescore~google-trends/runs": {
      "post": {
        "operationId": "runs-sync-pinescore-google-trends",
        "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/pinescore~google-trends/run-sync": {
      "post": {
        "operationId": "run-sync-pinescore-google-trends",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "keywords",
              "trendingNow"
            ],
            "type": "string",
            "description": "Keyword lookup: interest over time, by region and related queries for your terms. Trending now: every search trending in a country over the past 4 hours to 7 days, with search volume, category, related searches and the news headlines behind it.",
            "default": "keywords"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keyword lookup only. With 'Compare terms' on, up to 5 at a time share one 0 to 100 scale, exactly like the Google Trends website.",
            "items": {
              "type": "string"
            }
          },
          "compareTerms": {
            "title": "Compare terms on one scale",
            "type": "boolean",
            "description": "On: terms are compared in groups of up to 5. Off: each term is looked up on its own.",
            "default": true
          },
          "geo": {
            "title": "Country or region code",
            "type": "string",
            "description": "ISO code such as GB, US or US-CA (capitals). Leave empty for worldwide (keyword lookup) or US (trending now).",
            "default": ""
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "now 1-H",
              "now 4-H",
              "now 1-d",
              "now 7-d",
              "today 1-m",
              "today 3-m",
              "today 12-m",
              "today 5-y",
              "all"
            ],
            "type": "string",
            "description": "The period to cover.",
            "default": "today 12-m"
          },
          "category": {
            "title": "Category ID",
            "minimum": 0,
            "type": "integer",
            "description": "Google Trends category number; 0 means all categories.",
            "default": 0
          },
          "searchProperty": {
            "title": "Search type",
            "enum": [
              "",
              "images",
              "news",
              "froogle",
              "youtube"
            ],
            "type": "string",
            "description": "Which Google search to measure.",
            "default": ""
          },
          "includeRegions": {
            "title": "Interest by region",
            "type": "boolean",
            "description": "Add interest by country, or by region within the chosen country.",
            "default": true
          },
          "includeRelatedQueries": {
            "title": "Related queries",
            "type": "boolean",
            "description": "Add top and rising related queries for each term.",
            "default": true
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language code for labels and headlines, such as en-US or en-GB.",
            "default": "en-US"
          },
          "maxAttempts": {
            "title": "Attempts per lookup",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many fresh proxy sessions to try before giving up on a lookup.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Google limits repeated requests; residential proxies are the most reliable.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "trendingWindow": {
            "title": "Trending window",
            "enum": [
              "4h",
              "24h",
              "48h",
              "7d"
            ],
            "type": "string",
            "description": "Trending now only: how far back to look. Past 24 hours matches the Trending Now page's default.",
            "default": "24h"
          },
          "trendingCategories": {
            "title": "Trending categories",
            "type": "array",
            "description": "Trending now only: keep searches in any of these categories. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "Autos and Vehicles",
                "Beauty and Fashion",
                "Business and Finance",
                "Climate",
                "Entertainment",
                "Food and Drink",
                "Games",
                "Health",
                "Hobbies and Leisure",
                "Jobs and Education",
                "Law and Government",
                "Other",
                "Pets and Animals",
                "Politics",
                "Science",
                "Shopping",
                "Sports",
                "Technology",
                "Travel and Transportation"
              ]
            },
            "default": []
          },
          "activeOnly": {
            "title": "Still trending only",
            "type": "boolean",
            "description": "Trending now only: leave out searches whose trend has already ended.",
            "default": false
          },
          "newsPerTrend": {
            "title": "Headlines per trend",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Trending now only: news articles to add to each trending search (0 for none).",
            "default": 3
          },
          "maxItems": {
            "title": "Trending searches to return",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Trending now only: how many trending searches to return, biggest first.",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}