一款用于SEO自动化及AI优化的应用,集成Google Ads关键词规划师。
git clone https://github.com/ccnn2509/app-seo-ai.git
cd app-seo-ai
npm install
复制示例环境文件:
cp .env.example .env
编辑.env文件并填写您的Google Ads API凭证:
# 服务器配置
PORT=3000
NODE_ENV=development
# Google Ads API配置
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token
GOOGLE_ADS_CLIENT_ID=your_client_id
GOOGLE_ADS_CLIENT_SECRET=your_client_secret
GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token
GOOGLE_ADS_LOGIN_CUSTOMER_ID=your_customer_id_without_dashes
# SERP API配置(可选)
SERP_API_KEY=your_serp_api_key
运行以下命令获取刷新令牌:
npm run get-token
这将打开您的浏览器并引导您完成OAuth2认证过程。刷新令牌将自动保存到您的.env文件中。
开发模式:
npm run dev
生产模式:
npm start
服务器将在.env文件中指定的端口上启动(默认:3000)。
当服务器运行时,可以在/api-docs找到API文档:
http://localhost:3000/api-docs
此项目包括MCP(模型上下文协议)集成,允许AI助手使用API。MCP配置位于mcp.json文件中。
要与Smithery一起使用:
app-seo-ai仓库research_keywords - 研究与给定主题或种子关键词相关的关键词analyze_serp - 分析给定查询的搜索结果页面(SERP)analyze_competitors - 分析给定关键词或域名的竞争者_health - 健康检查端点// 示例请求以研究关键词
fetch('http://localhost:3000/api/keywords/ideas?keyword=seo%20tools&language=en')
.then(response => response.json())
.then(data => console.log(data));
// 示例请求以分析SERP
fetch('http://localhost:3000/api/serp/analyze?query=best%20seo%20tools&location=United%20States')
.then(response => response.json())
.then(data => console.log(data));
// 示例请求以分析竞争者
fetch('http://localhost:3000/api/competitors/analyze?domain=example.com')
.then(response => response.json())
.then(data => console.log(data));
MIT