Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions modules/tool/packages/seoKeywordMiner/DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 5118 SEO 关键词检索 API 工具

调用参考接口,获取关键词

### 参考文档
https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1
提交任务请求参数说明:
名称 类型 必填 默认值 说明
keyword string 是 查询关键词
page_index int 否 1 当前分页
page_size int 否 100 每页返回数据的数量(最大返回数量100条)
sort_fields int 否 4 排序字段(输入2-9下标,2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)
sort_type string 否 desc 升序或降序(asc:升序,desc:降序)
filter int 否 1 快捷过滤(输入1-9下标,1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)
filter_date string 否 筛选日期(时间格式:yyyy-MM-dd)

提交任务返回参数说明:
名称 类型 默认值 说明
errcode string 0 返回的错误代码
errmsg string 返回的错误说明
total int 总数量
page_count int 总页数
page_index int 1 当前分页
page_size int 100 每页返回数据的数量(最大返回数量100条)
keyword string 关键词
index int 流量指数
mobile_index int 移动指数
douyin_index int 抖音指数
haosou_index int 好搜360指数
long_keyword_count int 长尾词数量
page_url string 推荐网站
bidword_company_count int 竞价公司数量
bidword_kwc int 竞价竞争度(1、高 2、中 3、低)
bidword_pcpv int PC检索量
bidword_wisepv int 移动检索量
sem_reason string 流量特点
sem_price string SEM点击价格

JSON

{
"errcode": "0",
"errmsg": "",
"data": {
"total": 52,
"page_count": 18,
"page_index": 1,
"page_size": 3,
"word": [
{
"keyword": "衬衫",
"index": 1063,
"mobile_index": 919,
"haosou_index": 1163,
"long_keyword_count": 6045520,
"bidword_company_count": 185,
"page_url": "",
"bidword_kwc": 1,
"bidword_pcpv": 240,
"bidword_wisepv": 1433,
"sem_reason": "",
"sem_price": "0.35~4.57"
}
...
]
}
}


---

下面由 AI 生成完整的设计文档
81 changes: 81 additions & 0 deletions modules/tool/packages/seoKeywordMiner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SEO 关键词挖掘工具

基于 5118 API 的专业 SEO 关键词挖掘工具,帮助您快速发现海量长尾关键词并获取详细的搜索数据。

## 功能特性

- 🔍 **海量关键词挖掘**: 基于 5118 百亿级关键词数据库
- 📊 **详细数据指标**: 提供搜索量、竞争度、CPC 等关键指标
- 🎯 **长尾词发现**: 智能推荐相关长尾关键词
- 📈 **SEO 优化**: 为 SEO 策略提供数据支持

## 使用方法

### 输入参数
- **种子关键词**: 您想要挖掘的基础关键词
- **页码**: 当前分页,默认第1页
- **每页数量**: 每页返回数据的数量,最大100条,默认100条
- **排序字段**: 排序字段选择
- 2: 竞价公司数量
- 3: 长尾词数量
- 4: 流量指数
- 5: 百度移动指数
- 6: 360好搜指数
- 7: PC日检索量
- 8: 移动日检索量
- 9: 竞争激烈程度
- **排序方式**: 升序(asc)或降序(desc),默认降序
- **快捷过滤**: 过滤条件
- 1: 所有词
- 2: 所有流量词
- 3: 流量指数词
- 4: 移动指数词
- 5: 360指数词
- 6: 流量特点词
- 7: PC日检索量词
- 8: 移动日检索量
- 9: 存在竞价的词
- **筛选日期**: 可选的日期过滤(格式:yyyy-MM-dd)
- **5118 API Key**: 在 5118 控制台获取的 API 密钥

### 输出结果
- **关键词列表**: 包含详细数据的关键词数组(JSON格式)
- **总数量**: 找到的关键词总数
- **总页数**: 分页的总页数
- **当前页码**: 当前返回的页码
- **每页数量**: 每页返回的关键词数量
- **执行状态**: 操作成功/失败状态

## 数据字段

每个关键词包含以下字段:
- `keyword`: 关键词
- `index`: 流量指数
- `mobileIndex`: 移动指数
- `douyinIndex`: 抖音指数
- `haosouIndex`: 好搜360指数
- `longKeywordCount`: 长尾词数量
- `pageUrl`: 推荐网站
- `bidwordCompanyCount`: 竞价公司数量
- `bidwordKwc`: 竞价竞争度(1、高 2、中 3、低)
- `bidwordPcpv`: PC检索量
- `bidwordWisepv`: 移动检索量
- `semReason`: 流量特点
- `semPrice`: SEM点击价格

## API 集成

本工具基于 5118 官方海量长尾词挖掘APIv2实现,严格遵循官方示例代码:

- **API端点**: `http://apis.5118.com/keyword/word/v2`
- **认证方式**: Authorization Header
- **请求格式**: application/x-www-form-urlencoded
- **官方文档**: https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1

### API参数
- `keyword`: 种子关键词
- `page_index`: 页码索引(工具自动计算)

基于官方PHP示例代码实现,确保与5118 API完全兼容。

![SEO Keywords](https://picsum.photos/800/400?random=1)
217 changes: 217 additions & 0 deletions modules/tool/packages/seoKeywordMiner/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
import { defineTool } from '@tool/type';
import { FlowNodeInputTypeEnum, WorkflowIOValueTypeEnum } from '@tool/type/fastgpt';
import { ToolTagEnum } from '@tool/type/tags';

export default defineTool({
name: {
'zh-CN': 'SEO关键词挖掘工具',
en: 'SEO Keyword Miner'
},
tags: [ToolTagEnum.enum.tools],
description: {
'zh-CN': '基于5118 API的海量长尾关键词挖掘工具,获取关键词搜索量和指数数据',
en: 'Massive long-tail keyword mining tool based on 5118 API,获取 keyword search volume and index data'
},
toolDescription:
'A powerful SEO tool for mining long-tail keywords using 5118 API. Provides search volume data and keyword metrics for SEO optimization.',
secretInputConfig: [
{
key: 'apiKey',
label: '5118 API Key',
description:
'在 5118 控制台获取 API Key。文档:https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1',
required: true,
inputType: 'secret'
}
],
versionList: [
{
value: '1.0.0',
description: '5118 SEO关键词挖掘',
inputs: [
{
key: 'keyword',
label: '种子关键词',
description: '输入要挖掘的关键词',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.string,
required: true,
placeholder: '请输入关键词',
toolDescription: '输入要挖掘的关键词'
},
{
key: 'pageIndex',
label: '页码',
description: '当前分页,默认第1页',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.number,
placeholder: '请输入页码',
toolDescription: '当前分页,默认第1页'
},
{
key: 'pageSize',
label: '每页数量',
description: '每页返回数据的数量,最大100条,默认100条',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.number,
placeholder: '请输入每页数量',
toolDescription: '每页返回数据的数量,最大100条,默认100条'
},
{
key: 'sortFields',
label: '排序字段',
description:
'排序字段(2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.number,
placeholder: '请输入排序字段',
toolDescription:
'排序字段(2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)',
list: [
{
label: '竞价公司数量',
value: '2'
},
{
label: '长尾词数量',
value: '3'
},
{
label: '流量指数',
value: '4'
},
{
label: '百度移动指数',
value: '5'
},
{
label: '360好搜指数',
value: '6'
},
{
label: 'PC日检索量',
value: '7'
},
{
label: '移动日检索量',
value: '8'
},
{
label: '竞争激烈程度',
value: '9'
}
]
},
{
key: 'sortType',
label: '排序方式',
description: '升序或降序(asc:升序,desc:降序)',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.string,
placeholder: '请输入排序方式',
toolDescription: '升序或降序(asc:升序,desc:降序)',
list: [
{
label: '升序',
value: 'asc'
},
{
label: '降序',
value: 'desc'
}
]
},
{
key: 'filter',
label: '快捷过滤',
description:
'过滤条件(1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.number,
placeholder: '请输入快捷过滤',
toolDescription:
'过滤条件(1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)',
list: [
{
label: '所有词',
value: '1'
},
{
label: '所有流量词',
value: '2'
},
{
label: '流量指数词',
value: '3'
},
{
label: '移动指数词',
value: '4'
},
{
label: '360指数词',
value: '5'
},
{
label: '流量特点词',
value: '6'
},
{
label: 'PC日检索量词',
value: '7'
},
{
label: '移动日检索量',
value: '8'
},
{
label: '存在竞价的词',
value: '9'
}
]
},
{
key: 'filterDate',
label: '筛选日期',
description: '筛选日期(格式:yyyy-MM-dd),可选',
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.string,
placeholder: '请输入筛选日期',
toolDescription: '筛选日期(格式:yyyy-MM-dd),可选'
}
],
outputs: [
{
valueType: WorkflowIOValueTypeEnum.string,
key: 'keywords',
label: '关键词列表',
description: '挖掘到的相关关键词及其数据(JSON格式)'
},
{
valueType: WorkflowIOValueTypeEnum.number,
key: 'total',
label: '总数量',
description: '找到的关键词总数'
},
{
valueType: WorkflowIOValueTypeEnum.number,
key: 'pageCount',
label: '总页数',
description: '分页的总页数'
},
{
valueType: WorkflowIOValueTypeEnum.number,
key: 'pageIndex',
label: '当前页码',
description: '当前返回的页码'
},
{
valueType: WorkflowIOValueTypeEnum.number,
key: 'pageSize',
label: '每页数量',
description: '每页返回的关键词数量'
}
]
}
]
});
10 changes: 10 additions & 0 deletions modules/tool/packages/seoKeywordMiner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import config from './config';
import { InputType, OutputType, tool as toolCb } from './src';
import { exportTool } from '@tool/utils/tool';

export default exportTool({
toolCb,
InputType,
OutputType,
config
});
Binary file added modules/tool/packages/seoKeywordMiner/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading