|
@@ -12,8 +12,11 @@ from fastapi.responses import JSONResponse, FileResponse
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
from pydantic import BaseModel
|
|
|
#from googlesearch import search
|
|
|
+import kw_planner
|
|
|
import asyncio
|
|
|
import time
|
|
|
+from google.ads.googleads.client import GoogleAdsClient
|
|
|
+
|
|
|
fake_rank_plus = 700
|
|
|
fake_traffic_weighted = 1.3
|
|
|
|
|
@@ -92,9 +95,13 @@ async def index():
|
|
|
return FileResponse('index2.html')
|
|
|
|
|
|
|
|
|
-@app.get("/keyword/{keyword}}")
|
|
|
+@app.get("/keyword/{keyword}")
|
|
|
async def keyword(keyword):
|
|
|
print(keyword)
|
|
|
+ client = GoogleAdsClient.load_from_storage("./ads.yaml")
|
|
|
+ list_keywords = kw_planner.main(client, "7400705511", ["2840"], "1000", [keyword], None)
|
|
|
+ print(list_keywords)
|
|
|
+
|
|
|
return "OK"
|
|
|
|
|
|
|