Skip to content

Breed library lookup ​

GET/pets/pet-info

Queries the platform's standard breed library. Use it to obtain the valid breed_code values for pet profiles and the display name of a breed in the requested language (the same value returned as breed_display_name in profile responses).

pets_type is not the profile pet_type

The breed-library pets_type accepts the strings cat / dog, while writing a pet profile uses the numeric pet_type (1 cat, 2 dog, 3 exotic). Map between them in your own code; they are not interchangeable.

Request URL ​

text
GET https://open-api.habitaxx.com/v1/ms-ai-fast/pets/pet-info?pets_type=dog&is_sort=1&locale=zh-CN

Request headers ​

http
Authorization: Bearer <ACCESS_TOKEN>

Query parameters ​

ParameterTypeRequiredDefaultDescription
pets_typestringYes—Only cat or dog; any other value returns 422.
is_sortintegerNo00 returns an object grouped by first letter, 1 returns a flat array; other values return 422.
localestringNozh-CNDisplay language; affects display_name and returns 400 when not enabled.

Response example: grouped by first letter (is_sort=0) ​

json
{
  "code": 200,
  "message": "success",
  "data": {
    "locale": "zh-CN",
    "items": {
      "A": [
        { "breed_code": "cat.egyptian-mau", "display_name": "埃及猫" }
      ],
      "B": [
        { "breed_code": "cat.ragdoll", "display_name": "布偶猫" }
      ]
    },
    "featured_items": [
      {
        "breed_code": "cat.ragdoll",
        "display_name": "布偶猫",
        "image_url": "https://upload.suoweilai.com/pets_image/buoumao.png"
      }
    ]
  }
}

Response example: flat array (is_sort=1) ​

json
{
  "code": 200,
  "message": "success",
  "data": {
    "locale": "zh-CN",
    "items": [
      { "breed_code": "dog.irish-wolfhound", "display_name": "爱尔兰猎狼犬" },
      { "breed_code": "dog.irish-setter", "display_name": "爱尔兰雪达犬" },
      { "breed_code": "dog.shiba-inu", "display_name": "柴犬" }
    ],
    "featured_items": [
      {
        "breed_code": "dog.shiba-inu",
        "display_name": "柴犬",
        "image_url": "https://upload.suoweilai.com/pets_image/chaiqvan.png"
      }
    ]
  }
}

Response fields ​

FieldTypeDescription
localestringLanguage actually used for this response.
itemsobject | arrayBreed catalogue: an object of "first letter → breed array" when is_sort=0, an array when is_sort=1.
items[].breed_codestringStable breed code such as dog.shiba-inu. Use this value when writing a pet profile.
items[].display_namestringDisplay name of the breed in the requested language.
featured_itemsarrayFeatured breeds.
featured_items[].breed_codestringFeatured breed code.
featured_items[].display_namestringFeatured breed display name.
featured_items[].image_urlstringFeatured breed image URL.

Common errors ​

HTTP / codemessageTrigger
422Input should be 'cat' or 'dog'pets_type has any other value.
422Input should be less than or equal to 1is_sort is outside 0-1.
400语言尚未启用: <lang>locale is not enabled in this environment; check GET /locales first.

Usage notes ​

  • breed_code is a stable code (prefixed with cat. or dog.) that never changes with language; only the display name follows locale.
  • When creating or updating a pet profile, the pet_type and the breed_code prefix must match: pet_type=1 (cat) uses cat.* and pet_type=2 (dog) uses dog.*, otherwise the API returns 400 宠物品种与宠物类型不一致; an unknown code returns 400 宠物品种编码不存在.
  • Exotic pets (pet_type=3) have no breed-library data; send the free-text pet_variety only.
  • Measured volume: about 96 dog entries with is_sort=1, and about 18 first-letter groups for cats.
最近更新

Qijie Open Platform · API Documentation