知识与趣味

冷知识API API

我们的冷知识API即时获取多类别趣味冷知识。 知识问答爱好者、好奇学习者或内容开发者,广泛话题独到洞察。

请求标头

Name Required Description
X-RapidAPI-Key required Your RapidAPI key. Get one free.
X-RapidAPI-Host required facts.p.rapidapi.com

端点

GET /v1/facts

Get random facts, optionally filtered by category

参数

NameTypeRequiredDefaultConstraints
categorystringoptional——
limitintegeroptional11-10

代码示例

curl --request GET \
  --url 'https://facts.p.rapidapi.com/v1/facts?category=example&limit=1' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: facts.p.rapidapi.com'
GET /v1/facts/categories

List all fact categories available in the dataset, sorted alphabetically.

代码示例

curl --request GET \
  --url 'https://facts.p.rapidapi.com/v1/facts/categories' \
  --header 'x-rapidapi-key: YOUR_API_KEY' \
  --header 'x-rapidapi-host: facts.p.rapidapi.com'

交互示例

facts
$ GET /v1/facts?category=science&limit=1
{"data":[{"fact":"Honey never spoils when stored in a sealed container.","category":"science"}],"meta":{"total":1,"limit":1,"offset":0}}

集成及使用指南

用全面的冷知识API发现无尽知识。

概述

我们的冷知识API即时获取多类别趣味冷知识。 知识问答爱好者、好奇学习者或内容开发者,广泛话题独到洞察。

主要功能

  • 多类别覆盖:众多类别冷知识
  • 随机获取:即时获得灵感
  • 结构化数据:易用JSON无缝集成
  • 定制洞察:按需定制数据
  • 可扩展方案:高效处理海量请求
  • 易于集成:简单的RESTful设计

API用法

极致简单:

# Example API Requests

GET /v1/facts/categories
GET /v1/facts/categories/{category}/random
GET /v1/facts/random

# Response Structure

Categories Endpoint:
[
  "Animals",
  "History",
  "Science",
  "Technology",
  "Sports",
  // ... more categories
]

Random Fact Endpoint:
{
  "text": "The shortest war in history was between Britain and Zanzibar on August 27, 1896, and lasted only 38 minutes.",
  "category": "History"
}

Random Fact Endpoint:
{
  "text": "The longest word in the English language, according to the Oxford English Dictionary, is pneumonoultramicroscopicsilicovolcanoconiosis, a lung disease caused by inhaling very fine particles of silica.",
  "category": "Health and Fitness"
}

为什么选择我们

  • 完整库:多主题趣味冷知识
  • 灵活获取:按类别、随机或混合
  • 实时更新:新冷知识不断
  • 可扩展方案:高效处理海量请求
  • 教育专注:学习应用、知识问答游戏与自学皆宜

订阅和许可

通过 RapidAPI 上的商业就绪层访问此 API。专为副项目、初创公司和大批量生产架构设计的灵活计划。

查看定价并订阅

开发者支持

需要集成帮助或有自定义端点请求?我们的工程团队随时为身份验证、有效负载模式和高频速率限制增加提供协助。

联系 API 工程部

系统性能

全天候 24/7 监控,正常运行时间 SLA 达 99.9%。构建在具有全球分布式边缘缓存的云原生微服务之上,以确保超低延迟响应时间。

所有系统均可运行