{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import requests\n",
    "import pandas as pd\n",
    "from tqdm.notebook import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(500, 1)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1 = pd.read_excel(\"S&P 500 Index.xlsx\",header=None)\n",
    "df1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(500, 4)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_columns = [\"index\", \"code\", \"name\"]\n",
    "df1[new_columns] = df1.apply(lambda x: x[0].split(\" \"), axis = 1, result_type = \"expand\")\n",
    "df1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['A', 'AA', 'AAPL', 'ABC', 'ABT']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_list = df1.code.to_list()\n",
    "stock_list[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "500"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(stock_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "api_key = YOUR_API_KEY  # You may find your api key here https://site.financialmodelingprep.com/developer/docs/api-keys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "50eb22391ff24007aabe235fffeca89c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/80 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4afc78f887844572890171314611c89d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3a452f885fc34092ab6a3af23cf67b0b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b4d4bdffb2ac412bae8bdc515da66273",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "964434668aa042bf91440e82df2cdfbe",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8837c2e2b380425683257f95ccf91990",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a139ce60ef4c44acbdadcdcf71dc3655",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eef3100ac1a243f2979463a754ff6a09",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "df2a0f996bdc4654a02c3777359ace02",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "92892ae29bc04bd190a9340d2155de07",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "946b3c14ed0e4c2f9a9648794191f726",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9a017e62c28a4b0d870cce95f4e80def",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "931c76cecd244206a3139a4cc258dfdc",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1ab81ba9f28f42c48c5398b52dd85340",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a0101e770a0c4301a9f93230d96f2659",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ad0bb62b9db74db49c10d2fbb73baef3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "71e5ac6bd7524eb9958ad708dd89be51",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0e85fa1884104825971a7e783c41eef6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "723af85e2cab477587b5703d6bb4bd66",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c35dab3749ef4edb9a839d7923eb954c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eff426c6c58546d7af9611713ed77d84",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "264e3ba6f05048df89a05cc4345e9ce8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c1b706544bc141559f5fa3da08f56fc1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "974c050871e9453ea5f90ad10a576232",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "110a0e750b1644e88360849ebe41dc35",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d006a36ec2ce422796a158744e005912",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2475b61868e1465bb93fec94966548c7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "92e3b32b8a64410cad97bb490090c1e8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "26e153ed0f0b4b928485a2ed7d7bb0e8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b8238a9087074d50a1e5df66ae29ce0b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c9a600dc099349ec8df82e2ca2291c17",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bbd8c7e8d21d40a1b15897e6a7d7f7ae",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1770af2f42db483eb3ea6e2223ef3c12",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "31ca15800802437a9a93de9040587ecd",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f3a0323038994f55ba79602abf6f00e5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3d5d233b7960414fa7cb1ac7b4128c97",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "13cf3345d68d45f4af264d98e63bd283",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5a46eb16767544fcae0deaf2abe1b73b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "df36032536d74928b5a3bb1ae92e4a2a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "50307689188145d8a7ed39c10eb1b190",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d8530faa26dc49f0b73b22bb3b6b9ee3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "604a21f89aec4123a43b4957a3f9e21e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bb4d8b70c79c4a3eb5cfbdd4be57ca5b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0e742f0f7ef74631bb2c57a0e313542f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "55727475ec0e473b9b643520ab98c737",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a132c1b4be8f4d20b3c6196efdf9e831",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fbb7f65d382c447dbe0ff14d5a789226",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "143386516fc04237996677c08cda4b27",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8b1048da9e004ad582671d8b94883889",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fe7697361a614a77ab7418ca5713bbd8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b4dfe419f6104035a0034b72589e2020",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2cc65f6f30304be4a85f01e7a75e4033",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9d6dc5d08c20486084f237b6ee6636a7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "dd91cd915f8b4922b148378cf89c0bfe",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8ba6626845a9495a9789e85cd05fed3c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0a2c31f52556435a9ed243b070f735f1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eeb92f4f0be54ecb9c19b6853c9d0916",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "644ba72f652d45b88b8e67801b263495",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f5b6dbca594f44bc935fd2fc06d9c16f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c410fa7a9ee7495283076d2c30e32eb5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5074c59133644fc79530f9172b528e39",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0b7de9d30a1f4260b11321d478c3ca06",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5a73abee095a4bc596dbd92625698bba",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4efddb54e03d417ebd86a6a06dc71f4f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9b4890f804854353a42f88f962ed16d9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a668504a858c44f782594007b0ec9165",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "51a621bc6e684b86821e67f3f243f2e8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c8dd1c3af7864bf2b14ccb9401a52141",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d08810cf561f42868b2d9b81c9122ca3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "af00441b5cda47d1945bef17b21a96ea",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b707e5a8807e4d9fbbd3915c3cb45c0b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "590c087a27a44a84be224f7c9a5d1766",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1d65fa879df34346a8bb5ddcbdabace2",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8e31089fbd8a4f6db43d284983d180c7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "53aa1e71de114ed8aea295c08afeff46",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "32585f97334c46b89e9eea57da1b5200",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "48390c1e91bd4987afe6d30dd542d1c5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "303cc0a1d63244e68b7969b86fdd1ff8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f147e6596351471999e45ad8ddb63b25",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "462313b30dd64bc88b907b0d4bff3724",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5f68cda10e2f4980b7b596f5c563c188",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|          | 0/500 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "all = pd.DataFrame()\n",
    "for stock in tqdm(stock_list):\n",
    "    for page in tqdm(range(500)):\n",
    "        url = f\"https://financialmodelingprep.com/api/v3/stock_news?tickers={stock}&page={page+1}&apikey={api_key}\"\n",
    "        res = requests.get(url)\n",
    "        res = json.loads(res.text)\n",
    "        if len(res) == 0:\n",
    "            break\n",
    "        else:\n",
    "            res = pd.DataFrame(res,index=[0])\n",
    "            all = pd.concat([all, res])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(244667, 7)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "all = all.reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>symbol</th>\n",
       "      <th>publishedDate</th>\n",
       "      <th>title</th>\n",
       "      <th>image</th>\n",
       "      <th>site</th>\n",
       "      <th>text</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-06 14:06:29</td>\n",
       "      <td>In The Partnership With JetBlue, Investors Sho...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/q/g/image-6917...</td>\n",
       "      <td>Seeking Alpha</td>\n",
       "      <td>The U.S. airline industry is experiencing stro...</td>\n",
       "      <td>https://seekingalpha.com/article/4516691-in-pa...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-03 18:01:04</td>\n",
       "      <td>American CEO says the airline has grounded 100...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/6/2/62101889f0...</td>\n",
       "      <td>Business Insider</td>\n",
       "      <td>American is the latest carrier to take action ...</td>\n",
       "      <td>https://www.businessinsider.com/american-groun...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-03 17:33:35</td>\n",
       "      <td>Starbucks Shanghai stores reopen, American Air...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/b/6/starbucks-...</td>\n",
       "      <td>Yahoo Finance</td>\n",
       "      <td>Yahoo Finance Live checks out several stocks t...</td>\n",
       "      <td>https://www.youtube.com/watch?v=wyo2MRzH7FU</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-03 16:05:44</td>\n",
       "      <td>Why American Airlines Stock Was Diving Today</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/h/k/qjne2222-1...</td>\n",
       "      <td>The Motley Fool</td>\n",
       "      <td>An important cost item for the company will be...</td>\n",
       "      <td>https://www.fool.com/investing/2022/06/03/why-...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-03 14:49:02</td>\n",
       "      <td>American Airlines Raises Outlook, Falls On Fue...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/n/v/social-131...</td>\n",
       "      <td>Benzinga</td>\n",
       "      <td>American Airlines Group, Inc (NASDAQ: AAL) was...</td>\n",
       "      <td>https://www.benzinga.com/trading-ideas/movers/...</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",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244662</th>\n",
       "      <td>XEL</td>\n",
       "      <td>2019-04-25 14:58:08</td>\n",
       "      <td>Xcel Energy Inc. (XEL) CEO Ben Fowke on Q1 201...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/7/q/transcript...</td>\n",
       "      <td>Seeking Alpha</td>\n",
       "      <td>Xcel Energy Inc. (XEL) CEO Ben Fowke on Q1 201...</td>\n",
       "      <td>https://seekingalpha.com/article/4256807-xcel-...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244663</th>\n",
       "      <td>XEL</td>\n",
       "      <td>2019-04-25 09:26:00</td>\n",
       "      <td>Xcel Energy's (XEL) Earnings Meet Estimates in...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/f/k/utilities8...</td>\n",
       "      <td>Zacks Investment Research</td>\n",
       "      <td>New electric and natural gas rate drives Xcel ...</td>\n",
       "      <td>https://www.zacks.com/stock/news/399436/xcel-e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244664</th>\n",
       "      <td>XEL</td>\n",
       "      <td>2019-04-25 08:29:00</td>\n",
       "      <td>Xcel Energy (XEL) Q1 Earnings Meet Estimates, ...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/c/k/utilities6...</td>\n",
       "      <td>Zacks Investment Research</td>\n",
       "      <td>Higher revenues in all three segments boost Xc...</td>\n",
       "      <td>https://www.zacks.com/stock/news/399179/xcel-e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244665</th>\n",
       "      <td>XEL</td>\n",
       "      <td>2019-04-22 08:30:00</td>\n",
       "      <td>Xcel Energy (XEL) to Post Q1 Earnings: What's ...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/h/y/utilities4...</td>\n",
       "      <td>Zacks Investment Research</td>\n",
       "      <td>Positive impact of steel for fuel investment s...</td>\n",
       "      <td>https://www.zacks.com/stock/news/389861/xcel-e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244666</th>\n",
       "      <td>XEL</td>\n",
       "      <td>2019-04-18 09:58:00</td>\n",
       "      <td>Xcel Energy to Take Over Wind Project Construc...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/x/w/xwi2.jpg</td>\n",
       "      <td>Zacks Investment Research</td>\n",
       "      <td>Xcel Energy (XEL) to expand wind by developing...</td>\n",
       "      <td>https://www.zacks.com/stock/news/388343/xcel-e...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244667 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       symbol        publishedDate  \\\n",
       "0         AAL  2022-06-06 14:06:29   \n",
       "1         AAL  2022-06-03 18:01:04   \n",
       "2         AAL  2022-06-03 17:33:35   \n",
       "3         AAL  2022-06-03 16:05:44   \n",
       "4         AAL  2022-06-03 14:49:02   \n",
       "...       ...                  ...   \n",
       "244662    XEL  2019-04-25 14:58:08   \n",
       "244663    XEL  2019-04-25 09:26:00   \n",
       "244664    XEL  2019-04-25 08:29:00   \n",
       "244665    XEL  2019-04-22 08:30:00   \n",
       "244666    XEL  2019-04-18 09:58:00   \n",
       "\n",
       "                                                    title  \\\n",
       "0       In The Partnership With JetBlue, Investors Sho...   \n",
       "1       American CEO says the airline has grounded 100...   \n",
       "2       Starbucks Shanghai stores reopen, American Air...   \n",
       "3            Why American Airlines Stock Was Diving Today   \n",
       "4       American Airlines Raises Outlook, Falls On Fue...   \n",
       "...                                                   ...   \n",
       "244662  Xcel Energy Inc. (XEL) CEO Ben Fowke on Q1 201...   \n",
       "244663  Xcel Energy's (XEL) Earnings Meet Estimates in...   \n",
       "244664  Xcel Energy (XEL) Q1 Earnings Meet Estimates, ...   \n",
       "244665  Xcel Energy (XEL) to Post Q1 Earnings: What's ...   \n",
       "244666  Xcel Energy to Take Over Wind Project Construc...   \n",
       "\n",
       "                                                    image  \\\n",
       "0       https://cdn.snapi.dev/images/v1/q/g/image-6917...   \n",
       "1       https://cdn.snapi.dev/images/v1/6/2/62101889f0...   \n",
       "2       https://cdn.snapi.dev/images/v1/b/6/starbucks-...   \n",
       "3       https://cdn.snapi.dev/images/v1/h/k/qjne2222-1...   \n",
       "4       https://cdn.snapi.dev/images/v1/n/v/social-131...   \n",
       "...                                                   ...   \n",
       "244662  https://cdn.snapi.dev/images/v1/7/q/transcript...   \n",
       "244663  https://cdn.snapi.dev/images/v1/f/k/utilities8...   \n",
       "244664  https://cdn.snapi.dev/images/v1/c/k/utilities6...   \n",
       "244665  https://cdn.snapi.dev/images/v1/h/y/utilities4...   \n",
       "244666       https://cdn.snapi.dev/images/v1/x/w/xwi2.jpg   \n",
       "\n",
       "                             site  \\\n",
       "0                   Seeking Alpha   \n",
       "1                Business Insider   \n",
       "2                   Yahoo Finance   \n",
       "3                 The Motley Fool   \n",
       "4                        Benzinga   \n",
       "...                           ...   \n",
       "244662              Seeking Alpha   \n",
       "244663  Zacks Investment Research   \n",
       "244664  Zacks Investment Research   \n",
       "244665  Zacks Investment Research   \n",
       "244666  Zacks Investment Research   \n",
       "\n",
       "                                                     text  \\\n",
       "0       The U.S. airline industry is experiencing stro...   \n",
       "1       American is the latest carrier to take action ...   \n",
       "2       Yahoo Finance Live checks out several stocks t...   \n",
       "3       An important cost item for the company will be...   \n",
       "4       American Airlines Group, Inc (NASDAQ: AAL) was...   \n",
       "...                                                   ...   \n",
       "244662  Xcel Energy Inc. (XEL) CEO Ben Fowke on Q1 201...   \n",
       "244663  New electric and natural gas rate drives Xcel ...   \n",
       "244664  Higher revenues in all three segments boost Xc...   \n",
       "244665  Positive impact of steel for fuel investment s...   \n",
       "244666  Xcel Energy (XEL) to expand wind by developing...   \n",
       "\n",
       "                                                      url  \n",
       "0       https://seekingalpha.com/article/4516691-in-pa...  \n",
       "1       https://www.businessinsider.com/american-groun...  \n",
       "2             https://www.youtube.com/watch?v=wyo2MRzH7FU  \n",
       "3       https://www.fool.com/investing/2022/06/03/why-...  \n",
       "4       https://www.benzinga.com/trading-ideas/movers/...  \n",
       "...                                                   ...  \n",
       "244662  https://seekingalpha.com/article/4256807-xcel-...  \n",
       "244663  https://www.zacks.com/stock/news/399436/xcel-e...  \n",
       "244664  https://www.zacks.com/stock/news/399179/xcel-e...  \n",
       "244665  https://www.zacks.com/stock/news/389861/xcel-e...  \n",
       "244666  https://www.zacks.com/stock/news/388343/xcel-e...  \n",
       "\n",
       "[244667 rows x 7 columns]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "all.to_csv(\"dataset.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "80"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all.symbol.nunique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "all.groupby(\"symbol\").publishedDate.min().to_csv(\"last_date.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>symbol</th>\n",
       "      <th>publishedDate</th>\n",
       "      <th>title</th>\n",
       "      <th>image</th>\n",
       "      <th>site</th>\n",
       "      <th>text</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-06 14:06:29</td>\n",
       "      <td>In The Partnership With JetBlue, Investors Sho...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/q/g/image-6917...</td>\n",
       "      <td>Seeking Alpha</td>\n",
       "      <td>The U.S. airline industry is experiencing stro...</td>\n",
       "      <td>https://seekingalpha.com/article/4516691-in-pa...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>AAL</td>\n",
       "      <td>2022-06-03 18:01:04</td>\n",
       "      <td>American CEO says the airline has grounded 100...</td>\n",
       "      <td>https://cdn.snapi.dev/images/v1/6/2/62101889f0...</td>\n",
       "      <td>Business Insider</td>\n",
       "      <td>American is the latest carrier to take action ...</td>\n",
       "      <td>https://www.businessinsider.com/american-groun...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  symbol        publishedDate  \\\n",
       "0    AAL  2022-06-06 14:06:29   \n",
       "1    AAL  2022-06-03 18:01:04   \n",
       "\n",
       "                                               title  \\\n",
       "0  In The Partnership With JetBlue, Investors Sho...   \n",
       "1  American CEO says the airline has grounded 100...   \n",
       "\n",
       "                                               image              site  \\\n",
       "0  https://cdn.snapi.dev/images/v1/q/g/image-6917...     Seeking Alpha   \n",
       "1  https://cdn.snapi.dev/images/v1/6/2/62101889f0...  Business Insider   \n",
       "\n",
       "                                                text  \\\n",
       "0  The U.S. airline industry is experiencing stro...   \n",
       "1  American is the latest carrier to take action ...   \n",
       "\n",
       "                                                 url  \n",
       "0  https://seekingalpha.com/article/4516691-in-pa...  \n",
       "1  https://www.businessinsider.com/american-groun...  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://www.youtube.com/watch?v=IL91F3dTpRs&t=124s'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.url[0]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "finrl",
   "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.7.12"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
