← Back to Skills Marketplace
304
Downloads
0
Stars
4
Active Installs
2
Versions
Install in OpenClaw
/install joke-api
Description
Access diverse jokes by category, language, and type with filters for safe content using the free JokeAPI without requiring registration or an API key.
README (SKILL.md)
JokeAPI Skill
获取各种类型的幽默笑话,支持分类、语言、格式过滤。
概述
使用 JokeAPI 免费获取笑话,无需注册或 API 密钥。支持多种分类、语言和响应格式。
基本用法
获取随机笑话
joke random
获取指定分类的笑话
joke random --category Programming
joke random --category Misc,Pun
获取特定类型的笑话
joke random --type single # 单句笑话
joke random --type twopart # 双部分笑话 (setup + delivery)
过滤不当内容
joke random --safe-mode # 仅获取安全内容
joke random --blacklist nsfw,explicit # 过滤特定类型内容
指定语言
joke random --lang en # 英语笑话
joke random --lang de # 德语笑话
获取多个笑话
joke random --amount 5
搜索包含特定关键词的笑话
joke random --contains "programmer"
API 端点
主要端点
- 基础 URL:
https://v2.jokeapi.dev - 获取笑话:
GET /joke/{categories} - 获取信息:
GET /info - 获取分类:
GET /categories - 获取语言:
GET /languages
可用分类
Any- 随机分类Misc- 杂项Programming- 编程Dark- 黑暗幽默Pun- 双关语Spooky- 恐怖Christmas- 圣诞
过滤标志 (blacklistFlags)
nsfw- 不适宜工作场所religious- 宗教political- 政治racist- 种族主义sexist- 性别歧视explicit- 露骨内容
响应格式
json(默认)xmlyamltxt(纯文本)
示例代码
JavaScript/Node.js
const baseURL = "https://v2.jokeapi.dev";
const categories = ["Programming", "Misc"];
const params = [
"blacklistFlags=nsfw,religious,racist",
"type=single"
];
fetch(`${baseURL}/joke/${categories.join(",")}?${params.join("&")}`)
.then(res => res.json())
.then(joke => {
if(joke.type == "single") {
console.log(joke.joke);
} else {
console.log(joke.setup);
setTimeout(() => {
console.log(joke.delivery);
}, 3000);
}
});
Python
import requests
url = "https://v2.jokeapi.dev/joke/Programming,Misc"
params = {
"blacklistFlags": "nsfw,religious,racist",
"type": "single",
"format": "json"
}
response = requests.get(url, params=params)
joke = response.json()
if joke["type"] == "single":
print(joke["joke"])
else:
print(joke["setup"])
# 延迟后显示 delivery
print(joke["delivery"])
Bash
curl -s "https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&blacklistFlags=nsfw,religious,racist"
速率限制
- 每分钟最多 120 次请求
- 超出限制会返回 HTTP 429 错误
- 响应头包含速率限制信息:
Retry-After- 多少秒后重置RateLimit-Limit- 每分钟最大请求数RateLimit-Remaining- 剩余请求数
错误处理
API 返回统一格式的错误响应:
{
"error": true,
"internalError": false,
"code": 106,
"message": "No matching joke found",
"causedBy": ["No jokes were found that match your provided filter(s)"],
"additionalInfo": "The specified category is invalid...",
"timestamp": 1579170794412
}
HTTP 状态码
200- 成功201- 提交成功400- 请求格式错误403- 被黑名单封锁404- URL 不存在429- 请求过多500- 服务器内部错误
注意事项
⚠️ JokeAPI 包含多种类型的笑话,有些可能被视为冒犯性内容。建议:
- 启用
safe-mode参数 - 使用
blacklistFlags过滤不当内容 - 根据使用场景选择合适的分类
相关链接
Usage Guidance
This skill appears to be a simple client for the public JokeAPI. Before installing or running: (1) review the two provided scripts yourself — they are short and only perform HTTPS requests to jokeapi.dev; (2) note there is no automatic installer or declared binaries: the scripts expect python3 and curl and won't be added to your PATH unless you do so manually; (3) the skill makes outbound network requests to jokeapi.dev (so your queries/texts are sent to that service) and JokeAPI can return offensive content unless you enable safe-mode/blacklist flags; and (4) the package source has no homepage listed—if you want greater assurance, fetch the official client from the JokeAPI GitHub or run the included scripts in an isolated environment first.
Capability Analysis
Type: OpenClaw Skill
Name: joke-api
Version: 1.0.1
The skill bundle provides a legitimate interface for the JokeAPI (https://v2.jokeapi.dev) through Bash and Python scripts. Analysis of scripts/joke.sh and scripts/joke.py shows standard API interaction patterns, safe input handling (URL encoding), and no evidence of malicious behavior, data exfiltration, or prompt injection.
Capability Assessment
Purpose & Capability
The skill's name/description (Joke API client) match the included files and instructions. Minor mismatch: the SKILL.md and README show a 'joke' CLI command and the repo includes scripts (scripts/joke.py and scripts/joke.sh), but there is no install step or declared required binaries. The scripts assume python3 and curl are available and that the user will run the scripts or install them to PATH; these runtime dependencies are not declared in the registry metadata.
Instruction Scope
SKILL.md instructs only how to call the public JokeAPI endpoints and contains sample code (Node/Python/Bash). The runtime instructions and included scripts only perform outbound HTTP requests to the official JokeAPI domain and process responses; they do not read local credentials, system files, or send data to other endpoints.
Install Mechanism
No install spec is provided (lowest-risk category). Because code files are included but no installer is declared, the scripts will not be automatically placed on PATH; a user must run them directly or install them manually. This is a functional oddity but not a security risk by itself.
Credentials
The skill requests no environment variables, keys, or config paths. The scripts only make network calls to https://v2.jokeapi.dev. No credentials or unrelated service tokens are requested or used.
Persistence & Privilege
Skill flags are default (always: false, model invocation allowed). The skill does not request persistent presence or modify other skills or system-wide settings.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install joke-api - After installation, invoke the skill by name or use
/joke-api - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Initial metadata file (_meta.json) added for the skill.
- No changes to functionality or documentation.
v1.0.0
- Initial release of JokeAPI Skill.
- Fetch random jokes with support for category, type, language, and content filtering.
- Integrates with JokeAPI without needing an API key.
- Allows format selection (json, xml, yaml, txt) and rate limit awareness.
- Includes sample code for JavaScript, Python, and Bash.
- Supports safe-mode and blacklist filters to exclude inappropriate content.
Metadata
Frequently Asked Questions
What is Joke Api?
Access diverse jokes by category, language, and type with filters for safe content using the free JokeAPI without requiring registration or an API key. It is an AI Agent Skill for Claude Code / OpenClaw, with 304 downloads so far.
How do I install Joke Api?
Run "/install joke-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Joke Api free?
Yes, Joke Api is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Joke Api support?
Joke Api is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Joke Api?
It is built and maintained by Djttt (@djttt); the current version is v1.0.1.
More Skills