Skip to main content
If you like this API and want to support its continued operation, please sponsor us. Thank you very much!

API endpoint

BaseURL: https://hitokoto-api.ecylt.com

1. Get a random hitokoto

GET /api/hitokoto
Returns a random hitokoto quote.

Response example

{
  "id": 1,
  "content": "生命不息,奋斗不止",
  "source": "网络",
  "category": "f"
}

2. Get hitokoto by category

GET /api/hitokoto/{category}
Returns a random hitokoto from the specified category.

Parameters

ParameterTypeDescription
categorystringHitokoto category. Options:
- e: Original (includes community contributions)
- f: From the internet

Response example

{
  "id": 2,
  "content": "人生最大的遗憾,就是在最无能为力的时候遇到一个想要保护一生的人",
  "source": "我们仍未知道那天所看见的花的名字",
  "category": "f"
}

Error responses

When the category is invalid:
{
  "error": "Invalid category"
}
When no quotes are found for the specified category:
{
  "error": "No sentences found for this category"
}