{
  "openapi": "3.0.1",
  "info": {
    "title": "Viral Tweets Tracker: X (Twitter) Posts, Videos & Articles",
    "description": "Viral tweets for any topic, account or trend: the X posts, videos and articles with the most likes, reposts and views, plus engagement rate and likes per hour. Official X API with your own key: no cookies, no proxies, no X login.",
    "version": "0.1",
    "x-build-id": "EK2bqx8xqCtCdL6Jm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/m_ctim~viral-tweets-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-m_ctim-viral-tweets-tracker",
        "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/m_ctim~viral-tweets-tracker/runs": {
      "post": {
        "operationId": "runs-sync-m_ctim-viral-tweets-tracker",
        "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/m_ctim~viral-tweets-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-m_ctim-viral-tweets-tracker",
        "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": {
          "xBearerToken": {
            "title": "X API Bearer Token",
            "type": "string",
            "description": "Your own X API Bearer Token. At console.x.com, create an app, add pay-per-use credits, then copy the Bearer Token from the app's \"Keys and tokens\" page. It's stored encrypted, sent only to api.x.com and never logged. X bills your developer account for what each search returns, at its own prices (October 2026: $0.005 a post, $0.010 a user profile). Without a token the run only explains this, free."
          },
          "topics": {
            "title": "Topics",
            "type": "array",
            "description": "Keywords, #hashtags, $cashtags or @mentions. Each one is its own search. Several words are searched as an exact phrase; write your own X search query (with OR, quotes or operators like url:) for anything else. Leave Topics and Accounts empty to search what's trending instead.",
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "title": "Accounts",
            "type": "array",
            "description": "X handles (like \"nasa\", \"@nasa\" or \"x.com/nasa\") whose posts that pass the filters below you want back. Accounts are searched together in as few searches as fit X's 512-character query limit.",
            "items": {
              "type": "string"
            }
          },
          "trendsLocation": {
            "title": "Trends from",
            "enum": [
              "worldwide",
              "us",
              "uk",
              "canada",
              "australia",
              "india",
              "nigeria",
              "kenya",
              "south_africa",
              "germany",
              "france",
              "spain",
              "brazil",
              "mexico",
              "japan",
              "philippines"
            ],
            "type": "string",
            "description": "Where X's trending topics come from. Each trend becomes one search, and the trends themselves are saved as free rows. X bills one trends request at $0.010.",
            "default": "worldwide"
          },
          "trendCount": {
            "title": "Number of trends",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many of the top trends to search, from 1 to 20.",
            "default": 5
          },
          "contentType": {
            "title": "Content",
            "enum": [
              "all",
              "videos",
              "images",
              "articles",
              "text"
            ],
            "type": "string",
            "description": "Which posts to keep. Videos means native X videos. Articles keeps X Articles and posts that link to a page outside X; X still returns, and bills, the other posts with links, which are then left out.",
            "default": "all"
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes, 0 or more. X applies it in the search itself, so posts below it are never returned or billed.",
            "default": 500
          },
          "minReposts": {
            "title": "Minimum reposts",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many reposts, 0 or more (0 means no minimum). Applied by X in the search.",
            "default": 0
          },
          "minReplies": {
            "title": "Minimum replies",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many replies, 0 or more (0 means no minimum). Applied by X in the search.",
            "default": 0
          },
          "sinceHours": {
            "title": "Posted in the last (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "How far back to look, from 1 to 168 hours. X's recent search reaches back 7 days.",
            "default": 24
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Only posts X classifies as this language: a two-letter code like \"en\", \"es\" or \"ja\". Leave empty for every language."
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also return replies that pass the filters. Off by default, so you get original posts and quotes. Reposts are never returned; the original post is.",
            "default": false
          },
          "verifiedOnly": {
            "title": "Verified accounts only",
            "type": "boolean",
            "description": "Only posts from accounts X marks as verified.",
            "default": false
          },
          "maxPostsPerSearch": {
            "title": "Max posts per search",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Most posts each topic, trend or account group returns, from 10 to 500. X picks the most relevant first. This caps what X bills too.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "engagements",
              "views",
              "likes",
              "likesPerHour",
              "newest"
            ],
            "type": "string",
            "description": "Order of the saved posts across all searches.",
            "default": "engagements"
          },
          "includeAuthorDetails": {
            "title": "Include author details",
            "type": "boolean",
            "description": "Each post's author handle, name, followers and verified badge, plus views per follower. Turn off to save on X's bill, where user profiles cost more than posts; post links then use x.com/i/status/ID.",
            "default": true
          },
          "onlyNew": {
            "title": "Only posts not returned before",
            "type": "boolean",
            "description": "For scheduled runs: skip posts an earlier run with this on already returned (remembered in a key-value store in your account named viral-tweets-tracker-seen). Skipped posts aren't charged here, but X still bills their read.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}