Skip to content

Commit 4e59d39

Browse files
committed
Created using Colaboratory
1 parent 9178771 commit 4e59d39

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

Google_Trends_API_for Python.ipynb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@
9696
"metadata": {
9797
"id": "RFBb6m_momYt",
9898
"colab_type": "code",
99+
"outputId": "6a2a88fb-611c-4110-9b91-9b50e3f69010",
99100
"colab": {
100101
"base_uri": "https://localhost:8080/",
101102
"height": 225
102-
},
103-
"outputId": "6a2a88fb-611c-4110-9b91-9b50e3f69010"
103+
}
104104
},
105105
"source": [
106106
"!pip install pytrends"
107107
],
108-
"execution_count": 26,
108+
"execution_count": 0,
109109
"outputs": [
110110
{
111111
"output_type": "stream",
@@ -224,19 +224,19 @@
224224
"metadata": {
225225
"id": "8MB0udCqpD7T",
226226
"colab_type": "code",
227+
"outputId": "e8bdf609-14a6-45e3-b840-d6c0ef914dfa",
227228
"colab": {
228229
"base_uri": "https://localhost:8080/",
229230
"height": 386
230-
},
231-
"outputId": "e8bdf609-14a6-45e3-b840-d6c0ef914dfa"
231+
}
232232
},
233233
"source": [
234234
"pytrend.build_payload(kw_list=['Taylor Swift'])\n",
235235
"# Interest by Region\n",
236236
"df = pytrend.interest_by_region()\n",
237237
"df.head(10)"
238238
],
239-
"execution_count": 28,
239+
"execution_count": 0,
240240
"outputs": [
241241
{
242242
"output_type": "execute_result",
@@ -361,16 +361,16 @@
361361
"metadata": {
362362
"id": "Jv5fd7PBpUEQ",
363363
"colab_type": "code",
364+
"outputId": "6bf1a66f-368b-4048-b53b-9ae44b20f1a8",
364365
"colab": {
365366
"base_uri": "https://localhost:8080/",
366367
"height": 837
367-
},
368-
"outputId": "6bf1a66f-368b-4048-b53b-9ae44b20f1a8"
368+
}
369369
},
370370
"source": [
371371
"df.reset_index().plot(x='geoName', y='Taylor Swift', figsize=(120, 10), kind ='bar')"
372372
],
373-
"execution_count": 29,
373+
"execution_count": 0,
374374
"outputs": [
375375
{
376376
"output_type": "execute_result",
@@ -430,18 +430,18 @@
430430
"metadata": {
431431
"id": "CZxlpg2Vphiv",
432432
"colab_type": "code",
433+
"outputId": "53369134-c52f-481d-9f5a-e033d235c435",
433434
"colab": {
434435
"base_uri": "https://localhost:8080/",
435436
"height": 202
436-
},
437-
"outputId": "53369134-c52f-481d-9f5a-e033d235c435"
437+
}
438438
},
439439
"source": [
440440
"# Get Google Hot Trends data\n",
441441
"df = pytrend.trending_searches(pn='united_states')\n",
442442
"df.head()"
443443
],
444-
"execution_count": 30,
444+
"execution_count": 0,
445445
"outputs": [
446446
{
447447
"output_type": "execute_result",
@@ -562,18 +562,18 @@
562562
"metadata": {
563563
"id": "RR8sdilxp0TP",
564564
"colab_type": "code",
565+
"outputId": "8b8f1dce-a548-4ebf-e601-3a7b524db80a",
565566
"colab": {
566567
"base_uri": "https://localhost:8080/",
567568
"height": 202
568-
},
569-
"outputId": "8b8f1dce-a548-4ebf-e601-3a7b524db80a"
569+
}
570570
},
571571
"source": [
572572
"# Get Google Top Charts\n",
573573
"df = pytrend.top_charts(2019, hl='en-US', tz=300, geo='GLOBAL')\n",
574574
"df.head()"
575575
],
576-
"execution_count": 32,
576+
"execution_count": 0,
577577
"outputs": [
578578
{
579579
"output_type": "execute_result",
@@ -681,18 +681,18 @@
681681
"metadata": {
682682
"id": "phF_2PZxqETV",
683683
"colab_type": "code",
684+
"outputId": "e1944072-ae5e-40c7-bb38-cd8e8cc0dc37",
684685
"colab": {
685686
"base_uri": "https://localhost:8080/",
686687
"height": 202
687-
},
688-
"outputId": "e1944072-ae5e-40c7-bb38-cd8e8cc0dc37"
688+
}
689689
},
690690
"source": [
691691
"# Get Google Keyword Suggestionskeywords = pytrend.suggestions(keyword='Mercedes Benz')\n",
692692
"df = pd.DataFrame(keywords)\n",
693693
"df.drop(columns= 'mid') # This column makes no sense"
694694
],
695-
"execution_count": 33,
695+
"execution_count": 0,
696696
"outputs": [
697697
{
698698
"output_type": "execute_result",
@@ -806,18 +806,18 @@
806806
"metadata": {
807807
"id": "t1h_k1o3qL1o",
808808
"colab_type": "code",
809+
"outputId": "edb93ab5-f9c6-43d7-b332-99058f4299cb",
809810
"colab": {
810811
"base_uri": "https://localhost:8080/",
811812
"height": 901
812-
},
813-
"outputId": "edb93ab5-f9c6-43d7-b332-99058f4299cb"
813+
}
814814
},
815815
"source": [
816816
"# Related Queries, returns a dictionary of dataframes\n",
817817
"related_queries = pytrend.related_queries()\n",
818818
"related_queries.values()"
819819
],
820-
"execution_count": 35,
820+
"execution_count": 0,
821821
"outputs": [
822822
{
823823
"output_type": "execute_result",

0 commit comments

Comments
 (0)