Skip to content

Commit 33cbd9c

Browse files
authored
feat: new tool: 5118 seoKeywordMiner (#290)
1 parent 9ffe8ee commit 33cbd9c

File tree

8 files changed

+747
-0
lines changed

8 files changed

+747
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# 5118 SEO 关键词检索 API 工具
2+
3+
调用参考接口,获取关键词
4+
5+
### 参考文档
6+
https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1
7+
提交任务请求参数说明:
8+
名称 类型 必填 默认值 说明
9+
keyword string 是 查询关键词
10+
page_index int 否 1 当前分页
11+
page_size int 否 100 每页返回数据的数量(最大返回数量100条)
12+
sort_fields int 否 4 排序字段(输入2-9下标,2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)
13+
sort_type string 否 desc 升序或降序(asc:升序,desc:降序)
14+
filter int 否 1 快捷过滤(输入1-9下标,1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)
15+
filter_date string 否 筛选日期(时间格式:yyyy-MM-dd)
16+
17+
提交任务返回参数说明:
18+
名称 类型 默认值 说明
19+
errcode string 0 返回的错误代码
20+
errmsg string 返回的错误说明
21+
total int 总数量
22+
page_count int 总页数
23+
page_index int 1 当前分页
24+
page_size int 100 每页返回数据的数量(最大返回数量100条)
25+
keyword string 关键词
26+
index int 流量指数
27+
mobile_index int 移动指数
28+
douyin_index int 抖音指数
29+
haosou_index int 好搜360指数
30+
long_keyword_count int 长尾词数量
31+
page_url string 推荐网站
32+
bidword_company_count int 竞价公司数量
33+
bidword_kwc int 竞价竞争度(1、高 2、中 3、低)
34+
bidword_pcpv int PC检索量
35+
bidword_wisepv int 移动检索量
36+
sem_reason string 流量特点
37+
sem_price string SEM点击价格
38+
39+
JSON
40+
41+
{
42+
"errcode": "0",
43+
"errmsg": "",
44+
"data": {
45+
"total": 52,
46+
"page_count": 18,
47+
"page_index": 1,
48+
"page_size": 3,
49+
"word": [
50+
{
51+
"keyword": "衬衫",
52+
"index": 1063,
53+
"mobile_index": 919,
54+
"haosou_index": 1163,
55+
"long_keyword_count": 6045520,
56+
"bidword_company_count": 185,
57+
"page_url": "",
58+
"bidword_kwc": 1,
59+
"bidword_pcpv": 240,
60+
"bidword_wisepv": 1433,
61+
"sem_reason": "",
62+
"sem_price": "0.35~4.57"
63+
}
64+
...
65+
]
66+
}
67+
}
68+
69+
70+
---
71+
72+
下面由 AI 生成完整的设计文档
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SEO 关键词挖掘工具
2+
3+
基于 5118 API 的专业 SEO 关键词挖掘工具,帮助您快速发现海量长尾关键词并获取详细的搜索数据。
4+
5+
## 功能特性
6+
7+
- 🔍 **海量关键词挖掘**: 基于 5118 百亿级关键词数据库
8+
- 📊 **详细数据指标**: 提供搜索量、竞争度、CPC 等关键指标
9+
- 🎯 **长尾词发现**: 智能推荐相关长尾关键词
10+
- 📈 **SEO 优化**: 为 SEO 策略提供数据支持
11+
12+
## 使用方法
13+
14+
### 输入参数
15+
- **种子关键词**: 您想要挖掘的基础关键词
16+
- **页码**: 当前分页,默认第1页
17+
- **每页数量**: 每页返回数据的数量,最大100条,默认100条
18+
- **排序字段**: 排序字段选择
19+
- 2: 竞价公司数量
20+
- 3: 长尾词数量
21+
- 4: 流量指数
22+
- 5: 百度移动指数
23+
- 6: 360好搜指数
24+
- 7: PC日检索量
25+
- 8: 移动日检索量
26+
- 9: 竞争激烈程度
27+
- **排序方式**: 升序(asc)或降序(desc),默认降序
28+
- **快捷过滤**: 过滤条件
29+
- 1: 所有词
30+
- 2: 所有流量词
31+
- 3: 流量指数词
32+
- 4: 移动指数词
33+
- 5: 360指数词
34+
- 6: 流量特点词
35+
- 7: PC日检索量词
36+
- 8: 移动日检索量
37+
- 9: 存在竞价的词
38+
- **筛选日期**: 可选的日期过滤(格式:yyyy-MM-dd)
39+
- **5118 API Key**: 在 5118 控制台获取的 API 密钥
40+
41+
### 输出结果
42+
- **关键词列表**: 包含详细数据的关键词数组(JSON格式)
43+
- **总数量**: 找到的关键词总数
44+
- **总页数**: 分页的总页数
45+
- **当前页码**: 当前返回的页码
46+
- **每页数量**: 每页返回的关键词数量
47+
- **执行状态**: 操作成功/失败状态
48+
49+
## 数据字段
50+
51+
每个关键词包含以下字段:
52+
- `keyword`: 关键词
53+
- `index`: 流量指数
54+
- `mobileIndex`: 移动指数
55+
- `douyinIndex`: 抖音指数
56+
- `haosouIndex`: 好搜360指数
57+
- `longKeywordCount`: 长尾词数量
58+
- `pageUrl`: 推荐网站
59+
- `bidwordCompanyCount`: 竞价公司数量
60+
- `bidwordKwc`: 竞价竞争度(1、高 2、中 3、低)
61+
- `bidwordPcpv`: PC检索量
62+
- `bidwordWisepv`: 移动检索量
63+
- `semReason`: 流量特点
64+
- `semPrice`: SEM点击价格
65+
66+
## API 集成
67+
68+
本工具基于 5118 官方海量长尾词挖掘APIv2实现,严格遵循官方示例代码:
69+
70+
- **API端点**: `http://apis.5118.com/keyword/word/v2`
71+
- **认证方式**: Authorization Header
72+
- **请求格式**: application/x-www-form-urlencoded
73+
- **官方文档**: https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1
74+
75+
### API参数
76+
- `keyword`: 种子关键词
77+
- `page_index`: 页码索引(工具自动计算)
78+
79+
基于官方PHP示例代码实现,确保与5118 API完全兼容。
80+
81+
![SEO Keywords](https://picsum.photos/800/400?random=1)
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
import { defineTool } from '@tool/type';
2+
import { FlowNodeInputTypeEnum, WorkflowIOValueTypeEnum } from '@tool/type/fastgpt';
3+
import { ToolTagEnum } from '@tool/type/tags';
4+
5+
export default defineTool({
6+
name: {
7+
'zh-CN': 'SEO关键词挖掘工具',
8+
en: 'SEO Keyword Miner'
9+
},
10+
tags: [ToolTagEnum.enum.tools],
11+
description: {
12+
'zh-CN': '基于5118 API的海量长尾关键词挖掘工具,获取关键词搜索量和指数数据',
13+
en: 'Massive long-tail keyword mining tool based on 5118 API,获取 keyword search volume and index data'
14+
},
15+
toolDescription:
16+
'A powerful SEO tool for mining long-tail keywords using 5118 API. Provides search volume data and keyword metrics for SEO optimization.',
17+
secretInputConfig: [
18+
{
19+
key: 'apiKey',
20+
label: '5118 API Key',
21+
description:
22+
'在 5118 控制台获取 API Key。文档:https://www.5118.com/apistore/detail/8cf3d6ed-2b12-ed11-8da8-e43d1a103141/-1',
23+
required: true,
24+
inputType: 'secret'
25+
}
26+
],
27+
versionList: [
28+
{
29+
value: '1.0.0',
30+
description: '5118 SEO关键词挖掘',
31+
inputs: [
32+
{
33+
key: 'keyword',
34+
label: '种子关键词',
35+
description: '输入要挖掘的关键词',
36+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
37+
valueType: WorkflowIOValueTypeEnum.string,
38+
required: true,
39+
placeholder: '请输入关键词',
40+
toolDescription: '输入要挖掘的关键词'
41+
},
42+
{
43+
key: 'pageIndex',
44+
label: '页码',
45+
description: '当前分页,默认第1页',
46+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
47+
valueType: WorkflowIOValueTypeEnum.number,
48+
placeholder: '请输入页码',
49+
toolDescription: '当前分页,默认第1页'
50+
},
51+
{
52+
key: 'pageSize',
53+
label: '每页数量',
54+
description: '每页返回数据的数量,最大100条,默认100条',
55+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
56+
valueType: WorkflowIOValueTypeEnum.number,
57+
placeholder: '请输入每页数量',
58+
toolDescription: '每页返回数据的数量,最大100条,默认100条'
59+
},
60+
{
61+
key: 'sortFields',
62+
label: '排序字段',
63+
description:
64+
'排序字段(2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)',
65+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
66+
valueType: WorkflowIOValueTypeEnum.number,
67+
placeholder: '请输入排序字段',
68+
toolDescription:
69+
'排序字段(2:竞价公司数量,3:长尾词数量,4:流量指数,5:百度移动指数,6:360好搜指数,7:PC日检索量,8:移动日检索量,9:竞争激烈程度)',
70+
list: [
71+
{
72+
label: '竞价公司数量',
73+
value: '2'
74+
},
75+
{
76+
label: '长尾词数量',
77+
value: '3'
78+
},
79+
{
80+
label: '流量指数',
81+
value: '4'
82+
},
83+
{
84+
label: '百度移动指数',
85+
value: '5'
86+
},
87+
{
88+
label: '360好搜指数',
89+
value: '6'
90+
},
91+
{
92+
label: 'PC日检索量',
93+
value: '7'
94+
},
95+
{
96+
label: '移动日检索量',
97+
value: '8'
98+
},
99+
{
100+
label: '竞争激烈程度',
101+
value: '9'
102+
}
103+
]
104+
},
105+
{
106+
key: 'sortType',
107+
label: '排序方式',
108+
description: '升序或降序(asc:升序,desc:降序)',
109+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
110+
valueType: WorkflowIOValueTypeEnum.string,
111+
placeholder: '请输入排序方式',
112+
toolDescription: '升序或降序(asc:升序,desc:降序)',
113+
list: [
114+
{
115+
label: '升序',
116+
value: 'asc'
117+
},
118+
{
119+
label: '降序',
120+
value: 'desc'
121+
}
122+
]
123+
},
124+
{
125+
key: 'filter',
126+
label: '快捷过滤',
127+
description:
128+
'过滤条件(1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)',
129+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
130+
valueType: WorkflowIOValueTypeEnum.number,
131+
placeholder: '请输入快捷过滤',
132+
toolDescription:
133+
'过滤条件(1:所有词,2:所有流量词,3:流量指数词,4:移动指数词,5:360指数词,6:流量特点词,7:PC日检索量词,8:移动日检索量,9:存在竞价的词)',
134+
list: [
135+
{
136+
label: '所有词',
137+
value: '1'
138+
},
139+
{
140+
label: '所有流量词',
141+
value: '2'
142+
},
143+
{
144+
label: '流量指数词',
145+
value: '3'
146+
},
147+
{
148+
label: '移动指数词',
149+
value: '4'
150+
},
151+
{
152+
label: '360指数词',
153+
value: '5'
154+
},
155+
{
156+
label: '流量特点词',
157+
value: '6'
158+
},
159+
{
160+
label: 'PC日检索量词',
161+
value: '7'
162+
},
163+
{
164+
label: '移动日检索量',
165+
value: '8'
166+
},
167+
{
168+
label: '存在竞价的词',
169+
value: '9'
170+
}
171+
]
172+
},
173+
{
174+
key: 'filterDate',
175+
label: '筛选日期',
176+
description: '筛选日期(格式:yyyy-MM-dd),可选',
177+
renderTypeList: [FlowNodeInputTypeEnum.input, FlowNodeInputTypeEnum.reference],
178+
valueType: WorkflowIOValueTypeEnum.string,
179+
placeholder: '请输入筛选日期',
180+
toolDescription: '筛选日期(格式:yyyy-MM-dd),可选'
181+
}
182+
],
183+
outputs: [
184+
{
185+
valueType: WorkflowIOValueTypeEnum.string,
186+
key: 'keywords',
187+
label: '关键词列表',
188+
description: '挖掘到的相关关键词及其数据(JSON格式)'
189+
},
190+
{
191+
valueType: WorkflowIOValueTypeEnum.number,
192+
key: 'total',
193+
label: '总数量',
194+
description: '找到的关键词总数'
195+
},
196+
{
197+
valueType: WorkflowIOValueTypeEnum.number,
198+
key: 'pageCount',
199+
label: '总页数',
200+
description: '分页的总页数'
201+
},
202+
{
203+
valueType: WorkflowIOValueTypeEnum.number,
204+
key: 'pageIndex',
205+
label: '当前页码',
206+
description: '当前返回的页码'
207+
},
208+
{
209+
valueType: WorkflowIOValueTypeEnum.number,
210+
key: 'pageSize',
211+
label: '每页数量',
212+
description: '每页返回的关键词数量'
213+
}
214+
]
215+
}
216+
]
217+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import config from './config';
2+
import { InputType, OutputType, tool as toolCb } from './src';
3+
import { exportTool } from '@tool/utils/tool';
4+
5+
export default exportTool({
6+
toolCb,
7+
InputType,
8+
OutputType,
9+
config
10+
});
2.15 KB
Loading

0 commit comments

Comments
 (0)