Use {baseDir}/index.js to call RapidAPI with templates from {baseDir}/templates.
Prefer this skill when the task involves RapidAPI endpoints or template-defined actions.
What This Skill Actually Does
This skill is a minimal RapidAPI client that turns RapidAPI endpoint definitions into callable actions.
It is meant for:
- - converting a RapidAPI endpoint into a stable action name
- standardizing inputs into query/body/header/path params
- returning a consistent
ok/status/data/error/meta shape
It is not a server. It is a small local client you can call from scripts or other skills.
Key Capabilities
- - Auto-registers templates from INLINECODE3
- INLINECODE4 enumerates all registered actions with schemas
- INLINECODE5 calls a template-defined endpoint
- INLINECODE6 allows direct RapidAPI calls without a template
- INLINECODE7 converts a RapidAPI endpoint JSON payload into a template file
Basic Usage
Use config-driven init (recommended):
CODEBLOCK0
Or direct call (no template):
CODEBLOCK1
Template Design Notes
Templates are plain JSON. They should contain:
- -
name, host, path, INLINECODE11 - INLINECODE12 (and optionally
bodySchema, headerSchema, pathParams)
Example snippet:
CODEBLOCK2
Where It Fits
Use this skill when you need a consistent, reusable RapidAPI interface without building a backend.
It is especially useful for:
- - social data APIs (X/Twitter, TikTok, LinkedIn)
- search/aggregation APIs
- repeated RapidAPI calls across multiple tasks or workflows
技能名称: rapidapi-universal-skill
详细描述:
使用 {baseDir}/index.js 调用 RapidAPI,模板来自 {baseDir}/templates。
当任务涉及 RapidAPI 端点或模板定义的操作时,优先使用此技能。
该技能的实际功能
该技能是一个极简的 RapidAPI 客户端,可将 RapidAPI 端点定义转换为可调用的操作。
其用途包括:
- - 将 RapidAPI 端点转换为稳定的操作名称
- 将输入标准化为查询/请求体/请求头/路径参数
- 返回一致的 ok/status/data/error/meta 结构
它不是一个服务器。它是一个小型本地客户端,可从脚本或其他技能中调用。
关键能力
- - 自动注册来自 {baseDir}/templates/*.json 的模板
- listActions() 枚举所有已注册的操作及其模式
- callAction(name, params) 调用模板定义的端点
- callRapidApi(payload) 允许无需模板直接调用 RapidAPI
- scripts/import-endpoint.js 将 RapidAPI 端点 JSON 负载转换为模板文件
基本用法
使用配置驱动初始化(推荐):
js
import { createRapidApiSkill } from {baseDir}/index.js;
import config from {baseDir}/config.json assert { type: json };
const skill = await createRapidApiSkill({ config });
const res = await skill.callAction(getusertweets, {
user: 2455740283,
count: 20
});
或直接调用(无模板):
js
const skill = await createRapidApiSkill({ config });
const res = await skill.callRapidApi({
host: twitter241.p.rapidapi.com,
path: /user-tweets,
method: GET,
query: { user: 2455740283, count: 20 }
});
模板设计说明
模板为纯 JSON 格式。应包含:
- - name、host、path、method
- querySchema(以及可选的 bodySchema、headerSchema、pathParams)
示例片段:
json
{
name: getusertweets,
host: twitter241.p.rapidapi.com,
path: /user-tweets,
method: GET,
querySchema: {
user: {type: string, required: true},
count: {type: number, required: true},
cursor: {type: string}
}
}
适用场景
当你需要一致且可复用的 RapidAPI 接口,而无需构建后端时,请使用此技能。
它特别适用于:
- - 社交数据 API(X/Twitter、TikTok、LinkedIn)
- 搜索/聚合 API
- 跨多个任务或工作流重复调用 RapidAPI