豆知識の操作
ランダムな犬の豆知識、または特定の品種の豆知識を取得します。
ランダムな豆知識
curl -H "x-api-key: YOUR-API-KEY" "https://api.thedogapi.com/v1/facts?limit=1"
[
{
"id": "high-incidence-of-degenerative-myelopathy",
"fact": "German Shepherds are predisposed to Degenerative Myelopathy (DM), a progressive spinal cord disease leading to hind limb paralysis.",
"title": "High Incidence of Degenerative Myelopathy",
"breed_id": "115"
}
]
品種の豆知識
品種IDを指定すると、その品種の豆知識だけを取得できます。limit と offset でページングし、lang(en、de、es、fr、it)で翻訳します。品種 115 は German Shepherd です。
curl -H "x-api-key: YOUR-API-KEY" "https://api.thedogapi.com/v1/facts/breed/115?limit=2&offset=0&lang=en"
翻訳された豆知識
curl -H "x-api-key: YOUR-API-KEY" "https://api.thedogapi.com/v1/facts/breed/115?limit=1&lang=it"
ページング対応のレスポンスには pagination-count、pagination-page、pagination-limit ヘッダーが含まれます。