{
  "openapi": "3.0.1",
  "info": {
    "title": "Topic Trends - Google Trends Alternative from Wikipedia Data",
    "description": "Interest over time for any topic, compared on a 0-100 scale like Google Trends, from official Wikipedia pageview data (2015 to yesterday): daily, weekly or monthly timeline, peak, trend, spikes and interest by language. Plus trending topics per country. No Google scraping, no blocks.",
    "version": "1.0",
    "x-build-id": "ept1FjJ9xryDLgjWI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kantolabs~wikipedia-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kantolabs-wikipedia-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/kantolabs~wikipedia-trends/runs": {
      "post": {
        "operationId": "runs-sync-kantolabs-wikipedia-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/kantolabs~wikipedia-trends/run-sync": {
      "post": {
        "operationId": "run-sync-kantolabs-wikipedia-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": "Mode",
            "enum": [
              "topics",
              "trending"
            ],
            "type": "string",
            "description": "**Topics**: interest over time for your keywords. **Trending**: the most-read topics of a day, per Wikipedia language edition and/or per country.",
            "default": "topics"
          },
          "keywords": {
            "title": "Keywords / topics",
            "type": "array",
            "description": "One topic per line: a keyword (`bitcoin`), an exact article title (`Apple Inc.`) or a Wikipedia URL. Each is matched to one Wikipedia article (disambiguation pages are skipped). All keywords of a run share one 0-100 scale, so you can compare them. Up to 200.",
            "default": [
              "ChatGPT",
              "Bitcoin",
              "Taylor Swift"
            ],
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Wikipedia language",
            "type": "string",
            "description": "Language edition used to match keywords (and the default trending list): `en`, `de`, `fr`, `es`, `ja`, `pt`, `it`, `ru`, `zh`, `pl`, `nl`, `ko`... Wikipedia URLs keep their own language.",
            "default": "en"
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "past7Days",
              "past30Days",
              "past90Days",
              "past12Months",
              "past5Years",
              "all",
              "custom"
            ],
            "type": "string",
            "description": "Period to analyse. Data starts on 2015-07-01 and ends yesterday (UTC). Ignored when a start or end date is set.",
            "default": "past90Days"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Optional custom start, YYYY-MM-DD."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional custom end, YYYY-MM-DD (default: yesterday)."
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "auto",
              "daily",
              "weekly",
              "monthly"
            ],
            "type": "string",
            "description": "Auto = daily up to 3 months, weekly up to about 2 years, monthly beyond (like Google Trends).",
            "default": "auto"
          },
          "includeRedirects": {
            "title": "Count redirects (old names, spellings)",
            "type": "boolean",
            "description": "Add the views of titles that redirect to the article (the 12 newest, which include old names after a rename; main language only). Without this, a renamed topic looks like it started from zero on the rename date.",
            "default": true
          },
          "includeLanguages": {
            "title": "Interest by language",
            "type": "boolean",
            "description": "Also count views of the same topic in other language editions (the closest open-data equivalent to interest by region).",
            "default": true
          },
          "maxLanguages": {
            "title": "Max languages",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many of the largest language editions to include in the language breakdown.",
            "default": 10
          },
          "platform": {
            "title": "Platform",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "Count views from all devices, desktop only or mobile only.",
            "default": "all-access"
          },
          "trendingCountries": {
            "title": "Trending: countries",
            "type": "array",
            "description": "Trending mode: two-letter country codes (`US`, `GB`, `DE`, `IN`, `JP`...). Returns the most-read Wikipedia articles from readers in that country (Wikimedia rounds these views up to the nearest 100 for privacy).",
            "items": {
              "type": "string"
            }
          },
          "trendingProjects": {
            "title": "Trending: language editions",
            "type": "array",
            "description": "Trending mode: language codes or projects (`en`, `de.wikipedia`...). If neither countries nor editions are set, the edition from Wikipedia language is used.",
            "items": {
              "type": "string"
            }
          },
          "trendingDate": {
            "title": "Trending: date",
            "type": "string",
            "description": "Trending mode: day to list, YYYY-MM-DD. Default: the latest published day (usually yesterday)."
          },
          "maxTrending": {
            "title": "Trending: articles per list",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many top articles to return per country / edition (main pages and special pages are removed).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}