{
  "openapi": "3.0.1",
  "info": {
    "title": "Website Traffic Analytics API - Visits, Engagement, Ranks",
    "description": "Get estimated website traffic and engagement for any list of domains: visits, page views, pages per visit, bounce rate, average visit duration, device split, global rank, country rank and industry rank. Pay per result. Bring your own API key.",
    "version": "0.1",
    "x-build-id": "HzqoEIxDYJGQLVdRa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~website-traffic-analytics-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-website-traffic-analytics-api",
        "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/nabeelbaghoor~website-traffic-analytics-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-website-traffic-analytics-api",
        "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/nabeelbaghoor~website-traffic-analytics-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-website-traffic-analytics-api",
        "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",
        "required": [
          "domains"
        ],
        "properties": {
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "The websites to analyse, one per line, e.g. `example.com`. Full URLs are accepted and reduced to their host automatically, and `www.` is stripped. Each domain is queried for every selected metric.",
            "items": {
              "type": "string"
            }
          },
          "metrics": {
            "title": "Metrics",
            "type": "array",
            "description": "Which metrics to collect for each domain. Each selected metric is one request per domain against your own account, so pick only what you need.",
            "items": {
              "type": "string",
              "enum": [
                "visits",
                "pageViews",
                "pagesPerVisit",
                "bounceRate",
                "averageVisitDuration",
                "deviceSplit",
                "globalRank",
                "countryRank",
                "industryRank"
              ]
            },
            "default": [
              "visits",
              "pagesPerVisit",
              "bounceRate",
              "averageVisitDuration",
              "globalRank"
            ]
          },
          "startDate": {
            "title": "Start month",
            "type": "string",
            "description": "First month to report, in `YYYY-MM` format, e.g. `2026-01`. Leave both dates blank to get the most recent 28 days instead."
          },
          "endDate": {
            "title": "End month",
            "type": "string",
            "description": "Last month to report, in `YYYY-MM` format, e.g. `2026-06`. Leave both dates blank to get the most recent 28 days instead."
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "monthly",
              "weekly",
              "daily"
            ],
            "type": "string",
            "description": "How finely to break the period down. Daily and weekly data need a subscription that includes them.",
            "default": "monthly"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter ISO country code to report on, e.g. `us`, `gb`, `de`, or `world` for worldwide. Defaults to `world`. Only countries your subscription covers will return data.",
            "default": "world"
          },
          "mainDomainOnly": {
            "title": "Main domain only",
            "type": "boolean",
            "description": "When enabled, report the main domain only and exclude its subdomains. Off by default.",
            "default": false
          },
          "monthToDate": {
            "title": "Month to date",
            "type": "boolean",
            "description": "When enabled, the end date is moved to the latest day of data available in the current month.",
            "default": false
          },
          "showVerified": {
            "title": "Show verified data",
            "type": "boolean",
            "description": "When enabled, include shared analytics data for sites that have verified their traffic, where available.",
            "default": false
          },
          "engagedVisitsOnly": {
            "title": "Engaged visits only",
            "type": "boolean",
            "description": "When enabled, engagement metrics are filtered to engaged visits only.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows (1-5,000). One row is one domain and one period, so twelve months of monthly data for one domain is twelve rows. You are charged per row returned."
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own API key for the data provider. Required. An administrator generates it in your account settings, and it must be switched on in the activation column before it returns data. Stored securely and never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}