{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia trending - top pageviews by day/country (API)",
    "description": "The 1,000 most-viewed Wikipedia articles for a day - per project (en.wikipedia, de.wikipedia, ...) or per country - plus daily view series for chosen articles, from the Wikimedia Pageviews API. Rank, article, views, date, link. Default: yesterday's English top 200.",
    "version": "0.1",
    "x-build-id": "Y3wuJdQVKLQ39hzPj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/retrainmapdata~wikipedia-trending/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-retrainmapdata-wikipedia-trending",
        "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/retrainmapdata~wikipedia-trending/runs": {
      "post": {
        "operationId": "runs-sync-retrainmapdata-wikipedia-trending",
        "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/retrainmapdata~wikipedia-trending/run-sync": {
      "post": {
        "operationId": "run-sync-retrainmapdata-wikipedia-trending",
        "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": [
              "top",
              "top_per_country",
              "article_series"
            ],
            "type": "string",
            "description": "`top`: the 1,000 most-viewed pages of a project on one day. `top_per_country`: the 1,000 most-viewed pages from one country (counts are ceilings). `article_series`: daily views of the given articles over a date range.",
            "default": "top"
          },
          "project": {
            "title": "Project",
            "type": "string",
            "description": "Wikimedia project, e.g. en.wikipedia, de.wikipedia, es.wikipedia, commons.wikimedia (or all-projects for `top`). Ignored in top_per_country mode, where each row carries its own project.",
            "default": "en.wikipedia"
          },
          "country": {
            "title": "Country (top_per_country)",
            "type": "string",
            "description": "Two-letter ISO 3166-1 country code, e.g. US, GB, IN, DE.",
            "default": "US"
          },
          "date": {
            "title": "Date (top modes)",
            "type": "string",
            "description": "YYYY-MM-DD (UTC day). Leave empty for yesterday; if Wikimedia has not published yesterday yet, the Actor uses the day before and says so."
          },
          "access": {
            "title": "Access method",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "Which traffic to count.",
            "default": "all-access"
          },
          "articles": {
            "title": "Articles (article_series)",
            "uniqueItems": true,
            "type": "array",
            "description": "Article titles as on Wikipedia (spaces or underscores), e.g. \"Python (programming language)\". Used only in article_series mode.",
            "items": {
              "type": "string"
            }
          },
          "start_date": {
            "title": "Start date (article_series)",
            "type": "string",
            "description": "YYYY-MM-DD. Default: 29 days before the end date."
          },
          "end_date": {
            "title": "End date (article_series)",
            "type": "string",
            "description": "YYYY-MM-DD. Default: yesterday (UTC)."
          },
          "agent": {
            "title": "Agent type (article_series)",
            "enum": [
              "user",
              "all-agents",
              "spider",
              "automated"
            ],
            "type": "string",
            "description": "Traffic class for the per-article series. `user` excludes spiders and automated traffic.",
            "default": "user"
          },
          "exclude_non_articles": {
            "title": "Exclude Main_Page and non-article namespaces",
            "type": "boolean",
            "description": "Drops Main_Page, '-', and pages whose title starts with an English namespace prefix (Special:, Wikipedia:, File:, Portal:, Help:, Template:, Category:, Talk:, User:, ...). Ranks keep their original numbers, so gaps show what was dropped.",
            "default": true
          },
          "max_records": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows (a top list has at most 1,000 entries).",
            "default": 200
          },
          "request_interval_ms": {
            "title": "Minimum interval between requests (ms)",
            "minimum": 100,
            "maximum": 10000,
            "type": "integer",
            "description": "Politeness delay towards wikimedia.org (floor 100 ms; the API rule is at most 100 requests per second). Top modes make one request.",
            "default": 250
          },
          "contact_email": {
            "title": "Contact e-mail (User-Agent and From: header)",
            "type": "string",
            "description": "Wikimedia requires a User-Agent with contact details. Sent in the User-Agent and in the standard From: request header (RFC 9110 s10.1.2).",
            "default": "info@steelyardclinical.com"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}