{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# TikTok imports"
      ],
      "metadata": {
        "id": "rZuqiqeUo5vd"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import pandas as pd\n",
        "import time\n",
        "from tqdm.auto import tqdm\n",
        "\n",
        "import requests\n",
        "from datetime import datetime"
      ],
      "metadata": {
        "id": "jX9Vk2x69fzO"
      },
      "execution_count": 80,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "!pip install ensembledata\n",
        "from ensembledata.api import EDClient"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "b4mxUt-YFubD",
        "outputId": "e832eedf-811f-4003-cc04-fb85e6124a2f"
      },
      "execution_count": 81,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Requirement already satisfied: ensembledata in /usr/local/lib/python3.13/dist-packages (0.2.11)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.13/dist-packages (from ensembledata) (0.28.1)\n",
            "Requirement already satisfied: anyio in /usr/local/lib/python3.13/dist-packages (from httpx->ensembledata) (4.15.1)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.13/dist-packages (from httpx->ensembledata) (2026.10.23)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.13/dist-packages (from httpx->ensembledata) (1.0.9)\n",
            "Requirement already satisfied: idna in /usr/local/lib/python3.13/dist-packages (from httpx->ensembledata) (3.20)\n",
            "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.13/dist-packages (from httpcore==1.*->httpx->ensembledata) (0.16.0)\n",
            "Requirement already satisfied: typing_extensions>=4.16.0 in /usr/local/lib/python3.13/dist-packages (from anyio->httpx->ensembledata) (4.16.0)\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# initialize the ensembledata client\n",
        "client = EDClient(\"A7ei2QCOcgyvJV2e\")\n",
        "\n",
        "# get a free token at https://dashboard.ensembledata.com/register\n",
        "# free trial of 50 units per day for 7 days, starting 23/11/24\n",
        "#\n",
        "# costs:\n",
        "#  - 1 unit = 200 posts in full_hashtag_search :)\n",
        "#  - 1 unit = 20 posts in hashtag_search\n",
        "#  - 1 unit = 20 posts in keyword_search or full_keyword_search :(\n",
        "#  - 1 unit = 30 comments to a post\n",
        "#  - 1 unit = 30 replies to a comment\n",
        "#\n",
        "# documentation available at https://ensembledata.com/apis/docs#tag/Tiktok\n",
        "# and https://github.com/EnsembleData/tiktok-scraper\n",
        "# source code available at\n",
        "# https://github.com/EnsembleData/ensembledata-python/tree/main/ensembledata/api"
      ],
      "metadata": {
        "id": "W8LB9hnDF6iy"
      },
      "execution_count": 82,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Read posts from TikTok"
      ],
      "metadata": {
        "id": "Xa8nder-pL_v"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Hashtag search (200 posts at the cost of 1 unit)"
      ],
      "metadata": {
        "id": "6bRQouOeM1DL"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# read posts related to an hashtag\n",
        "result = client.tiktok.full_hashtag_search(\n",
        "                hashtag = \"vintage\", # hashtag name\n",
        "                days = 360, # filter out posts created more than N days ago\n",
        "                remap_output = True, # False for mobile app, True for web\n",
        "                max_cursor = 200) # max number of posts fetched,\n",
        "                                  # cost is 1 unit per 200 posts"
      ],
      "metadata": {
        "id": "iz_7RaG38aS1"
      },
      "execution_count": 83,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# convert json to dataframe\n",
        "df = pd.json_normalize(result.data[\"posts\"])\n",
        "\n",
        "# extract relevant info\n",
        "df = df[['itemInfos.id', 'itemInfos.createTime',\n",
        "         'authorInfos.uniqueId', 'itemInfos.authorId',\n",
        "         'itemInfos.text', 'itemInfos.video.urls', 'itemInfos.shareCount',\n",
        "         'itemInfos.playCount', 'itemInfos.commentCount']]\n",
        "\n",
        "# rename columns\n",
        "df.columns = ['id', 'createTime', 'authorName', 'authorId', 'text', 'video.urls',\n",
        "              'shareCount', 'playCount', 'commentCount']\n",
        "\n",
        "# format time to date in string format and sort by data\n",
        "df[\"createTime\"] = [str(datetime.fromtimestamp(int(i)).date())\n",
        "                                                for i in df[\"createTime\"]]\n",
        "df.sort_values(by='createTime', ascending=False, inplace=True, ignore_index=True) # sort by time\n",
        "\n",
        "# save\n",
        "df_hashtag = df\n",
        "df_hashtag.to_csv('tiktok_hashtag_posts.csv', index=False)"
      ],
      "metadata": {
        "id": "DOeK6xo6Fhq0"
      },
      "execution_count": 84,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "display(df_hashtag)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 635
        },
        "id": "WKPZM3muGi-o",
        "outputId": "99cc9f48-4352-4c68-d501-83de2a386bf5"
      },
      "execution_count": 85,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "                     id  createTime         authorName             authorId  \\\n",
              "0   7704930008602610974  2026-11-06   nostalgiapuraaa1  7271025388419400750   \n",
              "1   7705049583528791329  2026-11-06         ninaskocak  6797346651242775557   \n",
              "2   7704984991712906517  2026-11-06          greysia90  6836313392257549314   \n",
              "3   7704891647431085325  2026-11-06       bryson_keith  6770986836456244229   \n",
              "4   7705016073392803092  2026-11-06            basucks  7536690586608124946   \n",
              "..                  ...         ...                ...                  ...   \n",
              "83  7593443819014638879  2026-01-09          shan88071  7373221733023581227   \n",
              "84  7590189123269414174  2026-01-01      80stoys.r.rad  6857426496056869893   \n",
              "85  7589332863116463390  2025-12-29     adelinepresley  7588680463797371917   \n",
              "86  7587559452476296470  2025-12-24     opheliavintage  7585272611854156822   \n",
              "87  7585679956596788511  2025-12-19  reciprocate.today  7043966281611953157   \n",
              "\n",
              "                                                 text  \\\n",
              "0   Há mais de 100 anos, os pequenos já eram levad...   \n",
              "1   40 godina sjedenja u ormaru ipak učine svoje 🥲...   \n",
              "2   blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...   \n",
              "3   My favorite retro headphones just got an upgra...   \n",
              "4   sueda’nın çantalarını incelerken ekran sürem 2...   \n",
              "..                                                ...   \n",
              "83                       #vintage#y2k#fyp#fypシ#viral    \n",
              "84  I recently found my favorite Trapper Keeper, I...   \n",
              "85  So pretty #vintage #dreams #oldthings #shabbyc...   \n",
              "86  #vintage #fypシ゚ #thrifting #antique #vintageje...   \n",
              "87  I’m soo inlove #thrifted #vintagefashion #vint...   \n",
              "\n",
              "                                           video.urls  shareCount  playCount  \\\n",
              "0   [https://v19.tiktokcdn-eu.com/d2e6033b92c0bb94...         228      44729   \n",
              "1   [https://v45.tiktokcdn-eu.com/be6f5c17c2a4afdd...          81     113181   \n",
              "2   [https://v45.tiktokcdn-eu.com/9bc854bf06789281...         237     131969   \n",
              "3   [https://v19.tiktokcdn-eu.com/721da200f9aed4c6...          47      20823   \n",
              "4   [https://v19.tiktokcdn-eu.com/46657c10ee2e5aaa...          44      45360   \n",
              "..                                                ...         ...        ...   \n",
              "83  [https://v19.tiktokcdn-eu.com/21312bd1835d303e...       17662    6464202   \n",
              "84  [https://v45.tiktokcdn-eu.com/826695f2e824b939...       20788     981593   \n",
              "85  [https://v45.tiktokcdn-eu.com/6af3e04b77a7e9e7...       10242     845022   \n",
              "86  [https://v58.tiktokcdn-eu.com/video/tos/useast...       13135    1448612   \n",
              "87  [https://v19.tiktokcdn-eu.com/9590bfd6600a47df...        1635     355082   \n",
              "\n",
              "    commentCount  \n",
              "0             29  \n",
              "1             18  \n",
              "2            129  \n",
              "3             19  \n",
              "4             18  \n",
              "..           ...  \n",
              "83          2706  \n",
              "84          5827  \n",
              "85           388  \n",
              "86           535  \n",
              "87           226  \n",
              "\n",
              "[88 rows x 9 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-64244f85-60f9-46be-a73c-7006d18f25c4\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>id</th>\n",
              "      <th>createTime</th>\n",
              "      <th>authorName</th>\n",
              "      <th>authorId</th>\n",
              "      <th>text</th>\n",
              "      <th>video.urls</th>\n",
              "      <th>shareCount</th>\n",
              "      <th>playCount</th>\n",
              "      <th>commentCount</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7704930008602610974</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>nostalgiapuraaa1</td>\n",
              "      <td>7271025388419400750</td>\n",
              "      <td>Há mais de 100 anos, os pequenos já eram levad...</td>\n",
              "      <td>[https://v19.tiktokcdn-eu.com/d2e6033b92c0bb94...</td>\n",
              "      <td>228</td>\n",
              "      <td>44729</td>\n",
              "      <td>29</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7705049583528791329</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>ninaskocak</td>\n",
              "      <td>6797346651242775557</td>\n",
              "      <td>40 godina sjedenja u ormaru ipak učine svoje 🥲...</td>\n",
              "      <td>[https://v45.tiktokcdn-eu.com/be6f5c17c2a4afdd...</td>\n",
              "      <td>81</td>\n",
              "      <td>113181</td>\n",
              "      <td>18</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7704984991712906517</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>greysia90</td>\n",
              "      <td>6836313392257549314</td>\n",
              "      <td>blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...</td>\n",
              "      <td>[https://v45.tiktokcdn-eu.com/9bc854bf06789281...</td>\n",
              "      <td>237</td>\n",
              "      <td>131969</td>\n",
              "      <td>129</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7704891647431085325</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>bryson_keith</td>\n",
              "      <td>6770986836456244229</td>\n",
              "      <td>My favorite retro headphones just got an upgra...</td>\n",
              "      <td>[https://v19.tiktokcdn-eu.com/721da200f9aed4c6...</td>\n",
              "      <td>47</td>\n",
              "      <td>20823</td>\n",
              "      <td>19</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7705016073392803092</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>basucks</td>\n",
              "      <td>7536690586608124946</td>\n",
              "      <td>sueda’nın çantalarını incelerken ekran sürem 2...</td>\n",
              "      <td>[https://v19.tiktokcdn-eu.com/46657c10ee2e5aaa...</td>\n",
              "      <td>44</td>\n",
              "      <td>45360</td>\n",
              "      <td>18</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>83</th>\n",
              "      <td>7593443819014638879</td>\n",
              "      <td>2026-01-09</td>\n",
              "      <td>shan88071</td>\n",
              "      <td>7373221733023581227</td>\n",
              "      <td>#vintage#y2k#fyp#fypシ#viral</td>\n",
              "      <td>[https://v19.tiktokcdn-eu.com/21312bd1835d303e...</td>\n",
              "      <td>17662</td>\n",
              "      <td>6464202</td>\n",
              "      <td>2706</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>84</th>\n",
              "      <td>7590189123269414174</td>\n",
              "      <td>2026-01-01</td>\n",
              "      <td>80stoys.r.rad</td>\n",
              "      <td>6857426496056869893</td>\n",
              "      <td>I recently found my favorite Trapper Keeper, I...</td>\n",
              "      <td>[https://v45.tiktokcdn-eu.com/826695f2e824b939...</td>\n",
              "      <td>20788</td>\n",
              "      <td>981593</td>\n",
              "      <td>5827</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>85</th>\n",
              "      <td>7589332863116463390</td>\n",
              "      <td>2025-12-29</td>\n",
              "      <td>adelinepresley</td>\n",
              "      <td>7588680463797371917</td>\n",
              "      <td>So pretty #vintage #dreams #oldthings #shabbyc...</td>\n",
              "      <td>[https://v45.tiktokcdn-eu.com/6af3e04b77a7e9e7...</td>\n",
              "      <td>10242</td>\n",
              "      <td>845022</td>\n",
              "      <td>388</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>86</th>\n",
              "      <td>7587559452476296470</td>\n",
              "      <td>2025-12-24</td>\n",
              "      <td>opheliavintage</td>\n",
              "      <td>7585272611854156822</td>\n",
              "      <td>#vintage #fypシ゚ #thrifting #antique #vintageje...</td>\n",
              "      <td>[https://v58.tiktokcdn-eu.com/video/tos/useast...</td>\n",
              "      <td>13135</td>\n",
              "      <td>1448612</td>\n",
              "      <td>535</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>87</th>\n",
              "      <td>7585679956596788511</td>\n",
              "      <td>2025-12-19</td>\n",
              "      <td>reciprocate.today</td>\n",
              "      <td>7043966281611953157</td>\n",
              "      <td>I’m soo inlove #thrifted #vintagefashion #vint...</td>\n",
              "      <td>[https://v19.tiktokcdn-eu.com/9590bfd6600a47df...</td>\n",
              "      <td>1635</td>\n",
              "      <td>355082</td>\n",
              "      <td>226</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>88 rows × 9 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-64244f85-60f9-46be-a73c-7006d18f25c4')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-64244f85-60f9-46be-a73c-7006d18f25c4 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-64244f85-60f9-46be-a73c-7006d18f25c4');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_bac9e723-f8a6-43bc-ae86-9715393cc9d7\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_bac9e723-f8a6-43bc-ae86-9715393cc9d7 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 88,\n  \"fields\": [\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 88,\n        \"samples\": [\n          \"7608358088600554782\",\n          \"7704930008602610974\",\n          \"7701771539846319390\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"createTime\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 60,\n        \"samples\": [\n          \"2026-11-06\",\n          \"2026-10-29\",\n          \"2026-05-25\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorName\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 84,\n        \"samples\": [\n          \"flotus_48\",\n          \"nostalgiapuraaa1\",\n          \"allaboutfashion56\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorId\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 84,\n        \"samples\": [\n          \"6944080874737828870\",\n          \"7271025388419400750\",\n          \"7525524782633583630\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 88,\n        \"samples\": [\n          \"take all my money #antiquestore #antiquestorefinds #thrifting #trending#vintage \",\n          \"H\\u00e1 mais de 100 anos, os pequenos j\\u00e1 eram levados para passear em seus carrinhos, pelas ruas de uma \\u00e9poca t\\u00e3o distante da nossa. Que encanto olhar para essas imagens e imaginar a vida como era antigamente\\u2026 S\\u00e3o pequenos registros que guardam grandes hist\\u00f3rias e despertam uma saudade de um tempo que nem chegamos a viver.. . . . . \\u25aa\\ufe0f Siga: @nostalgiapuraaa1 \\u2022 #nostalgia #100anos #vintage\",\n          \"Si 2026 y 1926 se encontraran\\u2026100 a\\u00f1os de diferencia? \\ud83d\\udc40\\u2728 #1920s #20s #1920sfashion #vintage #2026 \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.urls\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"shareCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 51704,\n        \"min\": 0,\n        \"max\": 247418,\n        \"num_unique_values\": 78,\n        \"samples\": [\n          50,\n          228,\n          9\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"playCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 5257355,\n        \"min\": 325,\n        \"max\": 34475439,\n        \"num_unique_values\": 88,\n        \"samples\": [\n          44956,\n          44729,\n          898507\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"commentCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 4608,\n        \"min\": 0,\n        \"max\": 32680,\n        \"num_unique_values\": 72,\n        \"samples\": [\n          43,\n          24472,\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "result.data['posts'][0]"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "nqAVHpZ1YEoA",
        "outputId": "715a5262-a8a1-4f46-ed63-44dd8af363f4"
      },
      "execution_count": 86,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "{'itemInfos': {'id': '7675608455490620704',\n",
              "  'text': 'Secret vintage shop we Wrocławiu.👗Byliście tu kiedyś? #miejscawewroclawiu #vintage #moda ',\n",
              "  'stitchEnabled': False,\n",
              "  'shareEnabled': True,\n",
              "  'createTime': '1787116866',\n",
              "  'authorId': '6616546624900628486',\n",
              "  'covers': ['https://p16-common-sign.tiktokcdn-eu.com/tos-useast2a-p-0037-euttp/okGFiMeHQD0CfQI9UejPIUFGCluyngdJLSAQLV~tplv-tiktokx-origin.image?dr=1347&refresh_token=f7308c2e&x-expires=1794070800&x-signature=1iWlvHS3Xrq6P2yFFVVlC7rc62M%3D&t=bacd0480&ps=933b5bde&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=cover&item=7675608455490620704&biz_tag=tt_video'],\n",
              "  'coversOrigin': ['https://p19-common-sign.tiktokcdn-eu.com/tos-useast2a-p-0037-euttp/ogAFDEUqmEjBoRZIy5FfBFPhyDPOpTIiO36fEQ~tplv-tiktokx-shrink-aq:360:360:q75.webp?dr=13023&refresh_token=6de01041&x-expires=1794070800&x-signature=rpzHt5%2BGg1jGGsVN0BcU%2FUQYyDs%3D&t=bacd0480&ps=d97f9a4f&shp=d05b14bd&shcp=c0f880ed&idc=no1a&biz_tag=tt_video&s=CHALLENGE_AWEME&sc=feed_cover&item=7675608455490620704'],\n",
              "  'shareCover': ['',\n",
              "   'https://p16-common-sign.tiktokcdn-eu.com/tos-useast2a-p-0037-euttp/okGFiMeHQD0CfQI9UejPIUFGCluyngdJLSAQLV~tplv-tiktokx-origin.image?dr=1347&refresh_token=f7308c2e&x-expires=1794070800&x-signature=1iWlvHS3Xrq6P2yFFVVlC7rc62M%3D&t=bacd0480&ps=933b5bde&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=cover&item=7675608455490620704&biz_tag=tt_video',\n",
              "   'https://p16-common-sign.tiktokcdn-eu.com/tos-useast2a-p-0037-euttp/okGFiMeHQD0CfQI9UejPIUFGCluyngdJLSAQLV~tplv-tiktokx-origin.image?dr=1347&refresh_token=f7308c2e&x-expires=1794070800&x-signature=1iWlvHS3Xrq6P2yFFVVlC7rc62M%3D&t=bacd0480&ps=933b5bde&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=cover&item=7675608455490620704&biz_tag=tt_video'],\n",
              "  'coversDynamic': ['https://p16-common-sign.tiktokcdn-eu.com/tos-useast2a-p-0037-euttp/oYffFUjADDBEW6QpiVDOmqIUhIRy7PRKTF5EyE~tplv-tiktokx-origin.image?dr=9229&refresh_token=4ac6f159&x-expires=1794070800&x-signature=sAR5sir1bL9rjqvPoyJsznSdF3g%3D&t=bacd0480&ps=4f5296ae&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=dynamic_cover&item=7675608455490620704&biz_tag=tt_video'],\n",
              "  'video': {'urls': ['https://v45.tiktokcdn-eu.com/bd9719ec8bfec60d1329eefefdd683f6/6aef608f/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMqEfP6ZIpiEm8hBOF0DfD5RyjAFQuTQn4xqEE/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1451&ft=pCXrRMVc8Zmo07SALa4jV3evp31rKsd.&mime_type=video_mp4&rc=aDQ6PGg2OTQ1MzRpNzppOkBpamh5O2s5cjttZDMzZjczNUBhYS4vMF8wXjUxMy8zMTEzYSNwaGdeMmRzbS9hLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728151E0D4C17B334FE44FC57&btag=e0009d000',\n",
              "    'https://v15m.tiktokcdn-eu.com/35de1b90cfd3e6863a5e136ff9dbcab1/6aef608f/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oMqEfP6ZIpiEm8hBOF0DfD5RyjAFQuTQn4xqEE/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1451&ft=pCXrRMVc8Zmo07SALa4jV3evp31rKsd.&mime_type=video_mp4&rc=aDQ6PGg2OTQ1MzRpNzppOkBpamh5O2s5cjttZDMzZjczNUBhYS4vMF8wXjUxMy8zMTEzYSNwaGdeMmRzbS9hLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728151E0D4C17B334FE44FC57&btag=e00098000',\n",
              "    'https://api16-normal-no1a.tiktokv.eu/aweme/v1/play/?faid=1233&file_id=674f47642f614082a136b33e2917d1de&is_play_url=1&item_id=7675608455490620704&line=0&pt=dGlrdG9rLmFnZ3JlZ2F0aW9uLmFwaSYvYXdlbWUvdjEvY2hhbGxlbmdlL2F3ZW1lLyYyMDI2MTEwNjE3MjgxNTFFMEQ0QzE3QjMzNEZFNDRGQzU3JjE3OTM5ODYwOTUmNGE5YTVmNWI1MjFi&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLmMyNGUyZjg5NjEwODZiZjBhZDRiOTczNDk0YzYyZWE4&source=CHALLENGE_AWEME&video_id=v26044gc0000da2jp8vog65ha8jvkesg'],\n",
              "   'videoMeta': {'height': 1024,\n",
              "    'width': 576,\n",
              "    'ratio': '540p',\n",
              "    'duration': 224}},\n",
              "  'diggCount': 48087,\n",
              "  'shareCount': 6757,\n",
              "  'playCount': 635846,\n",
              "  'commentCount': 198,\n",
              "  'isOriginal': False,\n",
              "  'isOfficial': False,\n",
              "  'isActivityItem': False,\n",
              "  'secret': False,\n",
              "  'forFriend': False,\n",
              "  'vl1': False,\n",
              "  'warnInfo': [],\n",
              "  'liked': False,\n",
              "  'commentStatus': 0,\n",
              "  'showNotPass': False,\n",
              "  'isAd': False,\n",
              "  'itemMute': False,\n",
              "  'musicId': '7675608473568086816'},\n",
              " 'authorInfos': {'secUid': 'MS4wLjABAAAA2TsF3iHD3uHtC8RQ1XWB4uBjsrul_yIUFHrZQyTk3D3Zsfi7lfuaTx-mHZQjgp6B',\n",
              "  'userId': '6616546624900628486',\n",
              "  'uniqueId': 'miejscawewroclawiu',\n",
              "  'nickName': 'Miejsca we Wrocławiu',\n",
              "  'signature': 'Najlepszy TIKTOK o WROCŁAWIU!🔥♥️\\nInstagram: @miejscawewroclawiu_pl 👈😎',\n",
              "  'verified': False,\n",
              "  'user_type': '',\n",
              "  'covers': ['https://p19-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:100:100:q70.webp?dr=9606&refresh_token=0b7679ec&x-expires=1794070800&x-signature=ZPnjyzdc6En%2BmEyuBBsUECp1BeQ%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=avatar'],\n",
              "  'coversMedium': ['https://p19-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:720:720:q70.webp?dr=9607&refresh_token=3967212a&x-expires=1794070800&x-signature=8J3Uttyv3bDtdVqlh%2FTzpliArfQ%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=avatar'],\n",
              "  'coversLarger': ['https://p19-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:1080:1080:q70.webp?dr=9608&refresh_token=20de37d3&x-expires=1794070800&x-signature=rTPs4odbWb3DVqsQx8JxtYC5fwI%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&s=CHALLENGE_AWEME&sc=avatar'],\n",
              "  'secret': False,\n",
              "  'isSecret': False,\n",
              "  'relation': -1,\n",
              "  'roomId': ''},\n",
              " 'musicInfos': {'musicId': '7675608473568086816',\n",
              "  'musicName': 'original sound - miejscawewroclawiu',\n",
              "  'authorName': 'Miejsca we Wrocławiu',\n",
              "  'original': True,\n",
              "  'playUrl': ['https://sf16-music.tiktokcdn-eu.com/obj/ies-music-euttp/7676128832533007136.mp3'],\n",
              "  'covers': ['https://p16-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:100:100:q70.webp?dr=9606&refresh_token=d91ee547&x-expires=1794070800&x-signature=3lsiDDjhQS0Ky9Yg%2FaOsSytth5c%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&sc=avatar&s=CHALLENGE_AWEME'],\n",
              "  'coversMedium': ['https://p16-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:720:720:q70.webp?dr=9607&refresh_token=fccc8cea&x-expires=1794070800&x-signature=R52ROtKVqMBQjmDyPYDhVEM6Dh4%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&sc=avatar&s=CHALLENGE_AWEME'],\n",
              "  'coversLarger': ['https://p16-common-sign.tiktokcdn-eu.com/tos-maliva-avt-0068/5b227733411ac78f0cc52c1e9f52bd56~tplv-tiktokx-cropcenter-q:1080:1080:q70.webp?dr=9608&refresh_token=d6b0d84d&x-expires=1794070800&x-signature=JH3br7esR4Ea015WjuveQU1TKNk%3D&t=223449c4&ps=87d6e48a&shp=d05b14bd&shcp=c0f880ed&idc=no1a&sc=avatar&s=CHALLENGE_AWEME']},\n",
              " 'challengeInfoList': [{'challengeId': '1703362777490437',\n",
              "   'challengeName': 'miejscawewroclawiu',\n",
              "   'isCommerce': False,\n",
              "   'text': '',\n",
              "   'splitTitle': '',\n",
              "   'covers': [],\n",
              "   'coversMedium': [],\n",
              "   'coversLarger': []}],\n",
              " 'duetInfo': '0',\n",
              " 'textExtra': [{'Start': 55,\n",
              "   'End': 74,\n",
              "   'SecUid': '',\n",
              "   'SubType': 0,\n",
              "   'AwemeId': '',\n",
              "   'HashtagName': '',\n",
              "   'HashtagId': '',\n",
              "   'Type': 1,\n",
              "   'UserId': '',\n",
              "   'IsCommerce': False,\n",
              "   'UserUniqueId': ''},\n",
              "  {'Start': 75,\n",
              "   'End': 83,\n",
              "   'SecUid': '',\n",
              "   'SubType': 0,\n",
              "   'AwemeId': '',\n",
              "   'HashtagName': '',\n",
              "   'HashtagId': '',\n",
              "   'Type': 1,\n",
              "   'UserId': '',\n",
              "   'IsCommerce': False,\n",
              "   'UserUniqueId': ''},\n",
              "  {'Start': 84,\n",
              "   'End': 89,\n",
              "   'SecUid': '',\n",
              "   'SubType': 0,\n",
              "   'AwemeId': '',\n",
              "   'HashtagName': '',\n",
              "   'HashtagId': '',\n",
              "   'Type': 1,\n",
              "   'UserId': '',\n",
              "   'IsCommerce': False,\n",
              "   'UserUniqueId': ''}],\n",
              " 'authorStats': {'followingCount': 0,\n",
              "  'followerCount': 0,\n",
              "  'heartCount': 0,\n",
              "  'videoCount': 0,\n",
              "  'diggCount': 0},\n",
              " 'stickerTextList': []}"
            ]
          },
          "metadata": {},
          "execution_count": 86
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Keyword search (100 posts at the cost of 5 units) - limited to 180 days!"
      ],
      "metadata": {
        "id": "S5JAFI_JOAa8"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# read posts related to a keyword\n",
        "keyword = \"vintage\" # keyword name\n",
        "period = 180 # must be one of 0, 1, 7, 30, 90, 180 days\n",
        "             # returns posts more recent than the given period\n",
        "country = \"us\" # leave blank \"\" for any country\n",
        "max_cursor = 100 # max number of posts fetched, cost is 1 unit per 20 posts\n",
        "\n",
        "# loop through keyword_search to control for max_cursor\n",
        "posts = list()\n",
        "cursor = None\n",
        "for i in tqdm(range(int(max_cursor/20))):\n",
        "    result = client.tiktok.keyword_search(keyword = keyword,\n",
        "                                          period = period,\n",
        "                                          country = country,\n",
        "                                          cursor = cursor)\n",
        "    posts.extend(result.data[\"data\"])\n",
        "    cursor = result.data.get(\"nextCursor\")\n",
        "\n",
        "    # If there is no next cursor, we've fetched all the available posts\n",
        "    if cursor is None:\n",
        "        break"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 49,
          "referenced_widgets": [
            "f5b02e85a6b9495db166b24d720c73e8",
            "afd073ac5b0042308be47deb18a4a065",
            "515a46ffd6f34a9082c1dd7345093c4c",
            "97579603107d420d893a4e8781f48a49",
            "80aba8a62259467485a04896b0d6b667",
            "6aeb08430d4d4b488ee92c119f6438f8",
            "4b49f359bbd54404902fface7d76d42a",
            "f98e480c393b411a9d1e85d74f0b2b03",
            "31bd1189a2254694a2e5d234f2593557",
            "f400ffbe55c147278cfd968c9593d92a",
            "7fe1dda86a834a1cabba86ea27d4033e"
          ]
        },
        "id": "rzUDyJqXOBxR",
        "outputId": "a55a4bb3-05ce-4740-b1a0-3c3796736b22"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/5 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "f5b02e85a6b9495db166b24d720c73e8"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# convert json to dataframe\n",
        "df = pd.json_normalize(posts)\n",
        "\n",
        "# extract relevant info\n",
        "df = df[['aweme_info.aweme_id', 'aweme_info.create_time',\n",
        "         'aweme_info.author.uid', 'aweme_info.desc',\n",
        "         'aweme_info.video.play_addr.url_list',\n",
        "         'aweme_info.statistics.share_count',\n",
        "         'aweme_info.statistics.play_count',\n",
        "         'aweme_info.statistics.comment_count']]\n",
        "\n",
        "# rename columns\n",
        "df.columns = ['id', 'createTime', 'authorId', 'text', 'video.urls',\n",
        "              'shareCount', 'playCount', 'commentCount']\n",
        "\n",
        "# format time to date in string format, and sort by date\n",
        "df[\"createTime\"] = [str(datetime.fromtimestamp(int(i)).date())\n",
        "                                                for i in df[\"createTime\"]]\n",
        "df.sort_values(by='createTime', ascending=False, inplace=True, ignore_index=True)\n",
        "\n",
        "# save\n",
        "df_keyword = df\n",
        "df_keyword.to_csv('tiktok_keyword_posts.csv', index=False)"
      ],
      "metadata": {
        "id": "OTS03uQHEHy_"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "display(df_keyword)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 964
        },
        "id": "qstD2toKCd_7",
        "outputId": "151e4f7c-0e6f-404f-dc8d-adc2f56f82bb"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "                     id  createTime             authorId  \\\n",
              "0   7705055114309963029  2026-11-06  7423800185129059334   \n",
              "1   7705067176868334881  2026-11-06  7323381347249030177   \n",
              "2   7705055902025534742  2026-11-06  7106045753492341765   \n",
              "3   7705062848614976799  2026-11-06  6911697814008660998   \n",
              "4   7705051858183769375  2026-11-06  7649037909546419213   \n",
              "..                  ...         ...                  ...   \n",
              "94  7660553130525936918  2026-07-09  6742548297862988806   \n",
              "95  7656979006159342862  2026-06-30  7594292407396336695   \n",
              "96  7652416717125160222  2026-06-17  6639205686613393414   \n",
              "97  7651811237499522318  2026-06-16  6873881020279718917   \n",
              "98  7641975923608210701  2026-05-20  7594292407396336695   \n",
              "\n",
              "                                                 text  \\\n",
              "0   JURUS MAUT HENRY ABRAHAM! 🕵️‍♂️🔥 Pesona Modus ...   \n",
              "1                                                       \n",
              "2   Vintage Bettenkino 🛏️🍿🎞️ 📍 Electric Cinema Not...   \n",
              "3   Which of these would you choose to read? For D...   \n",
              "4   Do not show this to digicam fans😭📸 #camera #di...   \n",
              "..                                                ...   \n",
              "94  2000s HEAVEN ⭐️ shop vintage at laurenatlanta....   \n",
              "95  #oddities #oldpiece #antiques #antiquefinds #v...   \n",
              "96  be mine tonight 🕯️ #canopy #canopybed #princes...   \n",
              "97  The 1950s had a very… unique idea of fashion. ...   \n",
              "98  #antiques #pocketlamp #antiquelighters #antiqu...   \n",
              "\n",
              "                                           video.urls  shareCount  playCount  \\\n",
              "0   [https://v19.tiktokcdn.com/377a16ef959bb5fe4a0...          10       6330   \n",
              "1   [https://v19.tiktokcdn.com/4384e55421d724e4898...          69       2349   \n",
              "2   [https://v19.tiktokcdn.com/05cd3f259e42b7a1d6b...         469      26996   \n",
              "3   [https://v19.tiktokcdn.com/d2a870a99db489776dc...           1       1631   \n",
              "4   [https://v19.tiktokcdn.com/3094988e43a816f9286...          16       1715   \n",
              "..                                                ...         ...        ...   \n",
              "94  [https://v19.tiktokcdn.com/0b348015a1381783c9a...        5877     716843   \n",
              "95  [https://v19.tiktokcdn.com/9355ae8a1dd6c0545a7...        1413     621225   \n",
              "96  [https://v19.tiktokcdn.com/63ea35fe521d1ae7f72...      216139   15002789   \n",
              "97  [https://v19.tiktokcdn.com/2a6a5dfbab5734f0a26...         772     312017   \n",
              "98  [https://v19.tiktokcdn.com/3b5ab8578d4788e44ee...        7183    1707404   \n",
              "\n",
              "    commentCount  \n",
              "0             12  \n",
              "1              5  \n",
              "2              5  \n",
              "3              5  \n",
              "4              2  \n",
              "..           ...  \n",
              "94           389  \n",
              "95           291  \n",
              "96          6076  \n",
              "97            77  \n",
              "98           847  \n",
              "\n",
              "[99 rows x 8 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-a743e9cb-3071-448e-89c5-ac38d1e9921b\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>id</th>\n",
              "      <th>createTime</th>\n",
              "      <th>authorId</th>\n",
              "      <th>text</th>\n",
              "      <th>video.urls</th>\n",
              "      <th>shareCount</th>\n",
              "      <th>playCount</th>\n",
              "      <th>commentCount</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7705055114309963029</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>7423800185129059334</td>\n",
              "      <td>JURUS MAUT HENRY ABRAHAM! 🕵️‍♂️🔥 Pesona Modus ...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/377a16ef959bb5fe4a0...</td>\n",
              "      <td>10</td>\n",
              "      <td>6330</td>\n",
              "      <td>12</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7705067176868334881</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>7323381347249030177</td>\n",
              "      <td></td>\n",
              "      <td>[https://v19.tiktokcdn.com/4384e55421d724e4898...</td>\n",
              "      <td>69</td>\n",
              "      <td>2349</td>\n",
              "      <td>5</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7705055902025534742</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>7106045753492341765</td>\n",
              "      <td>Vintage Bettenkino 🛏️🍿🎞️ 📍 Electric Cinema Not...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/05cd3f259e42b7a1d6b...</td>\n",
              "      <td>469</td>\n",
              "      <td>26996</td>\n",
              "      <td>5</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7705062848614976799</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>6911697814008660998</td>\n",
              "      <td>Which of these would you choose to read? For D...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/d2a870a99db489776dc...</td>\n",
              "      <td>1</td>\n",
              "      <td>1631</td>\n",
              "      <td>5</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7705051858183769375</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>7649037909546419213</td>\n",
              "      <td>Do not show this to digicam fans😭📸 #camera #di...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/3094988e43a816f9286...</td>\n",
              "      <td>16</td>\n",
              "      <td>1715</td>\n",
              "      <td>2</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>94</th>\n",
              "      <td>7660553130525936918</td>\n",
              "      <td>2026-07-09</td>\n",
              "      <td>6742548297862988806</td>\n",
              "      <td>2000s HEAVEN ⭐️ shop vintage at laurenatlanta....</td>\n",
              "      <td>[https://v19.tiktokcdn.com/0b348015a1381783c9a...</td>\n",
              "      <td>5877</td>\n",
              "      <td>716843</td>\n",
              "      <td>389</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>95</th>\n",
              "      <td>7656979006159342862</td>\n",
              "      <td>2026-06-30</td>\n",
              "      <td>7594292407396336695</td>\n",
              "      <td>#oddities #oldpiece #antiques #antiquefinds #v...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/9355ae8a1dd6c0545a7...</td>\n",
              "      <td>1413</td>\n",
              "      <td>621225</td>\n",
              "      <td>291</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>2026-06-17</td>\n",
              "      <td>6639205686613393414</td>\n",
              "      <td>be mine tonight 🕯️ #canopy #canopybed #princes...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/63ea35fe521d1ae7f72...</td>\n",
              "      <td>216139</td>\n",
              "      <td>15002789</td>\n",
              "      <td>6076</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>97</th>\n",
              "      <td>7651811237499522318</td>\n",
              "      <td>2026-06-16</td>\n",
              "      <td>6873881020279718917</td>\n",
              "      <td>The 1950s had a very… unique idea of fashion. ...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/2a6a5dfbab5734f0a26...</td>\n",
              "      <td>772</td>\n",
              "      <td>312017</td>\n",
              "      <td>77</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>98</th>\n",
              "      <td>7641975923608210701</td>\n",
              "      <td>2026-05-20</td>\n",
              "      <td>7594292407396336695</td>\n",
              "      <td>#antiques #pocketlamp #antiquelighters #antiqu...</td>\n",
              "      <td>[https://v19.tiktokcdn.com/3b5ab8578d4788e44ee...</td>\n",
              "      <td>7183</td>\n",
              "      <td>1707404</td>\n",
              "      <td>847</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>99 rows × 8 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a743e9cb-3071-448e-89c5-ac38d1e9921b')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-a743e9cb-3071-448e-89c5-ac38d1e9921b button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-a743e9cb-3071-448e-89c5-ac38d1e9921b');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_02d98bcc-bb0a-492d-86b2-ca6fce3173fb\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_02d98bcc-bb0a-492d-86b2-ca6fce3173fb button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 99,\n  \"fields\": [\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 88,\n        \"samples\": [\n          \"7676544262917426463\",\n          \"7705055114309963029\",\n          \"7704106015373020447\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"createTime\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 30,\n        \"samples\": [\n          \"2026-06-17\",\n          \"2026-10-01\",\n          \"2026-07-20\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorId\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 82,\n        \"samples\": [\n          \"7702335853553370125\",\n          \"7423800185129059334\",\n          \"7542106181751342102\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 88,\n        \"samples\": [\n          \"The dresses are overflowing our racks and we aren\\u2019t mad about it \\u2764\\ufe0f\\ud83e\\udd70#saltlakecity #vintageclothes #vintageclothingstore #vintageshop #slcvintage \",\n          \"JURUS MAUT HENRY ABRAHAM! \\ud83d\\udd75\\ufe0f\\u200d\\u2642\\ufe0f\\ud83d\\udd25 Pesona Modus Papa Sultan Emang Gak Ada Obat! Niatnya mau pulang naik taksi biar tetap elegan dan slay, eh Tante Veronika malah berujung boncengan motor gede sama mantan suami! Alasan Om Hendry sih klasik tapi savage banget: \\\"Nanti kalau pingsan lagi di jalan nggak ada yang nolongin.\\\"  Bisa aja nih si Om cari celah buat modus! Tapi yang bikin kita ngakak guling-guling itu pas udah di jalan. Udah disuruh pegangan biar nggak jatuh, Tante Vero tetep aja kaku kayak kanebo kering. Tante Vero pasang tameng \\\"kita kan bukan suami istri\\\"!  Padahal dalam hati pasti deg-degan brutal nahan salting, kan? Jarak duduk mereka di jok motor udah kayak dikasih spasi satu meter saking gengsinya.  Definisi pasangan puber kedua yang bikin penonton gemes maksimal! \\ud83e\\udd2d #terikatjanji #henryabraham #veronica #pasanganvintage #aryasaloka #ashaassuncao #sinetron\",\n          \"1970s funk just sitting at the thrift store waiting to be loved \\ud83e\\udea9\\ud83e\\udeb4\\ud83c\\udf9e\\ufe0f #1970sdecor #thrifting #thrift #vintagedecor #vintage \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.urls\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"shareCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 24968,\n        \"min\": 0,\n        \"max\": 216139,\n        \"num_unique_values\": 52,\n        \"samples\": [\n          4,\n          90,\n          5877\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"playCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1554883,\n        \"min\": 187,\n        \"max\": 15002789,\n        \"num_unique_values\": 88,\n        \"samples\": [\n          10054,\n          6330,\n          1197377\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"commentCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 705,\n        \"min\": 0,\n        \"max\": 6076,\n        \"num_unique_values\": 47,\n        \"samples\": [\n          15,\n          1775,\n          16\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Read comments from TikTok"
      ],
      "metadata": {
        "id": "DkuiCnjGBuHf"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Comments search"
      ],
      "metadata": {
        "id": "u6hgnv7FXijQ"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df_hashtag = pd.read_csv('tiktok_hashtag_posts.csv')\n",
        "df_keyword = pd.read_csv('tiktok_keyword_posts.csv')\n",
        "\n",
        "# order by comment count\n",
        "df_hashtag = df_hashtag.sort_values(by=['commentCount'], ascending=False).reset_index(drop=True)\n",
        "df_keyword = df_keyword.sort_values(by=['commentCount'], ascending=False).reset_index(drop=True)\n",
        "# delete posts with less than 30 comments\n",
        "df_hashtag = df_hashtag[df_hashtag['commentCount']>=30]\n",
        "df_keyword = df_keyword[df_keyword['commentCount']>=30]\n",
        "# state how many\n",
        "print(f'{len(df_hashtag)} posts for hastags with more than 30 comments')\n",
        "print(f'{len(df_keyword)} posts for keywords with more than 30 comments')"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "FVaM3UHHRZ6M",
        "outputId": "4b90d9d1-87fe-4246-f7e2-32c1e3b69adf"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "44 posts for hastags with more than 30 comments\n",
            "30 posts for keywords with more than 30 comments\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "display(df_keyword)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "EJYDFZ-kcAwr",
        "outputId": "38af4d9b-e1da-403a-fc01-e86b9900b95c"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "                     id  createTime             authorId  \\\n",
              "0   7652416717125160222  2026-06-17  6639205686613393414   \n",
              "1   7703526867185175821  2026-11-02  7441527313198482475   \n",
              "2   7671528693688175903  2026-08-08  7670578141832938510   \n",
              "3   7704453307078544661  2026-11-04              9475174   \n",
              "4   7704433074213375263  2026-11-04  6792660877180240901   \n",
              "5   7641975923608210701  2026-05-20  7594292407396336695   \n",
              "6   7701755895977544990  2026-10-28  6809005256572896262   \n",
              "7   7703165190552046870  2026-11-01  7055236648125121542   \n",
              "8   7660553130525936918  2026-07-09  6742548297862988806   \n",
              "9   7664604725488176406  2026-07-20  6795636828735521797   \n",
              "10  7691753158426594568  2026-10-01  6918482322769888262   \n",
              "11  7656979006159342862  2026-06-30  7594292407396336695   \n",
              "12  7704736690782440736  2026-11-05  6966303131081180166   \n",
              "13  7693296538377817358  2026-10-05  6790402164126204934   \n",
              "14  7696545690079530254  2026-10-14  6811317678587610117   \n",
              "15  7699981055746411789  2026-10-23  7684837725748495373   \n",
              "16  7704730698053324039  2026-11-05   201279111275966464   \n",
              "17  7670963342948764961  2026-08-06  7609009659596555286   \n",
              "18  7704021439468358942  2026-11-03   100167342579499008   \n",
              "19  7651811237499522318  2026-06-16  6873881020279718917   \n",
              "20  7696594952037453087  2026-10-14  7062734369195869231   \n",
              "21  7704848262267817229  2026-11-06  7467662941736371231   \n",
              "22  7691446339292515597  2026-09-30  7164898021108466730   \n",
              "23  7703373520184610078  2026-11-02  7446168736319145006   \n",
              "24  7704131158841314574  2026-11-04  7315580412830942251   \n",
              "25  7704131158841314574  2026-11-04  7315580412830942251   \n",
              "26  7704498538759097631  2026-11-05  7446168736319145006   \n",
              "27  7704815648282627360  2026-11-05   102135261047771136   \n",
              "28  7664234166342470942  2026-07-19  6532027110620397569   \n",
              "29  7664809977806081311  2026-07-21  7030604659140559878   \n",
              "\n",
              "                                                 text  \\\n",
              "0   be mine tonight 🕯️ #canopy #canopybed #princes...   \n",
              "1   Do you remember Lerner? This mall store was kn...   \n",
              "2                    cool.  #fyp #aesthetic #vintage    \n",
              "3   What was so bad about tapes and dvds anyway… I...   \n",
              "4   Makeup from 1865! The oldest makeup I’ve ever ...   \n",
              "5   #antiques #pocketlamp #antiquelighters #antiqu...   \n",
              "6   open my crazyyyy vintage the realreal purchase...   \n",
              "7                   #fyp #viral #jazz #vintage #vibe    \n",
              "8   2000s HEAVEN ⭐️ shop vintage at laurenatlanta....   \n",
              "9   Summer gothic 🦇🕯️ lace curtains dancing in the...   \n",
              "10  #losangeles #lavintage #lashopping #vintagesho...   \n",
              "11  #oddities #oldpiece #antiques #antiquefinds #v...   \n",
              "12   la qualité jsuis choquée 😂😂 #ipodtouch #vintage    \n",
              "13  My Best Thrift Finds - Part One #vintage #thri...   \n",
              "14  Antiques and vintage curiosities available at ...   \n",
              "15  If you love vintage and girly vibes, welcome 🖤...   \n",
              "16  first date look inspo #lanadelrey #coquette #v...   \n",
              "17    #1940s #fashion #vintageclothing #vintage #40s    \n",
              "18  Part 2 of some of my vintage collection that I...   \n",
              "19  The 1950s had a very… unique idea of fashion. ...   \n",
              "20  How long do you think this is going to take? 🤭...   \n",
              "21  I might have to get a j*b now 😭💔💔 #fashion #th...   \n",
              "22  best antique find today #antique #scrapbook #v...   \n",
              "23  barneys closing will forever be my biggest hea...   \n",
              "24  Lmk ur thoughts on ig brand recreations of vin...   \n",
              "25  Lmk ur thoughts on ig brand recreations of vin...   \n",
              "26  One of my favorite vintage Gucci finds #ootn #...   \n",
              "27                                    #vintagechanel    \n",
              "28  Welcome to Abode✨ #interiordesign #boutique #c...   \n",
              "29  Late 60s Fashion  #fashion #vintage #mod #60s ...   \n",
              "\n",
              "                                           video.urls  shareCount  playCount  \\\n",
              "0   ['https://v19.tiktokcdn.com/63ea35fe521d1ae7f7...      216139   15002789   \n",
              "1   ['https://v19.tiktokcdn.com/f1f027aa2ea2ab8fce...         284      66247   \n",
              "2   ['https://v19.tiktokcdn.com/1dc02cd618b3c3f9cb...      117248    3002873   \n",
              "3   ['https://v19.tiktokcdn.com/fd68416669ba7834fa...       32047    1197377   \n",
              "4   ['https://v19.tiktokcdn.com/53337a63f0119622a5...        6480    1438898   \n",
              "5   ['https://v19.tiktokcdn.com/3b5ab8578d4788e44e...        7183    1707404   \n",
              "6   ['https://v19.tiktokcdn.com/7dea41e63108a28c8b...         599      84052   \n",
              "7   ['https://v19.tiktokcdn.com/eca7c7a3e289aa270c...       37662    1662755   \n",
              "8   ['https://v19.tiktokcdn.com/0b348015a1381783c9...        5877     716843   \n",
              "9   ['https://v19.tiktokcdn.com/0c3623fff3e6075654...        8288     695120   \n",
              "10  ['https://v19.tiktokcdn.com/fbaf1b25ae5fa0fbc4...         599      73396   \n",
              "11  ['https://v19.tiktokcdn.com/9355ae8a1dd6c0545a...        1413     621225   \n",
              "12  ['https://v19.tiktokcdn.com/0186370bb20278d2e6...         155     346871   \n",
              "13  ['https://v19.tiktokcdn.com/f4dec9fdce3df63689...        2470     525305   \n",
              "14  ['https://v19.tiktokcdn.com/396f6573eccad03c95...        3415     239908   \n",
              "15  ['https://v19.tiktokcdn.com/abd21e0727e7e0e2bd...         324      44567   \n",
              "16  ['https://v19.tiktokcdn.com/f2a37346179c5b3858...        1494     160325   \n",
              "17  ['https://v19.tiktokcdn.com/a5447711e6e31d008e...         101      26699   \n",
              "18  ['https://v19.tiktokcdn.com/0ee465c057a7048293...          84      38149   \n",
              "19  ['https://v19.tiktokcdn.com/2a6a5dfbab5734f0a2...         772     312017   \n",
              "20  ['https://v19.tiktokcdn.com/7fbce48cae49a70fbe...         291     272246   \n",
              "21  ['https://v19.tiktokcdn.com/78ef1b3f12a3628c36...         137      95067   \n",
              "22  ['https://v19.tiktokcdn.com/85c0a3f93c7886780d...         702      82111   \n",
              "23  ['https://v19.tiktokcdn.com/07d27e953b91d8fe64...          10       2904   \n",
              "24  ['https://v19.tiktokcdn.com/eaa41d7723bce73bc2...          16       6420   \n",
              "25  ['https://v19.tiktokcdn.com/db4ce9e19f9e5eee3c...          16       6420   \n",
              "26  ['https://v19.tiktokcdn.com/16373dc65dfa797cc8...          12       2034   \n",
              "27  ['https://v19.tiktokcdn.com/2e171f68a59c70c48c...        3228     243731   \n",
              "28  ['https://v19.tiktokcdn.com/5932d1e0587e3d9395...         243      15660   \n",
              "29  ['https://v19.tiktokcdn.com/1bfb9c9e145432e5c8...          46       6921   \n",
              "\n",
              "    commentCount  \n",
              "0           6076  \n",
              "1           2075  \n",
              "2           1775  \n",
              "3           1769  \n",
              "4           1568  \n",
              "5            847  \n",
              "6            816  \n",
              "7            694  \n",
              "8            389  \n",
              "9            332  \n",
              "10           292  \n",
              "11           291  \n",
              "12           291  \n",
              "13           210  \n",
              "14           159  \n",
              "15           150  \n",
              "16           133  \n",
              "17           133  \n",
              "18           103  \n",
              "19            77  \n",
              "20            67  \n",
              "21            59  \n",
              "22            51  \n",
              "23            44  \n",
              "24            39  \n",
              "25            39  \n",
              "26            37  \n",
              "27            36  \n",
              "28            34  \n",
              "29            31  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-e5b4cb4e-25bb-49c6-8d6e-fd81ef865f0a\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>id</th>\n",
              "      <th>createTime</th>\n",
              "      <th>authorId</th>\n",
              "      <th>text</th>\n",
              "      <th>video.urls</th>\n",
              "      <th>shareCount</th>\n",
              "      <th>playCount</th>\n",
              "      <th>commentCount</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>2026-06-17</td>\n",
              "      <td>6639205686613393414</td>\n",
              "      <td>be mine tonight 🕯️ #canopy #canopybed #princes...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/63ea35fe521d1ae7f7...</td>\n",
              "      <td>216139</td>\n",
              "      <td>15002789</td>\n",
              "      <td>6076</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>2026-11-02</td>\n",
              "      <td>7441527313198482475</td>\n",
              "      <td>Do you remember Lerner? This mall store was kn...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/f1f027aa2ea2ab8fce...</td>\n",
              "      <td>284</td>\n",
              "      <td>66247</td>\n",
              "      <td>2075</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7671528693688175903</td>\n",
              "      <td>2026-08-08</td>\n",
              "      <td>7670578141832938510</td>\n",
              "      <td>cool.  #fyp #aesthetic #vintage</td>\n",
              "      <td>['https://v19.tiktokcdn.com/1dc02cd618b3c3f9cb...</td>\n",
              "      <td>117248</td>\n",
              "      <td>3002873</td>\n",
              "      <td>1775</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7704453307078544661</td>\n",
              "      <td>2026-11-04</td>\n",
              "      <td>9475174</td>\n",
              "      <td>What was so bad about tapes and dvds anyway… I...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/fd68416669ba7834fa...</td>\n",
              "      <td>32047</td>\n",
              "      <td>1197377</td>\n",
              "      <td>1769</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7704433074213375263</td>\n",
              "      <td>2026-11-04</td>\n",
              "      <td>6792660877180240901</td>\n",
              "      <td>Makeup from 1865! The oldest makeup I’ve ever ...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/53337a63f0119622a5...</td>\n",
              "      <td>6480</td>\n",
              "      <td>1438898</td>\n",
              "      <td>1568</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>7641975923608210701</td>\n",
              "      <td>2026-05-20</td>\n",
              "      <td>7594292407396336695</td>\n",
              "      <td>#antiques #pocketlamp #antiquelighters #antiqu...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/3b5ab8578d4788e44e...</td>\n",
              "      <td>7183</td>\n",
              "      <td>1707404</td>\n",
              "      <td>847</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>7701755895977544990</td>\n",
              "      <td>2026-10-28</td>\n",
              "      <td>6809005256572896262</td>\n",
              "      <td>open my crazyyyy vintage the realreal purchase...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/7dea41e63108a28c8b...</td>\n",
              "      <td>599</td>\n",
              "      <td>84052</td>\n",
              "      <td>816</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>7703165190552046870</td>\n",
              "      <td>2026-11-01</td>\n",
              "      <td>7055236648125121542</td>\n",
              "      <td>#fyp #viral #jazz #vintage #vibe</td>\n",
              "      <td>['https://v19.tiktokcdn.com/eca7c7a3e289aa270c...</td>\n",
              "      <td>37662</td>\n",
              "      <td>1662755</td>\n",
              "      <td>694</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>7660553130525936918</td>\n",
              "      <td>2026-07-09</td>\n",
              "      <td>6742548297862988806</td>\n",
              "      <td>2000s HEAVEN ⭐️ shop vintage at laurenatlanta....</td>\n",
              "      <td>['https://v19.tiktokcdn.com/0b348015a1381783c9...</td>\n",
              "      <td>5877</td>\n",
              "      <td>716843</td>\n",
              "      <td>389</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>7664604725488176406</td>\n",
              "      <td>2026-07-20</td>\n",
              "      <td>6795636828735521797</td>\n",
              "      <td>Summer gothic 🦇🕯️ lace curtains dancing in the...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/0c3623fff3e6075654...</td>\n",
              "      <td>8288</td>\n",
              "      <td>695120</td>\n",
              "      <td>332</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>7691753158426594568</td>\n",
              "      <td>2026-10-01</td>\n",
              "      <td>6918482322769888262</td>\n",
              "      <td>#losangeles #lavintage #lashopping #vintagesho...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/fbaf1b25ae5fa0fbc4...</td>\n",
              "      <td>599</td>\n",
              "      <td>73396</td>\n",
              "      <td>292</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>7656979006159342862</td>\n",
              "      <td>2026-06-30</td>\n",
              "      <td>7594292407396336695</td>\n",
              "      <td>#oddities #oldpiece #antiques #antiquefinds #v...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/9355ae8a1dd6c0545a...</td>\n",
              "      <td>1413</td>\n",
              "      <td>621225</td>\n",
              "      <td>291</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>7704736690782440736</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>6966303131081180166</td>\n",
              "      <td>la qualité jsuis choquée 😂😂 #ipodtouch #vintage</td>\n",
              "      <td>['https://v19.tiktokcdn.com/0186370bb20278d2e6...</td>\n",
              "      <td>155</td>\n",
              "      <td>346871</td>\n",
              "      <td>291</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>7693296538377817358</td>\n",
              "      <td>2026-10-05</td>\n",
              "      <td>6790402164126204934</td>\n",
              "      <td>My Best Thrift Finds - Part One #vintage #thri...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/f4dec9fdce3df63689...</td>\n",
              "      <td>2470</td>\n",
              "      <td>525305</td>\n",
              "      <td>210</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>7696545690079530254</td>\n",
              "      <td>2026-10-14</td>\n",
              "      <td>6811317678587610117</td>\n",
              "      <td>Antiques and vintage curiosities available at ...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/396f6573eccad03c95...</td>\n",
              "      <td>3415</td>\n",
              "      <td>239908</td>\n",
              "      <td>159</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>7699981055746411789</td>\n",
              "      <td>2026-10-23</td>\n",
              "      <td>7684837725748495373</td>\n",
              "      <td>If you love vintage and girly vibes, welcome 🖤...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/abd21e0727e7e0e2bd...</td>\n",
              "      <td>324</td>\n",
              "      <td>44567</td>\n",
              "      <td>150</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>7704730698053324039</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>201279111275966464</td>\n",
              "      <td>first date look inspo #lanadelrey #coquette #v...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/f2a37346179c5b3858...</td>\n",
              "      <td>1494</td>\n",
              "      <td>160325</td>\n",
              "      <td>133</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>7670963342948764961</td>\n",
              "      <td>2026-08-06</td>\n",
              "      <td>7609009659596555286</td>\n",
              "      <td>#1940s #fashion #vintageclothing #vintage #40s</td>\n",
              "      <td>['https://v19.tiktokcdn.com/a5447711e6e31d008e...</td>\n",
              "      <td>101</td>\n",
              "      <td>26699</td>\n",
              "      <td>133</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>7704021439468358942</td>\n",
              "      <td>2026-11-03</td>\n",
              "      <td>100167342579499008</td>\n",
              "      <td>Part 2 of some of my vintage collection that I...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/0ee465c057a7048293...</td>\n",
              "      <td>84</td>\n",
              "      <td>38149</td>\n",
              "      <td>103</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>7651811237499522318</td>\n",
              "      <td>2026-06-16</td>\n",
              "      <td>6873881020279718917</td>\n",
              "      <td>The 1950s had a very… unique idea of fashion. ...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/2a6a5dfbab5734f0a2...</td>\n",
              "      <td>772</td>\n",
              "      <td>312017</td>\n",
              "      <td>77</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>7696594952037453087</td>\n",
              "      <td>2026-10-14</td>\n",
              "      <td>7062734369195869231</td>\n",
              "      <td>How long do you think this is going to take? 🤭...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/7fbce48cae49a70fbe...</td>\n",
              "      <td>291</td>\n",
              "      <td>272246</td>\n",
              "      <td>67</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>7704848262267817229</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>7467662941736371231</td>\n",
              "      <td>I might have to get a j*b now 😭💔💔 #fashion #th...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/78ef1b3f12a3628c36...</td>\n",
              "      <td>137</td>\n",
              "      <td>95067</td>\n",
              "      <td>59</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>7691446339292515597</td>\n",
              "      <td>2026-09-30</td>\n",
              "      <td>7164898021108466730</td>\n",
              "      <td>best antique find today #antique #scrapbook #v...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/85c0a3f93c7886780d...</td>\n",
              "      <td>702</td>\n",
              "      <td>82111</td>\n",
              "      <td>51</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>7703373520184610078</td>\n",
              "      <td>2026-11-02</td>\n",
              "      <td>7446168736319145006</td>\n",
              "      <td>barneys closing will forever be my biggest hea...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/07d27e953b91d8fe64...</td>\n",
              "      <td>10</td>\n",
              "      <td>2904</td>\n",
              "      <td>44</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>7704131158841314574</td>\n",
              "      <td>2026-11-04</td>\n",
              "      <td>7315580412830942251</td>\n",
              "      <td>Lmk ur thoughts on ig brand recreations of vin...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/eaa41d7723bce73bc2...</td>\n",
              "      <td>16</td>\n",
              "      <td>6420</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>7704131158841314574</td>\n",
              "      <td>2026-11-04</td>\n",
              "      <td>7315580412830942251</td>\n",
              "      <td>Lmk ur thoughts on ig brand recreations of vin...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/db4ce9e19f9e5eee3c...</td>\n",
              "      <td>16</td>\n",
              "      <td>6420</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>7704498538759097631</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>7446168736319145006</td>\n",
              "      <td>One of my favorite vintage Gucci finds #ootn #...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/16373dc65dfa797cc8...</td>\n",
              "      <td>12</td>\n",
              "      <td>2034</td>\n",
              "      <td>37</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>7704815648282627360</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>102135261047771136</td>\n",
              "      <td>#vintagechanel</td>\n",
              "      <td>['https://v19.tiktokcdn.com/2e171f68a59c70c48c...</td>\n",
              "      <td>3228</td>\n",
              "      <td>243731</td>\n",
              "      <td>36</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>7664234166342470942</td>\n",
              "      <td>2026-07-19</td>\n",
              "      <td>6532027110620397569</td>\n",
              "      <td>Welcome to Abode✨ #interiordesign #boutique #c...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/5932d1e0587e3d9395...</td>\n",
              "      <td>243</td>\n",
              "      <td>15660</td>\n",
              "      <td>34</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>7664809977806081311</td>\n",
              "      <td>2026-07-21</td>\n",
              "      <td>7030604659140559878</td>\n",
              "      <td>Late 60s Fashion  #fashion #vintage #mod #60s ...</td>\n",
              "      <td>['https://v19.tiktokcdn.com/1bfb9c9e145432e5c8...</td>\n",
              "      <td>46</td>\n",
              "      <td>6921</td>\n",
              "      <td>31</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e5b4cb4e-25bb-49c6-8d6e-fd81ef865f0a')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-e5b4cb4e-25bb-49c6-8d6e-fd81ef865f0a button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-e5b4cb4e-25bb-49c6-8d6e-fd81ef865f0a');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_ebc1bbb9-7d8a-4ec0-bd42-6de4e4a23308\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df_keyword')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_ebc1bbb9-7d8a-4ec0-bd42-6de4e4a23308 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df_keyword');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df_keyword",
              "summary": "{\n  \"name\": \"df_keyword\",\n  \"rows\": 30,\n  \"fields\": [\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 20821523978582360,\n        \"min\": 7641975923608210701,\n        \"max\": 7704848262267817229,\n        \"num_unique_values\": 29,\n        \"samples\": [\n          7664234166342470942,\n          7704730698053324039,\n          7704736690782440736\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"createTime\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 22,\n        \"samples\": [\n          \"2026-06-17\",\n          \"2026-10-14\",\n          \"2026-07-20\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorId\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 2455475922470472192,\n        \"min\": 9475174,\n        \"max\": 7684837725748495373,\n        \"num_unique_values\": 27,\n        \"samples\": [\n          6742548297862988806,\n          6811317678587610117,\n          6795636828735521797\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 29,\n        \"samples\": [\n          \"Welcome to Abode\\u2728 #interiordesign #boutique #curatedvintage #european #shoplocal \",\n          \"first date look inspo #lanadelrey #coquette #vintageamericana \",\n          \"la qualit\\u00e9 jsuis choqu\\u00e9e \\ud83d\\ude02\\ud83d\\ude02 #ipodtouch #vintage \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.urls\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 30,\n        \"samples\": [\n          \"['https://v19.tiktokcdn.com/2e171f68a59c70c48c3d3e036e1de811/6aef5254/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oIItrZoEiuBAdzGio5AXP1AB0BrBICQvI9Rvfd/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=1487&ft=XsFb_qT0mI2PD12.TtEI3wUAJEYZaeF~O5&mime_type=video_mp4&rc=Zzs3OGRlOGY2NTw2PDMzM0Bpamk4b245cnFqZTMzZjczNUBiMy5gYzA0NjUxYF8yXjAyYSNpb29pMmRjLmphLS1kMTNzcw%3D%3D&vvpl=1&l=202611070031066AFD23D971DA8561E7C3&btag=e000b0000', 'https://v16m.tiktokcdn.com/90bef79b932c8c84b5c68f1ac9b3ed0c/6aef5254/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/oIItrZoEiuBAdzGio5AXP1AB0BrBICQvI9Rvfd/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=1487&ft=XsFb_qT0mI2PD12.TtEI3wUAJEYZaeF~O5&mime_type=video_mp4&rc=Zzs3OGRlOGY2NTw2PDMzM0Bpamk4b245cnFqZTMzZjczNUBiMy5gYzA0NjUxYF8yXjAyYSNpb29pMmRjLmphLS1kMTNzcw%3D%3D&vvpl=1&l=202611070031066AFD23D971DA8561E7C3&btag=e000b0000', 'https://api-h2.tiktokv.com/aweme/v1/play/?faid=1233&file_id=5030a059b3c942839c753bfac51468ed&is_play_url=1&item_id=7704815648282627360&line=0&pt=dGlrdG9rLnNlYXJjaC5hcGkmL2F3ZW1lL3YxL3NlYXJjaC9pdGVtLyYyMDI2MTEwNzAwMzEwNjZBRkQyM0Q5NzFEQTg1NjFFN0MzJjE3OTM5ODI2NjcmY2UzYmU5MmI5NzJk&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLjA3Y2YwYjVmNWIzMDJiODQ2Nzg1YmEwZmU5MzdjNzY2&source=SEARCH&video_id=v26044gc0000dbmg1nfog65kllr5rflg']\",\n          \"['https://v19.tiktokcdn.com/abd21e0727e7e0e2bd27e94e0b167920/6aef5254/video/tos/alisg/tos-alisg-ve-37c799-sg/o4LiK1RCIK4ESz2BXbHBfDmRiyAiQ4egBRaqEp/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=1659&ft=XsFb_qT0mI2PD12.TtEI3wUAJEYZaeF~O5&mime_type=video_mp4&rc=aGYzOzY6aGU7NDw4ODNnaUBpM3E8ZHI5cnN3ZTMzZzczNEAuNGJfNTQzXzMxYDU1MS5jYSNnLzYyMmRjL2FhLS1kMS9zcw%3D%3D&vvpl=1&l=202611070031066AFD23D971DA8561E7C3&btag=e000b0000', 'https://v16m.tiktokcdn.com/138a9c68f52b72b6fea8a83d205e2fc1/6aef5254/video/tos/alisg/tos-alisg-ve-37c799-sg/o4LiK1RCIK4ESz2BXbHBfDmRiyAiQ4egBRaqEp/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=1659&ft=XsFb_qT0mI2PD12.TtEI3wUAJEYZaeF~O5&mime_type=video_mp4&rc=aGYzOzY6aGU7NDw4ODNnaUBpM3E8ZHI5cnN3ZTMzZzczNEAuNGJfNTQzXzMxYDU1MS5jYSNnLzYyMmRjL2FhLS1kMS9zcw%3D%3D&vvpl=1&l=202611070031066AFD23D971DA8561E7C3&btag=e000b0000', 'https://api-h2.tiktokv.com/aweme/v1/play/?faid=1233&file_id=ff1d408585c94168bb6e7783b8e07c1e&is_play_url=1&item_id=7699981055746411789&line=0&pt=dGlrdG9rLnNlYXJjaC5hcGkmL2F3ZW1lL3YxL3NlYXJjaC9pdGVtLyYyMDI2MTEwNzAwMzEwNjZBRkQyM0Q5NzFEQTg1NjFFN0MzJjE3OTM5ODI2NjcmY2UzYmU5MmI5NzJk&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLjg3MDc5ZTM5ZTY5Nzk3YWExMjY0MmU0NjkyN2NkYzli&source=SEARCH&video_id=v12044gd0000dbdt2pfog65o5a992nj0']\",\n          \"['https://v19.tiktokcdn.com/07d27e953b91d8fe64a756bac6d15e4e/6aef526b/video/tos/alisg/tos-alisg-ve-37c799-sg/oIgwARsf1fU7F5efQAYAiUnpGNrAhF8RU4g148/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=966&ft=XsFb_qT0mI2PD12BTtEI3wUd~DUoaeF~O5&mime_type=video_mp4&rc=NDs2Mzk8OzplZ2k5aThpPEBpMzp0Z2w5cm14ZTMzaTczNEBiYGNiNGJgNWExXmJfL15hYSMycHNmMmRrL2dhLS1kMTJzcw%3D%3D&vvpl=1&l=20261107003116405B7F4B36A003C58D10&btag=e000b8000', 'https://v16m.tiktokcdn.com/ab33de251f899f548a4caa170ce5e365/6aef526b/video/tos/alisg/tos-alisg-ve-37c799-sg/oIgwARsf1fU7F5efQAYAiUnpGNrAhF8RU4g148/?a=1233&bti=NEBzNTY6QGo6OjZALnAjNDQuYCMxNDNg&&bt=966&ft=XsFb_qT0mI2PD12BTtEI3wUd~DUoaeF~O5&mime_type=video_mp4&rc=NDs2Mzk8OzplZ2k5aThpPEBpMzp0Z2w5cm14ZTMzaTczNEBiYGNiNGJgNWExXmJfL15hYSMycHNmMmRrL2dhLS1kMTJzcw%3D%3D&vvpl=1&l=20261107003116405B7F4B36A003C58D10&btag=e000b8000', 'https://api-h2.tiktokv.com/aweme/v1/play/?faid=1233&file_id=d9af25bfe6af4ddb87c8e976e0f3c8e1&is_play_url=1&item_id=7703373520184610078&line=0&pt=dGlrdG9rLnNlYXJjaC5hcGkmL2F3ZW1lL3YxL3NlYXJjaC9pdGVtLyYyMDI2MTEwNzAwMzExNjQwNUI3RjRCMzZBMDAzQzU4RDEwJjE3OTM5ODI2NzcmZmQ5MDg1MWFhMGU4&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLjg4YmYwMTdhZWQ0ZmQ0MDNjNzQ3YjdmNTQ3YWNmZTI4&source=SEARCH&video_id=v15044gf0000dbju2jnog65iidvqs750']\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"shareCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 44127,\n        \"min\": 10,\n        \"max\": 216139,\n        \"num_unique_values\": 28,\n        \"samples\": [\n          8288,\n          3228,\n          5877\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"playCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 2741546,\n        \"min\": 2034,\n        \"max\": 15002789,\n        \"num_unique_values\": 29,\n        \"samples\": [\n          15660,\n          160325,\n          346871\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"commentCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1188,\n        \"min\": 31,\n        \"max\": 6076,\n        \"num_unique_values\": 27,\n        \"samples\": [\n          389,\n          159,\n          332\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# set search criteria\n",
        "comments_to_retrieve = 60 # 30 is a safe number = 1 credit!\n",
        "\n",
        "comments = list()\n",
        "for i in range(2): # change the range to get more!\n",
        "    aweme_id = df_keyword[\"id\"][i]\n",
        "    cursor = None\n",
        "    for _ in range(int(comments_to_retrieve/30)):\n",
        "        result = client.tiktok.post_comments(\n",
        "            aweme_id = aweme_id,\n",
        "            cursor = cursor\n",
        "        )\n",
        "        comments.extend(result.data[\"comments\"])\n",
        "        cursor = result.data.get(\"nextCursor\")\n",
        "        if cursor is None:\n",
        "            break"
      ],
      "metadata": {
        "id": "1ALIWawY_9Ei"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# convert json to dataframe\n",
        "df = pd.json_normalize(comments)\n",
        "\n",
        "# extract relevant info\n",
        "df = df[['aweme_id', 'cid', 'create_time', 'text', 'reply_comment_total']]\n",
        "\n",
        "# format time to date in string format\n",
        "df[\"create_time\"] = [str(datetime.fromtimestamp(int(i)).date())\n",
        "                                                for i in df[\"create_time\"]]\n",
        "\n",
        "# order by number of replies\n",
        "df = df.sort_values(by=['reply_comment_total'], ascending=False).reset_index(drop=True)\n",
        "\n",
        "# save\n",
        "df_comments = df\n",
        "df_comments.to_csv('rome_tiktok_hashtag_comments.csv', index=False)"
      ],
      "metadata": {
        "id": "Led0aSKzVX6q"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "display(df_comments)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 424
        },
        "id": "YK2Q2nUcUts8",
        "outputId": "14a0e060-8b97-4e5b-9d1a-1fa47bdec1dc"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "                aweme_id                  cid create_time  \\\n",
              "0    7652416717125160222  7652703453714088721  2026-06-18   \n",
              "1    7652416717125160222  7652819290283311886  2026-06-18   \n",
              "2    7652416717125160222  7652965589774533384  2026-06-19   \n",
              "3    7652416717125160222  7652965589774533384  2026-06-19   \n",
              "4    7652416717125160222  7653148689313743624  2026-06-19   \n",
              "..                   ...                  ...         ...   \n",
              "112  7703526867185175821  7703792417807581966  2026-11-03   \n",
              "113  7703526867185175821  7703724040713126687  2026-11-02   \n",
              "114  7703526867185175821  7703787388137194270  2026-11-03   \n",
              "115  7703526867185175821  7703857650093605662  2026-11-03   \n",
              "116  7703526867185175821  7703680877960413982  2026-11-02   \n",
              "\n",
              "                                                  text  reply_comment_total  \n",
              "0                          this and crying in his arms                  365  \n",
              "1    [Sticker] shaved legs and vanilla scent throug...                  289  \n",
              "2    РЕБЯТА У МЕНЯ ПОМЫТАЯ ГОЛОВА С ПОСТИРНОЙ ПОСТЕ...                   54  \n",
              "3    РЕБЯТА У МЕНЯ ПОМЫТАЯ ГОЛОВА С ПОСТИРНОЙ ПОСТЕ...                   54  \n",
              "4                                 this and without man                   46  \n",
              "..                                                 ...                  ...  \n",
              "112                           I REMEMBER LERNER SHOPS.                    0  \n",
              "113                 That was our store back in the day                    0  \n",
              "114  I used to shop at learners all the time in Mon...                    0  \n",
              "115                 Yes, I shopped there all the time!                    0  \n",
              "116                                It was my favorite.                    0  \n",
              "\n",
              "[117 rows x 5 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-8d9f80f2-d799-4a6a-9dbe-452a618ce916\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>aweme_id</th>\n",
              "      <th>cid</th>\n",
              "      <th>create_time</th>\n",
              "      <th>text</th>\n",
              "      <th>reply_comment_total</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>this and crying in his arms</td>\n",
              "      <td>365</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652819290283311886</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>[Sticker] shaved legs and vanilla scent throug...</td>\n",
              "      <td>289</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652965589774533384</td>\n",
              "      <td>2026-06-19</td>\n",
              "      <td>РЕБЯТА У МЕНЯ ПОМЫТАЯ ГОЛОВА С ПОСТИРНОЙ ПОСТЕ...</td>\n",
              "      <td>54</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652965589774533384</td>\n",
              "      <td>2026-06-19</td>\n",
              "      <td>РЕБЯТА У МЕНЯ ПОМЫТАЯ ГОЛОВА С ПОСТИРНОЙ ПОСТЕ...</td>\n",
              "      <td>54</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7653148689313743624</td>\n",
              "      <td>2026-06-19</td>\n",
              "      <td>this and without man</td>\n",
              "      <td>46</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>112</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>7703792417807581966</td>\n",
              "      <td>2026-11-03</td>\n",
              "      <td>I REMEMBER LERNER SHOPS.</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>113</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>7703724040713126687</td>\n",
              "      <td>2026-11-02</td>\n",
              "      <td>That was our store back in the day</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>114</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>7703787388137194270</td>\n",
              "      <td>2026-11-03</td>\n",
              "      <td>I used to shop at learners all the time in Mon...</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>115</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>7703857650093605662</td>\n",
              "      <td>2026-11-03</td>\n",
              "      <td>Yes, I shopped there all the time!</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>7703526867185175821</td>\n",
              "      <td>7703680877960413982</td>\n",
              "      <td>2026-11-02</td>\n",
              "      <td>It was my favorite.</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>117 rows × 5 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-8d9f80f2-d799-4a6a-9dbe-452a618ce916')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-8d9f80f2-d799-4a6a-9dbe-452a618ce916 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-8d9f80f2-d799-4a6a-9dbe-452a618ce916');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_7d32b196-500e-459f-a417-22d0b9f59672\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_7d32b196-500e-459f-a417-22d0b9f59672 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 117,\n  \"fields\": [\n    {\n      \"column\": \"aweme_id\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"7703526867185175821\",\n          \"7652416717125160222\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"cid\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 108,\n        \"samples\": [\n          \"7704910795868668702\",\n          \"7703670723680371486\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"create_time\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 18,\n        \"samples\": [\n          \"2026-06-18\",\n          \"2026-06-19\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 108,\n        \"samples\": [\n          \"It wasn\\u2019t budget. I loved that store. The name was changed to New York and Company, they went out of business.\",\n          \"It became New York and Company\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"reply_comment_total\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 43,\n        \"min\": 0,\n        \"max\": 365,\n        \"num_unique_values\": 18,\n        \"samples\": [\n          365,\n          289\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Replies search"
      ],
      "metadata": {
        "id": "F9rcrHsDYE6W"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# set search criteria\n",
        "replies_to_retrieve = 30 # 30 is a safe number = 1 credit!\n",
        "\n",
        "replies = list()\n",
        "for i in range(4): # change the range to get more!\n",
        "    aweme_id = df_comments[\"aweme_id\"][i]\n",
        "    cid = df_comments[\"cid\"][i]\n",
        "    cursor = None\n",
        "    for _ in range(int(replies_to_retrieve/30)):\n",
        "        result = client.tiktok.post_comment_replies(\n",
        "            aweme_id = aweme_id,\n",
        "            comment_id = cid,\n",
        "            cursor = cursor\n",
        "        )\n",
        "        replies.extend(result.data[\"comments\"])\n",
        "        cursor = result.data.get(\"nextCursor\")\n",
        "        if cursor is None:\n",
        "            break"
      ],
      "metadata": {
        "id": "9xeZXnwaYs3x"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# convert json to dataframe\n",
        "df = pd.json_normalize(replies)\n",
        "\n",
        "# extract relevant info\n",
        "df = df[['aweme_id', 'cid', 'reply_id', 'create_time', 'text']]\n",
        "\n",
        "# format time to date in string format\n",
        "df[\"create_time\"] = [str(datetime.fromtimestamp(int(i)).date())\n",
        "                                                for i in df[\"create_time\"]]\n",
        "\n",
        "# save\n",
        "df_replies = df\n",
        "df_replies.to_csv('rome_tiktok_hashtag_replies.csv', index=False)"
      ],
      "metadata": {
        "id": "KvV-RSpNZWGG"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "display(df_replies)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 424
        },
        "id": "meIST66TZd7X",
        "outputId": "bc71b064-40e0-4f90-fdf0-dc046d0145f7"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "                aweme_id                  cid             reply_id  \\\n",
              "0    7652416717125160222  7652821854542316310  7652703453714088721   \n",
              "1    7652416717125160222  7652851938790884126  7652703453714088721   \n",
              "2    7652416717125160222  7652888926260921102  7652703453714088721   \n",
              "3    7652416717125160222  7652866916843111198  7652703453714088721   \n",
              "4    7652416717125160222  7657563289832260382  7652703453714088721   \n",
              "..                   ...                  ...                  ...   \n",
              "115  7652478835446779158  7653565542666732308  7653311157298414357   \n",
              "116  7652478835446779158  7653779895155966738  7653311157298414357   \n",
              "117  7652478835446779158  7655029129109603090  7653311157298414357   \n",
              "118  7652478835446779158  7654093366833742623  7653311157298414357   \n",
              "119  7652478835446779158  7654096258911863559  7653311157298414357   \n",
              "\n",
              "    create_time                                               text  \n",
              "0    2026-06-18                        why would a m*n be HERE bro  \n",
              "1    2026-06-18             Does everything have to be about a man  \n",
              "2    2026-06-18  I cannot with y’all. Overly male centered, alw...  \n",
              "3    2026-06-18                          Always thinking about men  \n",
              "4    2026-07-01                                   Lesbians be like  \n",
              "..          ...                                                ...  \n",
              "115  2026-06-20                                какая нахуй разница  \n",
              "116  2026-06-21                                         [Sticker]   \n",
              "117  2026-06-24                 [Sticker] как же вы доели стикером  \n",
              "118  2026-06-22                      [Sticker] ПРИВАТНЫЙ АККАУНТ😭😭  \n",
              "119  2026-06-22                      да ты шо нафиг а я и не знала  \n",
              "\n",
              "[120 rows x 5 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-6b003f32-8132-4e9d-a656-77477332bc36\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>aweme_id</th>\n",
              "      <th>cid</th>\n",
              "      <th>reply_id</th>\n",
              "      <th>create_time</th>\n",
              "      <th>text</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652821854542316310</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>why would a m*n be HERE bro</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652851938790884126</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>Does everything have to be about a man</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652888926260921102</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>I cannot with y’all. Overly male centered, alw...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7652866916843111198</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-06-18</td>\n",
              "      <td>Always thinking about men</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7652416717125160222</td>\n",
              "      <td>7657563289832260382</td>\n",
              "      <td>7652703453714088721</td>\n",
              "      <td>2026-07-01</td>\n",
              "      <td>Lesbians be like</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>115</th>\n",
              "      <td>7652478835446779158</td>\n",
              "      <td>7653565542666732308</td>\n",
              "      <td>7653311157298414357</td>\n",
              "      <td>2026-06-20</td>\n",
              "      <td>какая нахуй разница</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>116</th>\n",
              "      <td>7652478835446779158</td>\n",
              "      <td>7653779895155966738</td>\n",
              "      <td>7653311157298414357</td>\n",
              "      <td>2026-06-21</td>\n",
              "      <td>[Sticker]</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>117</th>\n",
              "      <td>7652478835446779158</td>\n",
              "      <td>7655029129109603090</td>\n",
              "      <td>7653311157298414357</td>\n",
              "      <td>2026-06-24</td>\n",
              "      <td>[Sticker] как же вы доели стикером</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>118</th>\n",
              "      <td>7652478835446779158</td>\n",
              "      <td>7654093366833742623</td>\n",
              "      <td>7653311157298414357</td>\n",
              "      <td>2026-06-22</td>\n",
              "      <td>[Sticker] ПРИВАТНЫЙ АККАУНТ😭😭</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>119</th>\n",
              "      <td>7652478835446779158</td>\n",
              "      <td>7654096258911863559</td>\n",
              "      <td>7653311157298414357</td>\n",
              "      <td>2026-06-22</td>\n",
              "      <td>да ты шо нафиг а я и не знала</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>120 rows × 5 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-6b003f32-8132-4e9d-a656-77477332bc36')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-6b003f32-8132-4e9d-a656-77477332bc36 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-6b003f32-8132-4e9d-a656-77477332bc36');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_c093e10e-a0a5-461c-8fdb-8f9185d23059\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_c093e10e-a0a5-461c-8fdb-8f9185d23059 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 120,\n  \"fields\": [\n    {\n      \"column\": \"aweme_id\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"7652478835446779158\",\n          \"7652416717125160222\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"cid\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 120,\n        \"samples\": [\n          \"7674699738860389150\",\n          \"7652894309608407838\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"reply_id\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"7652819290283311886\",\n          \"7653311157298414357\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"create_time\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 38,\n        \"samples\": [\n          \"2026-07-14\",\n          \"2026-07-09\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 101,\n        \"samples\": [\n          \"\\u043a\\u0430\\u043a\\u0438\\u0445 \\u0442\\u0430\\u043a\\u0438\\u0445 , \\u0432\\u0441\\u0435\\u043c \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u0432\\u0441\\u0435 \\u0440\\u0430\\u0432\\u043d\\u043e\",\n          \"room freshly cleaned,entire body shaved, said goodnight to my boyfriend, the sounds of rain, a little prayer, and subliminal or frequencys, the perfect temperature. perfect night\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Read posts from one specific author"
      ],
      "metadata": {
        "id": "EbpTbZqcZkbt"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "User info"
      ],
      "metadata": {
        "id": "A9e8n6CGaw5K"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np"
      ],
      "metadata": {
        "id": "RrCur1Alao5-"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "df = pd.DataFrame()\n",
        "df['username'] = ['chaos.dreamland']\n",
        "df['processed'] = 0\n",
        "df"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 89
        },
        "id": "F0CPilhGaIAE",
        "outputId": "7369aa85-451c-42ff-a994-679df8e4d493"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "          username  processed\n",
              "0  chaos.dreamland          0"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-abc8f89a-59e8-46d9-878f-5aeafc037251\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>username</th>\n",
              "      <th>processed</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-abc8f89a-59e8-46d9-878f-5aeafc037251')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-abc8f89a-59e8-46d9-878f-5aeafc037251 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-abc8f89a-59e8-46d9-878f-5aeafc037251');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_03511723-c2d8-4162-875a-797e022b6811\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_03511723-c2d8-4162-875a-797e022b6811 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 1,\n  \"fields\": [\n    {\n      \"column\": \"username\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"chaos.dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"processed\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 0,\n        \"max\": 0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 77
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# add accounts info (1 token per user!!!)\n",
        "\n",
        "from_names = ['user.nickname', 'user.enterprise_verify_reason',\n",
        "              'user.language', 'stats.followingCount',\n",
        "              'stats.followerCount', 'stats.heartCount',\n",
        "              'stats.videoCount', 'stats.diggCount', 'stats.heart']\n",
        "to_names = ['nickname','info', 'language', 'followingCount',\n",
        "            'followerCount', 'heartCount', 'videoCount', 'diggCount',\n",
        "            'heart']\n",
        "\n",
        "for k in range(len(df)):\n",
        "    if df.loc[k,'processed']==0:\n",
        "        print(\"... working on \" + str(k) + \" ...\")\n",
        "\n",
        "        # use ensembledata to read info\n",
        "        try:\n",
        "            result = client.tiktok.user_info_from_username(\n",
        "                            username = df.loc[k,'username'], # user name\n",
        "                            ) # cost is 1 unit\n",
        "        except EDError as e:\n",
        "            print(e.detail)\n",
        "            break\n",
        "\n",
        "        # check status code (200 = successfull response)\n",
        "        if result.status_code==200:\n",
        "            tmp = pd.json_normalize(result.data)\n",
        "            df.loc[k,to_names] = np.array(tmp[from_names])[0]\n",
        "            df.loc[k,'processed'] = 1"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "2wmikncLaIiD",
        "outputId": "0a176536-4aeb-4be6-e690-77119016d8ce"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "... working on 0 ...\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "df"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 89
        },
        "id": "tia341I3asmk",
        "outputId": "25721e7c-5be3-451e-e720-756c3c94873a"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "          username  processed         nickname info language  followingCount  \\\n",
              "0  chaos.dreamland          1  Chaos Dreamland            en           125.0   \n",
              "\n",
              "   followerCount  heartCount  videoCount  diggCount      heart  \n",
              "0       203480.0   3805844.0       181.0      476.0  3805844.0  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-6eb08913-f2c1-48e5-abf7-a421f724f8aa\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>username</th>\n",
              "      <th>processed</th>\n",
              "      <th>nickname</th>\n",
              "      <th>info</th>\n",
              "      <th>language</th>\n",
              "      <th>followingCount</th>\n",
              "      <th>followerCount</th>\n",
              "      <th>heartCount</th>\n",
              "      <th>videoCount</th>\n",
              "      <th>diggCount</th>\n",
              "      <th>heart</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>1</td>\n",
              "      <td>Chaos Dreamland</td>\n",
              "      <td></td>\n",
              "      <td>en</td>\n",
              "      <td>125.0</td>\n",
              "      <td>203480.0</td>\n",
              "      <td>3805844.0</td>\n",
              "      <td>181.0</td>\n",
              "      <td>476.0</td>\n",
              "      <td>3805844.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-6eb08913-f2c1-48e5-abf7-a421f724f8aa')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-6eb08913-f2c1-48e5-abf7-a421f724f8aa button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-6eb08913-f2c1-48e5-abf7-a421f724f8aa');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_10376314-c61d-457f-9961-465b5997d77a\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_10376314-c61d-457f-9961-465b5997d77a button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 1,\n  \"fields\": [\n    {\n      \"column\": \"username\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"chaos.dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"processed\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 1,\n        \"max\": 1,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"nickname\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"Chaos Dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"info\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"language\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"en\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"followingCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 125.0,\n        \"max\": 125.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          125.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"followerCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 203480.0,\n        \"max\": 203480.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          203480.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"heartCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 3805844.0,\n        \"max\": 3805844.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          3805844.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"videoCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 181.0,\n        \"max\": 181.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          181.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"diggCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 476.0,\n        \"max\": 476.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          476.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"heart\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 3805844.0,\n        \"max\": 3805844.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          3805844.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 79
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "User's posts"
      ],
      "metadata": {
        "id": "Yyjyp1-Ia7t4"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# read posts related to a user\n",
        "def extr(aa):\n",
        "    if (type(aa)==float):\n",
        "        return \"\"\n",
        "    else:\n",
        "        return \" \".join(i['sticker_text'][0] for i in aa)\n",
        "\n",
        "# cycle\n",
        "for k in range(len(df)):\n",
        "\n",
        "    if df.loc[k,'processed']==1:\n",
        "        print(\"... working on \" + str(k) + \" ...\")\n",
        "\n",
        "        try:\n",
        "            result = client.tiktok.user_posts_from_username(\n",
        "                          username = df.loc[k,'username'], # user name\n",
        "                          depth = 20, # get 10*depth posts\n",
        "                          new_version = True\n",
        "                          ) # cost is 1 unit + 1 unit per depth (10 posts)\n",
        "        except EDError as e:\n",
        "            print(e.detail)\n",
        "            break\n",
        "\n",
        "        # check status code (200 = successfull response)\n",
        "        if result.status_code==200:\n",
        "\n",
        "            # extract relevant info\n",
        "            tmp = pd.json_normalize(result.data[\"data\"])\n",
        "            if not 'stickers_on_item' in tmp.columns:\n",
        "              tmp['stickers_on_item'] = float(0)\n",
        "            if not 'video.download_addr' in tmp.columns:\n",
        "              tmp['video.download_addr'] = \"\"\n",
        "            tmp = tmp[['author.unique_id', #\n",
        "              'author.id', #\n",
        "              'author.download_setting', #\n",
        "              'id', #\n",
        "              'create_time', #\n",
        "              'text_language', #\n",
        "              'desc', #\n",
        "              'stickers_on_item', #\n",
        "              'stats.comment_count', #\n",
        "              'stats.digg_count', #\n",
        "              'stats.play_count', #\n",
        "              'stats.share_count', #\n",
        "              'music.play_url', #\n",
        "              'video.download_addr', #\n",
        "              ]]\n",
        "\n",
        "            # sort by date\n",
        "            tmp.sort_values(by='create_time', ascending=False, inplace=True)\n",
        "            tmp.reset_index(inplace=True,drop=True)\n",
        "\n",
        "            # overwrite username\n",
        "            tmp[\"processed\"] = 0\n",
        "            tmp[\"username\"] = df.loc[k,'username']\n",
        "            # format aweme_id\n",
        "            tmp['id'] = tmp['id'].astype(str)\n",
        "\n",
        "            # format time to date in string format\n",
        "            tmp[\"create_time\"] = [str(datetime.fromtimestamp(int(i)).date())\n",
        "                                                            for i in tmp[\"create_time\"]]\n",
        "\n",
        "            # extract videoscript\n",
        "            tmp[\"stickers_on_item\"] = [extr(text) for text in tmp[\"stickers_on_item\"]]\n",
        "\n",
        "            # store info\n",
        "            tmp.to_excel('user'+str(k)+''+\"_posts.xlsx\",index=False)\n",
        "            df.loc[k,'processed']=2\n",
        "            df.loc[k,'downloadedPosts']=len(tmp)\n",
        "            print(str(len(tmp)) + \" posts downloaded and saved\")"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "rJ60j1hpeNDV",
        "outputId": "98226983-12c0-47af-820f-3512de4d8bd0"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "... working on 0 ...\n",
            "189 posts downloaded and saved\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "df"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 118
        },
        "id": "Vil8N4u1edYn",
        "outputId": "11d00dbf-2a68-4e65-9aa3-084de017034e"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "          username  processed         nickname info language  followingCount  \\\n",
              "0  chaos.dreamland          2  Chaos Dreamland            en           125.0   \n",
              "\n",
              "   followerCount  heartCount  videoCount  diggCount      heart  \\\n",
              "0       203313.0   3802281.0       181.0      476.0  3802281.0   \n",
              "\n",
              "   downloadedPosts  \n",
              "0            189.0  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-57b554a8-8ec6-4c75-aa85-8905404b66e1\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>username</th>\n",
              "      <th>processed</th>\n",
              "      <th>nickname</th>\n",
              "      <th>info</th>\n",
              "      <th>language</th>\n",
              "      <th>followingCount</th>\n",
              "      <th>followerCount</th>\n",
              "      <th>heartCount</th>\n",
              "      <th>videoCount</th>\n",
              "      <th>diggCount</th>\n",
              "      <th>heart</th>\n",
              "      <th>downloadedPosts</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>2</td>\n",
              "      <td>Chaos Dreamland</td>\n",
              "      <td></td>\n",
              "      <td>en</td>\n",
              "      <td>125.0</td>\n",
              "      <td>203313.0</td>\n",
              "      <td>3802281.0</td>\n",
              "      <td>181.0</td>\n",
              "      <td>476.0</td>\n",
              "      <td>3802281.0</td>\n",
              "      <td>189.0</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-57b554a8-8ec6-4c75-aa85-8905404b66e1')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-57b554a8-8ec6-4c75-aa85-8905404b66e1 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-57b554a8-8ec6-4c75-aa85-8905404b66e1');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_521d365c-0b2d-4f73-a964-8185fc0d6c31\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_521d365c-0b2d-4f73-a964-8185fc0d6c31 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 1,\n  \"fields\": [\n    {\n      \"column\": \"username\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"chaos.dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"processed\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 2,\n        \"max\": 2,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          2\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"nickname\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"Chaos Dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"info\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"language\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"en\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"followingCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 125.0,\n        \"max\": 125.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          125.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"followerCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 203313.0,\n        \"max\": 203313.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          203313.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"heartCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 3802281.0,\n        \"max\": 3802281.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          3802281.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"videoCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 181.0,\n        \"max\": 181.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          181.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"diggCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 476.0,\n        \"max\": 476.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          476.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"heart\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 3802281.0,\n        \"max\": 3802281.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          3802281.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"downloadedPosts\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": 189.0,\n        \"max\": 189.0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          189.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 57
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "df2 = pd.DataFrame()\n",
        "num = 0\n",
        "for k in tqdm(range(len(df))):\n",
        "  if df.loc[k,'processed']==2:\n",
        "    tmp = pd.read_excel('user'+str(k)+''+\"_posts.xlsx\")\n",
        "    tmp['id'] = tmp['id'].astype(str)\n",
        "    num = num+len(tmp)\n",
        "    df2 = pd.concat([df2,tmp])"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 49,
          "referenced_widgets": [
            "1b10346f111f47cf872e6a11fe4c2373",
            "787bbc6f2c38454f9f88c77ccf307fb2",
            "7bbddc6383b544f7899cf815a5a3e851",
            "58b7ed4d15c24c989a324cb41cfc2b52",
            "199dc4fe0f2c4c3ab070041910cf906b",
            "eb7d6710b74e4e46af91b00370017ffd",
            "4ebe71b92f9742998482c3dd14d2a651",
            "087f0bd39a2f401c8fe814d35e92fbba",
            "185348517be542518a9c457424a14d4d",
            "7931c5e206fe4a2fb911bdd00ef033a9",
            "2b1f8184de7e42ae97a667805d0aaeda"
          ]
        },
        "id": "Vk38crvJetdH",
        "outputId": "97ed39cf-bc55-4907-f3d2-36e4af942989"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/1 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "1b10346f111f47cf872e6a11fe4c2373"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "df2"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 947
        },
        "id": "-UFzvZtPe-4g",
        "outputId": "406c8c82-e3dc-47d9-fadc-e75534d55662"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "    author.unique_id            author.id  author.download_setting  \\\n",
              "0    chaos.dreamland  7274948634277315617                        3   \n",
              "1    chaos.dreamland  7274948634277315617                        3   \n",
              "2    chaos.dreamland  7274948634277315617                        3   \n",
              "3    chaos.dreamland  7274948634277315617                        3   \n",
              "4    chaos.dreamland  7274948634277315617                        3   \n",
              "..               ...                  ...                      ...   \n",
              "184  chaos.dreamland  7274948634277315617                        3   \n",
              "185  chaos.dreamland  7274948634277315617                        3   \n",
              "186  chaos.dreamland  7274948634277315617                        3   \n",
              "187  chaos.dreamland  7274948634277315617                        3   \n",
              "188  chaos.dreamland  7274948634277315617                        3   \n",
              "\n",
              "                      id create_time text_language  \\\n",
              "0    7704989603601648928  2026-11-06            en   \n",
              "1    7704918079653809441  2026-11-06            en   \n",
              "2    7704759529812151585  2026-11-05            en   \n",
              "3    7704636230712954145  2026-11-05            en   \n",
              "4    7704628665492999456  2026-11-05            en   \n",
              "..                   ...         ...           ...   \n",
              "184  7624937578105441558  2026-04-04            en   \n",
              "185  7621813940644859158  2026-03-27            un   \n",
              "186  7620719204420947222  2026-03-24            en   \n",
              "187  7555188726968732950  2025-09-28            en   \n",
              "188  7552484991985356054  2025-09-21            en   \n",
              "\n",
              "                                                  desc  stickers_on_item  \\\n",
              "0                Spooky but cutie 💖✨ #bats #bat #pink                NaN   \n",
              "1      Diva chick 🐣💖 #chick #adorableanimals #vintage                NaN   \n",
              "2    My milkshake 💖🪽 Follow me on IG for more!  Mad...               NaN   \n",
              "3               Home 💖✨ #mermaidlife #mermaidsarereal    CHAOSDREAMLAND    \n",
              "4    Splash splash  #mermaid #mermaidtiktok #nostal...   CHAOSDREAMLAND    \n",
              "..                                                 ...               ...   \n",
              "184  Yearning for a place and time that never exist...               NaN   \n",
              "185       💖💎  #artificialintelligence #vintage #pinup   @CHAOSDREAMLAND    \n",
              "186  Just another day in paradise 🌞💖 💻Made by Chaos...               NaN   \n",
              "187                                 Let’s fly away ✈️💖    ChaosDreamland   \n",
              "188  Sparkle ✨ 💖 #glitter #sparkle #fashiontiktok #...               NaN   \n",
              "\n",
              "     stats.comment_count  stats.digg_count  stats.play_count  \\\n",
              "0                      2               121              1177   \n",
              "1                      5               193              1749   \n",
              "2                      3               742              7107   \n",
              "3                     10              2192             16405   \n",
              "4                     14              1776             12979   \n",
              "..                   ...               ...               ...   \n",
              "184                    1               224              5433   \n",
              "185                    0               218              5135   \n",
              "186                    3               355              6529   \n",
              "187                    4               237              4988   \n",
              "188                    4               179              4035   \n",
              "\n",
              "     stats.share_count                                     music.play_url  \\\n",
              "0                    7  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "1                    9  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "2                   83  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "3                   83  https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...   \n",
              "4                   64  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "..                 ...                                                ...   \n",
              "184                 10  https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...   \n",
              "185                  6  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "186                 19  https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...   \n",
              "187                 13  https://sf16-music.tiktokcdn-eu.com/obj/tiktok...   \n",
              "188                  7  https://sf16-music.tiktokcdn-eu.com/obj/tos-al...   \n",
              "\n",
              "     video.download_addr  processed         username  \n",
              "0                    NaN          0  chaos.dreamland  \n",
              "1                    NaN          0  chaos.dreamland  \n",
              "2                    NaN          0  chaos.dreamland  \n",
              "3                    NaN          0  chaos.dreamland  \n",
              "4                    NaN          0  chaos.dreamland  \n",
              "..                   ...        ...              ...  \n",
              "184                  NaN          0  chaos.dreamland  \n",
              "185                  NaN          0  chaos.dreamland  \n",
              "186                  NaN          0  chaos.dreamland  \n",
              "187                  NaN          0  chaos.dreamland  \n",
              "188                  NaN          0  chaos.dreamland  \n",
              "\n",
              "[189 rows x 16 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-0e244f5a-98b9-40eb-9308-1b8383a4307a\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>author.unique_id</th>\n",
              "      <th>author.id</th>\n",
              "      <th>author.download_setting</th>\n",
              "      <th>id</th>\n",
              "      <th>create_time</th>\n",
              "      <th>text_language</th>\n",
              "      <th>desc</th>\n",
              "      <th>stickers_on_item</th>\n",
              "      <th>stats.comment_count</th>\n",
              "      <th>stats.digg_count</th>\n",
              "      <th>stats.play_count</th>\n",
              "      <th>stats.share_count</th>\n",
              "      <th>music.play_url</th>\n",
              "      <th>video.download_addr</th>\n",
              "      <th>processed</th>\n",
              "      <th>username</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7704989603601648928</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>en</td>\n",
              "      <td>Spooky but cutie 💖✨ #bats #bat #pink</td>\n",
              "      <td>NaN</td>\n",
              "      <td>2</td>\n",
              "      <td>121</td>\n",
              "      <td>1177</td>\n",
              "      <td>7</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7704918079653809441</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>en</td>\n",
              "      <td>Diva chick 🐣💖 #chick #adorableanimals #vintage</td>\n",
              "      <td>NaN</td>\n",
              "      <td>5</td>\n",
              "      <td>193</td>\n",
              "      <td>1749</td>\n",
              "      <td>9</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7704759529812151585</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>en</td>\n",
              "      <td>My milkshake 💖🪽 Follow me on IG for more!  Mad...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>3</td>\n",
              "      <td>742</td>\n",
              "      <td>7107</td>\n",
              "      <td>83</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7704636230712954145</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>en</td>\n",
              "      <td>Home 💖✨ #mermaidlife #mermaidsarereal</td>\n",
              "      <td>CHAOSDREAMLAND</td>\n",
              "      <td>10</td>\n",
              "      <td>2192</td>\n",
              "      <td>16405</td>\n",
              "      <td>83</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7704628665492999456</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>en</td>\n",
              "      <td>Splash splash  #mermaid #mermaidtiktok #nostal...</td>\n",
              "      <td>CHAOSDREAMLAND</td>\n",
              "      <td>14</td>\n",
              "      <td>1776</td>\n",
              "      <td>12979</td>\n",
              "      <td>64</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>184</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7624937578105441558</td>\n",
              "      <td>2026-04-04</td>\n",
              "      <td>en</td>\n",
              "      <td>Yearning for a place and time that never exist...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>1</td>\n",
              "      <td>224</td>\n",
              "      <td>5433</td>\n",
              "      <td>10</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>185</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7621813940644859158</td>\n",
              "      <td>2026-03-27</td>\n",
              "      <td>un</td>\n",
              "      <td>💖💎  #artificialintelligence #vintage #pinup</td>\n",
              "      <td>@CHAOSDREAMLAND</td>\n",
              "      <td>0</td>\n",
              "      <td>218</td>\n",
              "      <td>5135</td>\n",
              "      <td>6</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>186</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7620719204420947222</td>\n",
              "      <td>2026-03-24</td>\n",
              "      <td>en</td>\n",
              "      <td>Just another day in paradise 🌞💖 💻Made by Chaos...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>3</td>\n",
              "      <td>355</td>\n",
              "      <td>6529</td>\n",
              "      <td>19</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/ies-mu...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>187</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7555188726968732950</td>\n",
              "      <td>2025-09-28</td>\n",
              "      <td>en</td>\n",
              "      <td>Let’s fly away ✈️💖</td>\n",
              "      <td>ChaosDreamland</td>\n",
              "      <td>4</td>\n",
              "      <td>237</td>\n",
              "      <td>4988</td>\n",
              "      <td>13</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tiktok...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>188</th>\n",
              "      <td>chaos.dreamland</td>\n",
              "      <td>7274948634277315617</td>\n",
              "      <td>3</td>\n",
              "      <td>7552484991985356054</td>\n",
              "      <td>2025-09-21</td>\n",
              "      <td>en</td>\n",
              "      <td>Sparkle ✨ 💖 #glitter #sparkle #fashiontiktok #...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>4</td>\n",
              "      <td>179</td>\n",
              "      <td>4035</td>\n",
              "      <td>7</td>\n",
              "      <td>https://sf16-music.tiktokcdn-eu.com/obj/tos-al...</td>\n",
              "      <td>NaN</td>\n",
              "      <td>0</td>\n",
              "      <td>chaos.dreamland</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>189 rows × 16 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-0e244f5a-98b9-40eb-9308-1b8383a4307a')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-0e244f5a-98b9-40eb-9308-1b8383a4307a button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-0e244f5a-98b9-40eb-9308-1b8383a4307a');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_e9c2efcc-47a4-423f-a7b2-9f020588d41f\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df2')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_e9c2efcc-47a4-423f-a7b2-9f020588d41f button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df2');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df2",
              "summary": "{\n  \"name\": \"df2\",\n  \"rows\": 189,\n  \"fields\": [\n    {\n      \"column\": \"author.unique_id\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"chaos.dreamland\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"author.id\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 7274948634277315617,\n        \"max\": 7274948634277315617,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          7274948634277315617\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"author.download_setting\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 3,\n        \"max\": 3,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          3\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 189,\n        \"samples\": [\n          \"7624937578105441558\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"create_time\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 113,\n        \"samples\": [\n          \"2026-05-13\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text_language\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"un\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"desc\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 189,\n        \"samples\": [\n          \"Yearning for a place and time that never existed \\ud83e\\udd40\\u2728\\ud83d\\udc8e #liminal #nostalgiacore #dreamcore \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"stickers_on_item\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"CHAOSDREAMLAND\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"stats.comment_count\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 440,\n        \"min\": 0,\n        \"max\": 5782,\n        \"num_unique_values\": 70,\n        \"samples\": [\n          9\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"stats.digg_count\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 98224,\n        \"min\": 121,\n        \"max\": 1245446,\n        \"num_unique_values\": 181,\n        \"samples\": [\n          2502\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"stats.play_count\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 551835,\n        \"min\": 1177,\n        \"max\": 6247873,\n        \"num_unique_values\": 189,\n        \"samples\": [\n          5433\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"stats.share_count\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 10105,\n        \"min\": 0,\n        \"max\": 134762,\n        \"num_unique_values\": 120,\n        \"samples\": [\n          757\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"music.play_url\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 171,\n        \"samples\": [\n          \"https://sf16-music.tiktokcdn-eu.com/obj/tos-alisg-ve-2774/ooe9RGkCYFgRMzda5D0IvbProQKzAQLHSTCfke\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.download_addr\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": null,\n        \"max\": null,\n        \"num_unique_values\": 0,\n        \"samples\": [],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"processed\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 0,\n        \"num_unique_values\": 1,\n        \"samples\": [],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"username\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 60
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Dowloading TikTok videos"
      ],
      "metadata": {
        "id": "tsg7n_kd6DtW"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import time\n",
        "from tqdm.auto import tqdm\n",
        "import matplotlib.pyplot as plt\n",
        "import json\n",
        "import requests\n",
        "from datetime import datetime\n",
        "import os\n",
        "import shutil"
      ],
      "metadata": {
        "id": "oqpeVRWF6hEB"
      },
      "execution_count": 88,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "!pip install --quiet pyktok\n",
        "import pyktok as pyk"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "wPMCdIyv6jrC",
        "outputId": "cb2f1d08-b5c4-41be-d36f-5e02f2b53290"
      },
      "execution_count": 89,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "If pyktok does not operate as expected, you may find it helpful to run the 'specify_browser' function. 'specify_browser' takes as its sole argument a string representing a browser installed on your system, e.g. \"chrome,\" \"firefox,\" \"edge,\" etc.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# read posts to download\n",
        "df_hashtag = pd.read_csv('tiktok_hashtag_posts.csv')\n",
        "\n",
        "# select only a few for download\n",
        "df = df_hashtag[0:10].copy()\n",
        "df = df.astype({'id': str})\n",
        "df"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 574
        },
        "id": "xGE7j4Z76NCx",
        "outputId": "20f94729-c095-4683-8e79-036024db17bb"
      },
      "execution_count": 96,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "                    id  createTime        authorName             authorId  \\\n",
              "0  7704930008602610974  2026-11-06  nostalgiapuraaa1  7271025388419400750   \n",
              "1  7705049583528791329  2026-11-06        ninaskocak  6797346651242775557   \n",
              "2  7704984991712906517  2026-11-06         greysia90  6836313392257549314   \n",
              "3  7704891647431085325  2026-11-06      bryson_keith  6770986836456244229   \n",
              "4  7705016073392803092  2026-11-06           basucks  7536690586608124946   \n",
              "5  7705043417243602197  2026-11-06    performancemru  7335416132207100933   \n",
              "6  7705050813391015199  2026-11-06       roshhiinnii  6955756130753201154   \n",
              "7  7705051768933190933  2026-11-06        senyasobik  7653873781861549076   \n",
              "8  7704662662080220449  2026-11-05    missitgirlshop  7670123520010044438   \n",
              "9  7704736684578983201  2026-11-05      racheltrutti  6966303131081180166   \n",
              "\n",
              "                                                text  \\\n",
              "0  Há mais de 100 anos, os pequenos já eram levad...   \n",
              "1  40 godina sjedenja u ormaru ipak učine svoje 🥲...   \n",
              "2  blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...   \n",
              "3  My favorite retro headphones just got an upgra...   \n",
              "4  sueda’nın çantalarını incelerken ekran sürem 2...   \n",
              "5  Welcome to Mauritius 🇲🇺😍 #ferrari #porsche #la...   \n",
              "6  princess era💖 #fyp #tamil #browngirl #classy #...   \n",
              "7  ну хоть не истерия. #vintage #театр #абсурд #р...   \n",
              "8  This is your warning girlies  #thrifting #ital...   \n",
              "9  backstage PLAYBACK sur IPOD TOUCH 🙏🏻🤌🏻 #playba...   \n",
              "\n",
              "                                          video.urls  shareCount  playCount  \\\n",
              "0  ['https://v19.tiktokcdn-eu.com/d2e6033b92c0bb9...         228      44729   \n",
              "1  ['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afd...          81     113181   \n",
              "2  ['https://v45.tiktokcdn-eu.com/9bc854bf0678928...         237     131969   \n",
              "3  ['https://v19.tiktokcdn-eu.com/721da200f9aed4c...          47      20823   \n",
              "4  ['https://v19.tiktokcdn-eu.com/46657c10ee2e5aa...          44      45360   \n",
              "5  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...        1402      28892   \n",
              "6  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...          14      38501   \n",
              "7  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...         109      13340   \n",
              "8  ['https://v19.tiktokcdn-eu.com/966ebc0d0de984a...           1        721   \n",
              "9  ['https://v58.tiktokcdn-eu.com/video/tos/useas...          49     220417   \n",
              "\n",
              "   commentCount  \n",
              "0            29  \n",
              "1            18  \n",
              "2           129  \n",
              "3            19  \n",
              "4            18  \n",
              "5            43  \n",
              "6            12  \n",
              "7            70  \n",
              "8             4  \n",
              "9            45  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-f160c71d-946f-4a79-8959-fb49034710f9\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>id</th>\n",
              "      <th>createTime</th>\n",
              "      <th>authorName</th>\n",
              "      <th>authorId</th>\n",
              "      <th>text</th>\n",
              "      <th>video.urls</th>\n",
              "      <th>shareCount</th>\n",
              "      <th>playCount</th>\n",
              "      <th>commentCount</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7704930008602610974</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>nostalgiapuraaa1</td>\n",
              "      <td>7271025388419400750</td>\n",
              "      <td>Há mais de 100 anos, os pequenos já eram levad...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/d2e6033b92c0bb9...</td>\n",
              "      <td>228</td>\n",
              "      <td>44729</td>\n",
              "      <td>29</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7705049583528791329</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>ninaskocak</td>\n",
              "      <td>6797346651242775557</td>\n",
              "      <td>40 godina sjedenja u ormaru ipak učine svoje 🥲...</td>\n",
              "      <td>['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afd...</td>\n",
              "      <td>81</td>\n",
              "      <td>113181</td>\n",
              "      <td>18</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7704984991712906517</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>greysia90</td>\n",
              "      <td>6836313392257549314</td>\n",
              "      <td>blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...</td>\n",
              "      <td>['https://v45.tiktokcdn-eu.com/9bc854bf0678928...</td>\n",
              "      <td>237</td>\n",
              "      <td>131969</td>\n",
              "      <td>129</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7704891647431085325</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>bryson_keith</td>\n",
              "      <td>6770986836456244229</td>\n",
              "      <td>My favorite retro headphones just got an upgra...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/721da200f9aed4c...</td>\n",
              "      <td>47</td>\n",
              "      <td>20823</td>\n",
              "      <td>19</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7705016073392803092</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>basucks</td>\n",
              "      <td>7536690586608124946</td>\n",
              "      <td>sueda’nın çantalarını incelerken ekran sürem 2...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/46657c10ee2e5aa...</td>\n",
              "      <td>44</td>\n",
              "      <td>45360</td>\n",
              "      <td>18</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>7705043417243602197</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>performancemru</td>\n",
              "      <td>7335416132207100933</td>\n",
              "      <td>Welcome to Mauritius 🇲🇺😍 #ferrari #porsche #la...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>1402</td>\n",
              "      <td>28892</td>\n",
              "      <td>43</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>7705050813391015199</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>roshhiinnii</td>\n",
              "      <td>6955756130753201154</td>\n",
              "      <td>princess era💖 #fyp #tamil #browngirl #classy #...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>14</td>\n",
              "      <td>38501</td>\n",
              "      <td>12</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>7705051768933190933</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>senyasobik</td>\n",
              "      <td>7653873781861549076</td>\n",
              "      <td>ну хоть не истерия. #vintage #театр #абсурд #р...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>109</td>\n",
              "      <td>13340</td>\n",
              "      <td>70</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>7704662662080220449</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>missitgirlshop</td>\n",
              "      <td>7670123520010044438</td>\n",
              "      <td>This is your warning girlies  #thrifting #ital...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/966ebc0d0de984a...</td>\n",
              "      <td>1</td>\n",
              "      <td>721</td>\n",
              "      <td>4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>7704736684578983201</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>racheltrutti</td>\n",
              "      <td>6966303131081180166</td>\n",
              "      <td>backstage PLAYBACK sur IPOD TOUCH 🙏🏻🤌🏻 #playba...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/useas...</td>\n",
              "      <td>49</td>\n",
              "      <td>220417</td>\n",
              "      <td>45</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f160c71d-946f-4a79-8959-fb49034710f9')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-f160c71d-946f-4a79-8959-fb49034710f9 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-f160c71d-946f-4a79-8959-fb49034710f9');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_c216f5b4-d1bb-43d7-a8f2-e6892de0e4da\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_c216f5b4-d1bb-43d7-a8f2-e6892de0e4da button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 10,\n  \"fields\": [\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"7704662662080220449\",\n          \"7705049583528791329\",\n          \"7705043417243602197\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"createTime\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"2026-11-05\",\n          \"2026-11-06\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorName\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"missitgirlshop\",\n          \"ninaskocak\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorId\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 357806449589513920,\n        \"min\": 6770986836456244229,\n        \"max\": 7670123520010044438,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          7670123520010044438,\n          6797346651242775557\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"This is your warning girlies  #thrifting #italianvintage #y2k #vintage #warning \",\n          \"40 godina sjedenja u ormaru ipak u\\u010dine svoje \\ud83e\\udd72 Ako imate stare bunde, dr\\u017eite ih u hladnijoj prostoriji i u pamu\\u010dnom pakiranju da se ovo ne dogadja!  #vintage #buvljak #bunda #ninaskocak #balkan \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.urls\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"['https://v19.tiktokcdn-eu.com/966ebc0d0de984a0bda8adb5ee1b74dd/6aef5fba/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/ogAPDEeqmE2gDREIWqYfBF67XDo5bHQ8iYIBRQ/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1524&ft=ERfCkaZWD0LQ12NvgibFzIxRW1e-CF_45SY&mime_type=video_mp4&rc=MzM5ZTc7aTM0Ozg7Omc7OkBpams1dHg5cmc6ZTMzZjczNUAvYjVgXzAwNmMxLV9iNi81YSNeNTEzMmRrX2phLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728176BCF3D89E3B90B46335B&btag=e000b0000', 'https://v16m.tiktokcdn-eu.com/e7c6b5113ce9c1aba32a46b0842daad7/6aef5fba/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/ogAPDEeqmE2gDREIWqYfBF67XDo5bHQ8iYIBRQ/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1524&ft=ERfCkaZWD0LQ12NvgibFzIxRW1e-CF_45SY&mime_type=video_mp4&rc=MzM5ZTc7aTM0Ozg7Omc7OkBpams1dHg5cmc6ZTMzZjczNUAvYjVgXzAwNmMxLV9iNi81YSNeNTEzMmRrX2phLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728176BCF3D89E3B90B46335B&btag=e000b0000', 'https://api16-normal-no1a.tiktokv.eu/aweme/v1/play/?faid=1233&file_id=87289de7b80548f1903f38b4cb86e020&is_play_url=1&item_id=7704662662080220449&line=0&pt=dGlrdG9rLmFnZ3JlZ2F0aW9uLmFwaSYvYXdlbWUvdjEvY2hhbGxlbmdlL2F3ZW1lLyYyMDI2MTEwNjE3MjgxNzZCQ0YzRDg5RTNCOTBCNDYzMzVCJjE3OTM5ODYwOTgmNDc4ZTBhOTAzZjFh&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLjAyNTYyOGU4NzU1MzcxYjFhOGJiYTlmNTFkYzAzZWE3&source=CHALLENGE_AWEME&video_id=v26044gc0000dbm7bdnog65u6q428hag']\",\n          \"['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afdd19af476596e5c75a/6aef5fd4/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o8eUbJhAGgDI10gLfyGtMVIe2QNpsqju6L8I3U/?a=1233&bti=Ojs2NGYpQHM6OjZALjU2OmQvcCMxNDNg&&bt=1550&ft=FczkaNdkVcy5Uxl7KStG-XD5Sf-7M1PXtP88OfcyqF_4&mime_type=video_mp4&rc=aDM1Z2RmODQzMzZnaTU5NEBpM3A8dHk5cmZ3ZTMzZjczNUAyXzRhMF8zXy8xXmAwM19eYSNzaGVmMmQ0XmphLS1kMTNzcw%3D%3D&vvpl=1&l=20261106172815975E553EF1F9C346F55A&btag=e0008d000', 'https://v16m.tiktokcdn-eu.com/314e2feb2d0c1ff9662e4ae53ebd0335/6aef5fd4/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o8eUbJhAGgDI10gLfyGtMVIe2QNpsqju6L8I3U/?a=1233&bti=Ojs2NGYpQHM6OjZALjU2OmQvcCMxNDNg&&bt=1550&ft=FczkaNdkVcy5Uxl7KStG-XD5Sf-7M1PXtP88OfcyqF_4&mime_type=video_mp4&rc=aDM1Z2RmODQzMzZnaTU5NEBpM3A8dHk5cmZ3ZTMzZjczNUAyXzRhMF8zXy8xXmAwM19eYSNzaGVmMmQ0XmphLS1kMTNzcw%3D%3D&vvpl=1&l=20261106172815975E553EF1F9C346F55A&btag=e00088000', 'https://api16-normal-no1a.tiktokv.eu/aweme/v1/play/?faid=1233&file_id=a1b6623fcda34020b165bc3add72b05e&is_play_url=1&item_id=7705049583528791329&line=0&pt=dGlrdG9rLmFnZ3JlZ2F0aW9uLmFwaSYvYXdlbWUvdjEvY2hhbGxlbmdlL2F3ZW1lLyYyMDI2MTEwNjE3MjgxNTk3NUU1NTNFRjFGOUMzNDZGNTVBJjE3OTM5ODYwOTYmZDU1MTJiNDZkZmNh&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLmM4ZTU3MWMyNzRlNWE3MzI1ODlmN2ZiODI1YWM1NTFl&source=CHALLENGE_AWEME&video_id=v26044gc0000dbmtac7og65viqh9kmv0']\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"shareCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 422,\n        \"min\": 1,\n        \"max\": 1402,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          1,\n          81\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"playCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 68725,\n        \"min\": 721,\n        \"max\": 220417,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          721,\n          113181\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"commentCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 37,\n        \"min\": 4,\n        \"max\": 129,\n        \"num_unique_values\": 9,\n        \"samples\": [\n          4,\n          18\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 96
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# video download\n",
        "for k in range(len(df)):\n",
        "  try:\n",
        "    video_url = \"https://www.tiktok.com/@\" + df.loc[k,'authorName'] + \\\n",
        "                  \"/video/\" + df.loc[k,'id'] + \"?is_copy_url=1&is_from_webapp=v1\"\n",
        "    video_name = \"@\" + df.loc[k,'authorName'] + \"_video_\" + df.loc[k,'id'] + \".mp4\"\n",
        "\n",
        "    # download and move\n",
        "    pyk.save_tiktok(video_url, True)\n",
        "    shutil.move(\"/content/\"+video_name,video_name)\n",
        "    # check size in Mb\n",
        "    df.loc[k,'video_Mb_size'] = round(os.path.getsize(video_name)/1000000.0,2)\n",
        "  except:\n",
        "    # something wrong, possibly it is a\n",
        "    df.loc[k,'video_Mb_size'] = -1\n",
        "\n",
        "df"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "AyOfoK9T7tyk",
        "outputId": "4fe0f20c-a895-443b-af6b-0deef531dc77"
      },
      "execution_count": 97,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Saved video\n",
            " https://www.tiktok.com/@nostalgiapuraaa1/video/7704930008602610974?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@ninaskocak/video/7705049583528791329?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@greysia90/video/7704984991712906517?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@bryson_keith/video/7704891647431085325?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@basucks/video/7705016073392803092?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@performancemru/video/7705043417243602197?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@roshhiinnii/video/7705050813391015199?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@senyasobik/video/7705051768933190933?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@missitgirlshop/video/7704662662080220449?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n",
            "Saved video\n",
            " https://www.tiktok.com/@racheltrutti/video/7704736684578983201?is_copy_url=1&is_from_webapp=v1 \n",
            "to\n",
            " /content\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "                    id  createTime        authorName             authorId  \\\n",
              "0  7704930008602610974  2026-11-06  nostalgiapuraaa1  7271025388419400750   \n",
              "1  7705049583528791329  2026-11-06        ninaskocak  6797346651242775557   \n",
              "2  7704984991712906517  2026-11-06         greysia90  6836313392257549314   \n",
              "3  7704891647431085325  2026-11-06      bryson_keith  6770986836456244229   \n",
              "4  7705016073392803092  2026-11-06           basucks  7536690586608124946   \n",
              "5  7705043417243602197  2026-11-06    performancemru  7335416132207100933   \n",
              "6  7705050813391015199  2026-11-06       roshhiinnii  6955756130753201154   \n",
              "7  7705051768933190933  2026-11-06        senyasobik  7653873781861549076   \n",
              "8  7704662662080220449  2026-11-05    missitgirlshop  7670123520010044438   \n",
              "9  7704736684578983201  2026-11-05      racheltrutti  6966303131081180166   \n",
              "\n",
              "                                                text  \\\n",
              "0  Há mais de 100 anos, os pequenos já eram levad...   \n",
              "1  40 godina sjedenja u ormaru ipak učine svoje 🥲...   \n",
              "2  blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...   \n",
              "3  My favorite retro headphones just got an upgra...   \n",
              "4  sueda’nın çantalarını incelerken ekran sürem 2...   \n",
              "5  Welcome to Mauritius 🇲🇺😍 #ferrari #porsche #la...   \n",
              "6  princess era💖 #fyp #tamil #browngirl #classy #...   \n",
              "7  ну хоть не истерия. #vintage #театр #абсурд #р...   \n",
              "8  This is your warning girlies  #thrifting #ital...   \n",
              "9  backstage PLAYBACK sur IPOD TOUCH 🙏🏻🤌🏻 #playba...   \n",
              "\n",
              "                                          video.urls  shareCount  playCount  \\\n",
              "0  ['https://v19.tiktokcdn-eu.com/d2e6033b92c0bb9...         228      44729   \n",
              "1  ['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afd...          81     113181   \n",
              "2  ['https://v45.tiktokcdn-eu.com/9bc854bf0678928...         237     131969   \n",
              "3  ['https://v19.tiktokcdn-eu.com/721da200f9aed4c...          47      20823   \n",
              "4  ['https://v19.tiktokcdn-eu.com/46657c10ee2e5aa...          44      45360   \n",
              "5  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...        1402      28892   \n",
              "6  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...          14      38501   \n",
              "7  ['https://v58.tiktokcdn-eu.com/video/tos/alisg...         109      13340   \n",
              "8  ['https://v19.tiktokcdn-eu.com/966ebc0d0de984a...           1        721   \n",
              "9  ['https://v58.tiktokcdn-eu.com/video/tos/useas...          49     220417   \n",
              "\n",
              "   commentCount  video_Mb_size  \n",
              "0            29           1.00  \n",
              "1            18           7.26  \n",
              "2           129           2.18  \n",
              "3            19           1.61  \n",
              "4            18           6.78  \n",
              "5            43           2.79  \n",
              "6            12           1.54  \n",
              "7            70           1.95  \n",
              "8             4           1.70  \n",
              "9            45           8.62  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-a9fa9a8d-1e86-40ae-8cd9-6ba03741346e\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>id</th>\n",
              "      <th>createTime</th>\n",
              "      <th>authorName</th>\n",
              "      <th>authorId</th>\n",
              "      <th>text</th>\n",
              "      <th>video.urls</th>\n",
              "      <th>shareCount</th>\n",
              "      <th>playCount</th>\n",
              "      <th>commentCount</th>\n",
              "      <th>video_Mb_size</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>7704930008602610974</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>nostalgiapuraaa1</td>\n",
              "      <td>7271025388419400750</td>\n",
              "      <td>Há mais de 100 anos, os pequenos já eram levad...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/d2e6033b92c0bb9...</td>\n",
              "      <td>228</td>\n",
              "      <td>44729</td>\n",
              "      <td>29</td>\n",
              "      <td>1.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>7705049583528791329</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>ninaskocak</td>\n",
              "      <td>6797346651242775557</td>\n",
              "      <td>40 godina sjedenja u ormaru ipak učine svoje 🥲...</td>\n",
              "      <td>['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afd...</td>\n",
              "      <td>81</td>\n",
              "      <td>113181</td>\n",
              "      <td>18</td>\n",
              "      <td>7.26</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>7704984991712906517</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>greysia90</td>\n",
              "      <td>6836313392257549314</td>\n",
              "      <td>blurrr 😭🙏🏻 #fyppppppppppppppppppppppp #cobain ...</td>\n",
              "      <td>['https://v45.tiktokcdn-eu.com/9bc854bf0678928...</td>\n",
              "      <td>237</td>\n",
              "      <td>131969</td>\n",
              "      <td>129</td>\n",
              "      <td>2.18</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>7704891647431085325</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>bryson_keith</td>\n",
              "      <td>6770986836456244229</td>\n",
              "      <td>My favorite retro headphones just got an upgra...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/721da200f9aed4c...</td>\n",
              "      <td>47</td>\n",
              "      <td>20823</td>\n",
              "      <td>19</td>\n",
              "      <td>1.61</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>7705016073392803092</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>basucks</td>\n",
              "      <td>7536690586608124946</td>\n",
              "      <td>sueda’nın çantalarını incelerken ekran sürem 2...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/46657c10ee2e5aa...</td>\n",
              "      <td>44</td>\n",
              "      <td>45360</td>\n",
              "      <td>18</td>\n",
              "      <td>6.78</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>7705043417243602197</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>performancemru</td>\n",
              "      <td>7335416132207100933</td>\n",
              "      <td>Welcome to Mauritius 🇲🇺😍 #ferrari #porsche #la...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>1402</td>\n",
              "      <td>28892</td>\n",
              "      <td>43</td>\n",
              "      <td>2.79</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>7705050813391015199</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>roshhiinnii</td>\n",
              "      <td>6955756130753201154</td>\n",
              "      <td>princess era💖 #fyp #tamil #browngirl #classy #...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>14</td>\n",
              "      <td>38501</td>\n",
              "      <td>12</td>\n",
              "      <td>1.54</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>7705051768933190933</td>\n",
              "      <td>2026-11-06</td>\n",
              "      <td>senyasobik</td>\n",
              "      <td>7653873781861549076</td>\n",
              "      <td>ну хоть не истерия. #vintage #театр #абсурд #р...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/alisg...</td>\n",
              "      <td>109</td>\n",
              "      <td>13340</td>\n",
              "      <td>70</td>\n",
              "      <td>1.95</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>7704662662080220449</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>missitgirlshop</td>\n",
              "      <td>7670123520010044438</td>\n",
              "      <td>This is your warning girlies  #thrifting #ital...</td>\n",
              "      <td>['https://v19.tiktokcdn-eu.com/966ebc0d0de984a...</td>\n",
              "      <td>1</td>\n",
              "      <td>721</td>\n",
              "      <td>4</td>\n",
              "      <td>1.70</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>7704736684578983201</td>\n",
              "      <td>2026-11-05</td>\n",
              "      <td>racheltrutti</td>\n",
              "      <td>6966303131081180166</td>\n",
              "      <td>backstage PLAYBACK sur IPOD TOUCH 🙏🏻🤌🏻 #playba...</td>\n",
              "      <td>['https://v58.tiktokcdn-eu.com/video/tos/useas...</td>\n",
              "      <td>49</td>\n",
              "      <td>220417</td>\n",
              "      <td>45</td>\n",
              "      <td>8.62</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a9fa9a8d-1e86-40ae-8cd9-6ba03741346e')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-a9fa9a8d-1e86-40ae-8cd9-6ba03741346e button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-a9fa9a8d-1e86-40ae-8cd9-6ba03741346e');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "  <div id=\"id_abe6ac7e-e4fd-4f8a-bfb4-6f884a7527d4\">\n",
              "    <style>\n",
              "      .colab-df-generate {\n",
              "        background-color: #E8F0FE;\n",
              "        border: none;\n",
              "        border-radius: 50%;\n",
              "        cursor: pointer;\n",
              "        display: none;\n",
              "        fill: #1967D2;\n",
              "        height: 32px;\n",
              "        padding: 0 0 0 0;\n",
              "        width: 32px;\n",
              "      }\n",
              "\n",
              "      .colab-df-generate:hover {\n",
              "        background-color: #E2EBFA;\n",
              "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "        fill: #174EA6;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate {\n",
              "        background-color: #3B4455;\n",
              "        fill: #D2E3FC;\n",
              "      }\n",
              "\n",
              "      [theme=dark] .colab-df-generate:hover {\n",
              "        background-color: #434B5C;\n",
              "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "        fill: #FFFFFF;\n",
              "      }\n",
              "    </style>\n",
              "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
              "            title=\"Generate code using this dataframe.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "    <script>\n",
              "      (() => {\n",
              "      const buttonEl =\n",
              "        document.querySelector('#id_abe6ac7e-e4fd-4f8a-bfb4-6f884a7527d4 button.colab-df-generate');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      buttonEl.onclick = () => {\n",
              "        google.colab.notebook.generateWithVariable('df');\n",
              "      }\n",
              "      })();\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "df",
              "summary": "{\n  \"name\": \"df\",\n  \"rows\": 10,\n  \"fields\": [\n    {\n      \"column\": \"id\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"7704662662080220449\",\n          \"7705049583528791329\",\n          \"7705043417243602197\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"createTime\",\n      \"properties\": {\n        \"dtype\": \"object\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"2026-11-05\",\n          \"2026-11-06\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorName\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"missitgirlshop\",\n          \"ninaskocak\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"authorId\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 357806449589513920,\n        \"min\": 6770986836456244229,\n        \"max\": 7670123520010044438,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          7670123520010044438,\n          6797346651242775557\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"text\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"This is your warning girlies  #thrifting #italianvintage #y2k #vintage #warning \",\n          \"40 godina sjedenja u ormaru ipak u\\u010dine svoje \\ud83e\\udd72 Ako imate stare bunde, dr\\u017eite ih u hladnijoj prostoriji i u pamu\\u010dnom pakiranju da se ovo ne dogadja!  #vintage #buvljak #bunda #ninaskocak #balkan \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video.urls\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 10,\n        \"samples\": [\n          \"['https://v19.tiktokcdn-eu.com/966ebc0d0de984a0bda8adb5ee1b74dd/6aef5fba/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/ogAPDEeqmE2gDREIWqYfBF67XDo5bHQ8iYIBRQ/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1524&ft=ERfCkaZWD0LQ12NvgibFzIxRW1e-CF_45SY&mime_type=video_mp4&rc=MzM5ZTc7aTM0Ozg7Omc7OkBpams1dHg5cmc6ZTMzZjczNUAvYjVgXzAwNmMxLV9iNi81YSNeNTEzMmRrX2phLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728176BCF3D89E3B90B46335B&btag=e000b0000', 'https://v16m.tiktokcdn-eu.com/e7c6b5113ce9c1aba32a46b0842daad7/6aef5fba/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/ogAPDEeqmE2gDREIWqYfBF67XDo5bHQ8iYIBRQ/?a=1233&bti=NXYpNDs8QGo6OjZAOm00NTAuYCMxNDNg&&bt=1524&ft=ERfCkaZWD0LQ12NvgibFzIxRW1e-CF_45SY&mime_type=video_mp4&rc=MzM5ZTc7aTM0Ozg7Omc7OkBpams1dHg5cmc6ZTMzZjczNUAvYjVgXzAwNmMxLV9iNi81YSNeNTEzMmRrX2phLS1kMTNzcw%3D%3D&vvpl=1&l=202611061728176BCF3D89E3B90B46335B&btag=e000b0000', 'https://api16-normal-no1a.tiktokv.eu/aweme/v1/play/?faid=1233&file_id=87289de7b80548f1903f38b4cb86e020&is_play_url=1&item_id=7704662662080220449&line=0&pt=dGlrdG9rLmFnZ3JlZ2F0aW9uLmFwaSYvYXdlbWUvdjEvY2hhbGxlbmdlL2F3ZW1lLyYyMDI2MTEwNjE3MjgxNzZCQ0YzRDg5RTNCOTBCNDYzMzVCJjE3OTM5ODYwOTgmNDc4ZTBhOTAzZjFh&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLjAyNTYyOGU4NzU1MzcxYjFhOGJiYTlmNTFkYzAzZWE3&source=CHALLENGE_AWEME&video_id=v26044gc0000dbm7bdnog65u6q428hag']\",\n          \"['https://v45.tiktokcdn-eu.com/be6f5c17c2a4afdd19af476596e5c75a/6aef5fd4/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o8eUbJhAGgDI10gLfyGtMVIe2QNpsqju6L8I3U/?a=1233&bti=Ojs2NGYpQHM6OjZALjU2OmQvcCMxNDNg&&bt=1550&ft=FczkaNdkVcy5Uxl7KStG-XD5Sf-7M1PXtP88OfcyqF_4&mime_type=video_mp4&rc=aDM1Z2RmODQzMzZnaTU5NEBpM3A8dHk5cmZ3ZTMzZjczNUAyXzRhMF8zXy8xXmAwM19eYSNzaGVmMmQ0XmphLS1kMTNzcw%3D%3D&vvpl=1&l=20261106172815975E553EF1F9C346F55A&btag=e0008d000', 'https://v16m.tiktokcdn-eu.com/314e2feb2d0c1ff9662e4ae53ebd0335/6aef5fd4/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o8eUbJhAGgDI10gLfyGtMVIe2QNpsqju6L8I3U/?a=1233&bti=Ojs2NGYpQHM6OjZALjU2OmQvcCMxNDNg&&bt=1550&ft=FczkaNdkVcy5Uxl7KStG-XD5Sf-7M1PXtP88OfcyqF_4&mime_type=video_mp4&rc=aDM1Z2RmODQzMzZnaTU5NEBpM3A8dHk5cmZ3ZTMzZjczNUAyXzRhMF8zXy8xXmAwM19eYSNzaGVmMmQ0XmphLS1kMTNzcw%3D%3D&vvpl=1&l=20261106172815975E553EF1F9C346F55A&btag=e00088000', 'https://api16-normal-no1a.tiktokv.eu/aweme/v1/play/?faid=1233&file_id=a1b6623fcda34020b165bc3add72b05e&is_play_url=1&item_id=7705049583528791329&line=0&pt=dGlrdG9rLmFnZ3JlZ2F0aW9uLmFwaSYvYXdlbWUvdjEvY2hhbGxlbmdlL2F3ZW1lLyYyMDI2MTEwNjE3MjgxNTk3NUU1NTNFRjFGOUMzNDZGNTVBJjE3OTM5ODYwOTYmZDU1MTJiNDZkZmNh&signaturev3=dmlkZW9faWQ7ZmlsZV9pZDtpdGVtX2lkLmM4ZTU3MWMyNzRlNWE3MzI1ODlmN2ZiODI1YWM1NTFl&source=CHALLENGE_AWEME&video_id=v26044gc0000dbmtac7og65viqh9kmv0']\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"shareCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 422,\n        \"min\": 1,\n        \"max\": 1402,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          1,\n          81\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"playCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 68725,\n        \"min\": 721,\n        \"max\": 220417,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          721,\n          113181\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"commentCount\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 37,\n        \"min\": 4,\n        \"max\": 129,\n        \"num_unique_values\": 9,\n        \"samples\": [\n          4,\n          18\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"video_Mb_size\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 2.8410602480998763,\n        \"min\": 1.0,\n        \"max\": 8.62,\n        \"num_unique_values\": 10,\n        \"samples\": [\n          1.7,\n          7.26\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
            }
          },
          "metadata": {},
          "execution_count": 97
        }
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "venv",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.11.4"
    },
    "colab": {
      "provenance": []
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "version_major": 2,
        "version_minor": 0,
        "state": {
          "f5b02e85a6b9495db166b24d720c73e8": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HBoxModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_afd073ac5b0042308be47deb18a4a065",
                "IPY_MODEL_515a46ffd6f34a9082c1dd7345093c4c",
                "IPY_MODEL_97579603107d420d893a4e8781f48a49"
              ],
              "layout": "IPY_MODEL_80aba8a62259467485a04896b0d6b667"
            }
          },
          "afd073ac5b0042308be47deb18a4a065": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HTMLModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HTMLModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HTMLView",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_6aeb08430d4d4b488ee92c119f6438f8",
              "placeholder": "​",
              "style": "IPY_MODEL_4b49f359bbd54404902fface7d76d42a",
              "value": "100%"
            }
          },
          "515a46ffd6f34a9082c1dd7345093c4c": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "FloatProgressModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "FloatProgressModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "ProgressView",
              "bar_style": "success",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_f98e480c393b411a9d1e85d74f0b2b03",
              "max": 5,
              "min": 0,
              "orientation": "horizontal",
              "style": "IPY_MODEL_31bd1189a2254694a2e5d234f2593557",
              "value": 5
            }
          },
          "97579603107d420d893a4e8781f48a49": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HTMLModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HTMLModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HTMLView",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_f400ffbe55c147278cfd968c9593d92a",
              "placeholder": "​",
              "style": "IPY_MODEL_7fe1dda86a834a1cabba86ea27d4033e",
              "value": " 5/5 [00:29&lt;00:00,  6.20s/it]"
            }
          },
          "80aba8a62259467485a04896b0d6b667": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "6aeb08430d4d4b488ee92c119f6438f8": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "4b49f359bbd54404902fface7d76d42a": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "DescriptionStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "DescriptionStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "description_width": ""
            }
          },
          "f98e480c393b411a9d1e85d74f0b2b03": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "31bd1189a2254694a2e5d234f2593557": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "ProgressStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "ProgressStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "bar_color": null,
              "description_width": ""
            }
          },
          "f400ffbe55c147278cfd968c9593d92a": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "7fe1dda86a834a1cabba86ea27d4033e": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "DescriptionStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "DescriptionStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "description_width": ""
            }
          },
          "1b10346f111f47cf872e6a11fe4c2373": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HBoxModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HBoxModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HBoxView",
              "box_style": "",
              "children": [
                "IPY_MODEL_787bbc6f2c38454f9f88c77ccf307fb2",
                "IPY_MODEL_7bbddc6383b544f7899cf815a5a3e851",
                "IPY_MODEL_58b7ed4d15c24c989a324cb41cfc2b52"
              ],
              "layout": "IPY_MODEL_199dc4fe0f2c4c3ab070041910cf906b"
            }
          },
          "787bbc6f2c38454f9f88c77ccf307fb2": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HTMLModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HTMLModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HTMLView",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_eb7d6710b74e4e46af91b00370017ffd",
              "placeholder": "​",
              "style": "IPY_MODEL_4ebe71b92f9742998482c3dd14d2a651",
              "value": "100%"
            }
          },
          "7bbddc6383b544f7899cf815a5a3e851": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "FloatProgressModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "FloatProgressModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "ProgressView",
              "bar_style": "success",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_087f0bd39a2f401c8fe814d35e92fbba",
              "max": 1,
              "min": 0,
              "orientation": "horizontal",
              "style": "IPY_MODEL_185348517be542518a9c457424a14d4d",
              "value": 1
            }
          },
          "58b7ed4d15c24c989a324cb41cfc2b52": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "HTMLModel",
            "model_module_version": "1.5.0",
            "state": {
              "_dom_classes": [],
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "HTMLModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/controls",
              "_view_module_version": "1.5.0",
              "_view_name": "HTMLView",
              "description": "",
              "description_tooltip": null,
              "layout": "IPY_MODEL_7931c5e206fe4a2fb911bdd00ef033a9",
              "placeholder": "​",
              "style": "IPY_MODEL_2b1f8184de7e42ae97a667805d0aaeda",
              "value": " 1/1 [00:00&lt;00:00, 11.36it/s]"
            }
          },
          "199dc4fe0f2c4c3ab070041910cf906b": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "eb7d6710b74e4e46af91b00370017ffd": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "4ebe71b92f9742998482c3dd14d2a651": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "DescriptionStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "DescriptionStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "description_width": ""
            }
          },
          "087f0bd39a2f401c8fe814d35e92fbba": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "185348517be542518a9c457424a14d4d": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "ProgressStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "ProgressStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "bar_color": null,
              "description_width": ""
            }
          },
          "7931c5e206fe4a2fb911bdd00ef033a9": {
            "model_module": "@jupyter-widgets/base",
            "model_name": "LayoutModel",
            "model_module_version": "1.2.0",
            "state": {
              "_model_module": "@jupyter-widgets/base",
              "_model_module_version": "1.2.0",
              "_model_name": "LayoutModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "LayoutView",
              "align_content": null,
              "align_items": null,
              "align_self": null,
              "border": null,
              "bottom": null,
              "display": null,
              "flex": null,
              "flex_flow": null,
              "grid_area": null,
              "grid_auto_columns": null,
              "grid_auto_flow": null,
              "grid_auto_rows": null,
              "grid_column": null,
              "grid_gap": null,
              "grid_row": null,
              "grid_template_areas": null,
              "grid_template_columns": null,
              "grid_template_rows": null,
              "height": null,
              "justify_content": null,
              "justify_items": null,
              "left": null,
              "margin": null,
              "max_height": null,
              "max_width": null,
              "min_height": null,
              "min_width": null,
              "object_fit": null,
              "object_position": null,
              "order": null,
              "overflow": null,
              "overflow_x": null,
              "overflow_y": null,
              "padding": null,
              "right": null,
              "top": null,
              "visibility": null,
              "width": null
            }
          },
          "2b1f8184de7e42ae97a667805d0aaeda": {
            "model_module": "@jupyter-widgets/controls",
            "model_name": "DescriptionStyleModel",
            "model_module_version": "1.5.0",
            "state": {
              "_model_module": "@jupyter-widgets/controls",
              "_model_module_version": "1.5.0",
              "_model_name": "DescriptionStyleModel",
              "_view_count": null,
              "_view_module": "@jupyter-widgets/base",
              "_view_module_version": "1.2.0",
              "_view_name": "StyleView",
              "description_width": ""
            }
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}